|
Post by zenzou on Feb 3, 2011 22:30:52 GMT -5
I wanted to suggest some way to activate/deactivate girls without hard-coding them on/off. Trying to test bugs is a pain to do right now =\
|
|
|
Post by daisy_strike on Feb 4, 2011 6:53:52 GMT -5
ugh yah the only way to do that would be to parse it in at start... not something I want to do at the moment may do later on.
Daisy
|
|
|
Post by docclox on Feb 4, 2011 9:27:19 GMT -5
ugh yah the only way to do that would be to parse it in at start... not something I want to do at the moment may do later on. Want me to take a crack at an XML loader for the girls? Support in AS3 looks to be pretty good, so it shouldn't be a big job. I could move the names list out to a data file as well - make it easier to add names or to change the name style. (I quite like the WM multicultural list myself).
|
|
|
Post by daisy_strike on Feb 4, 2011 18:18:49 GMT -5
I won't say no, putting in a parser for options was a long term goal but it's pretty much out of my area of expertise though. I may have to read up on it.
Daisy
|
|
|
Post by docclox on Feb 4, 2011 18:46:53 GMT -5
I won't say no, putting in a parser for options was a long term goal OK, I'll look into it. [edit] On it now - looks straightforward enough. Do you want me to load assistants the same way? From the look if the code, it'll be no extra effort. [edit] hmmm... xml parsing works just fine, but the load is stalling - probably out of memory. I'm going to try a few things... [edit] Loads it ok - but it's not hiding the girl images for some reason - so when the game starts, you can't see the interface for pictures. I'll have to debug the original version and see how they get hidden in that. [edit] Whoo! Have you tried stepping through startGameNow() in the debugger? It takes ages to re-index all those images. Seconds for each operation. Possibly because of the number of images in the root clip? That's got to be a factor in the loading time. And this is running with the easyLoader option - it might well be worse with the full compliment of girls. [edit] I thought it was a problem loading the girl .as files - but if I hard code them the problem persists. I had an error wher girlArray wasn't being populated that didn't help ... sorted that and now I'm getting null reference problems. Enough for one day - I'll look at it again tomorrow,
|
|
|
Post by docclox on Feb 5, 2011 15:20:23 GMT -5
Well, I thought the problem was that the girls/girlname.as files weren't being loaded. But then I hard coded the three essential ones and it still broke. So I did a bit more digging and found the GirlArray was empty.
Still digging...
|
|
|
Post by daisy_strike on Feb 5, 2011 17:25:08 GMT -5
Did you change the loadtotal variable or loadernow variable so there not going into the push part of the function? Anyways looking interesting, lots of fun stuff.
Daisy
|
|
|
Post by docclox on Feb 5, 2011 17:52:28 GMT -5
Did you change the loadtotal variable or loadernow variable so there not going into the push part of the function? Anyways looking interesting, lots of fun stuff. Yeah, but that wasn't the problem. I had the limiting condition on a for loop wrong, so it wasn't running at all. Now, I think, it's loading null references for the GameMenace (et al) arrays. If you want to have a look, here's the loader and the XML: www.mediafire.com/?1jn0854algajm54Like I say, it doesn't work yet, but I can't see any reason it can't be made to work (except that I've had too much wine to do any more debugging tonight . I'm not sure whether we'll be able to get it to the point of adding girls without needing to recompile the main swf file - at least not without re-organising some data structures. But we should be able to enable and disable girls just by editing the xml file. [edit] What I might do if I get this working is add a loading screen so that you get a popup saying "Loading Menace ..." and a progress bar underneath. Maybe "Loading Menace (1/9) so we can at least see what's happening while the game loads. Should be fairly simple given the loader events available.
|
|
|
Post by daisy_strike on Feb 5, 2011 18:21:31 GMT -5
Out of my comfort area. So I don't know how much help I am going to be. Though I am really impressed by the:
var file:String = 'girls/' + name.toString() + '.swf'; trace("starting loader for " + file) loader.load(new URLRequest(file));
As a matter of fact most of that loader part is just completely better then any way I was doing it.
Daisy
|
|
|
Post by zenzou on Feb 5, 2011 22:36:35 GMT -5
Hey doc, in your xml's comments you reference "fastload==true" and "fast=true" while using 'easyloader="true"' and 'easy="true"' is this simply a mistake or are they actually different variables?
|
|
|
Post by docclox on Feb 6, 2011 4:41:36 GMT -5
Hey doc, in your xml's comments you reference "fastload==true" and "fast=true" while using 'easyloader="true"' and 'easy="true"' is this simply a mistake or are they actually different variables? Should be easyloader/easy - I changed the names to better match daisy's varaible names. Figured it would cause less confusion. I forgot about the comments. Thanks, I'll fix that, @daisy: That's very kind of you to say so [edit] ... aaaaaaannnndd, it Works! Problem was a really stupid one. There's a handler function for when loading is complete. I've added a few comments to hte last version posted var handler = function(e:Event):void { trace("handler func for " + name); /* * get the movie clip with the girl's pictures from the loader */ var mc:MovieClip = loader.content; /* * the girls indivudal code routines need * a global to exist under their name, lower case * we can create that by indexing the top level context */ context[name.toLowerCase()] = mc; /* * add the clip as a child of the current clip */ addChild(mc); /* * and now start loading the next girl, if any remain */ load_top(); }
What I did was miss out the () on the line context[name.toLowerCase()] = mc; So the moveclip wasn't being indexunder "menace" (say) but under a function reference. D'Oh! Sorted that out, and undid one commenting out when I was flailing around last night, and it works just fine. I'm goign to have a bit more play and see if we can do without the hard coded imports. Maybe have a shot at that loader screen.
|
|
|
Post by zenzou on Feb 6, 2011 6:46:53 GMT -5
Awesome. congrats.
Question: So is your .as file an addition to Daisy's or is it going to be separate?
I think we may need to check/adjust association of the girls' swf files in the other parts of the code so we don't have to do too much hard-coding as more comes get added/removed.
|
|
|
Post by docclox on Feb 6, 2011 7:46:02 GMT -5
Awesome. congrats. Question: So is your .as file an addition to Daisy's or is it going to be separate? I think we may need to check/adjust association of the girls' swf files in the other parts of the code so we don't have to do too much hard-coding as more comes get added/removed. I just modified loader.as, so there should be no problems there. Ideally, I'd like to get it so we can just drop swf files into the folder
|
|
|
Post by zenzou on Feb 6, 2011 8:40:45 GMT -5
Same here. How easy do you think it would be to translate the code to apply to items as well? Might as well right?
|
|
|
Post by docclox on Feb 6, 2011 9:34:56 GMT -5
Same here. How easy do you think it would be to translate the code to apply to items as well? Might as well right? Well, once we have the basics working, we can extend it to load other things, certainly. I'd want to look at the items a bit first though - it's a wee bit more complicated than it is in wm [edit] I've been trying to add a progress bar for loading the girls. This is what I have in mind: Trouble is, it doesn't update. Don't know why. I put a trace in the progress event handler and that shows it's being called, so I can only assume a problem with the scaling code. Also of interest: I added timestamps to the loading process. loading Menace starting loader for girls/Menace.swf at Sun Feb 6 17:45:53 GMT+0000 2011 loading complete girls/Menace.swf at Sun Feb 6 17:45:55 GMT+0000 2011loading Orihime starting loader for girls/Orihime.swf at Sun Feb 6 17:45:55 GMT+0000 2011 loading complete girls/Orihime.swf at Sun Feb 6 17:46:00 GMT+0000 2011
loading Princess starting loader for girls/Princess.swf at Sun Feb 6 17:46:00 GMT+0000 2011 loading complete girls/Princess.swf at Sun Feb 6 17:46:01 GMT+0000 2011
So that's two seconds to load Menace, five for Orihime and just one for the Princess. I suppose I should timestamp the whole process from starting the flash to removing the loading screen, but at a guess it takes more than 8 seconds to load the game. Of course, I'm not timestamping the people or generic swfs, nor the assistants, so that may account for the missing time. But I'm still worried about the time re-indexing seems to take on the top level movieclip. Anyway, the loading still works, which is the main thing. [edit] Also, there's going to be no drag-and-drop addition of girls in the short term. Two problems: - I can't dynamically import .as files, so each girl needs her own #include in the loader module
- There are lots of references to variables named for the girls in other parts of the code. I can create the variables programatically, but if the symbol isn't defined then the compiler sulks and the program won't run.
There are workarounds for both of those issues, but they're going to hit a lot of other code, and probably affect the process for creating new girls as well. So that's something we probably need to discuss before moving forward on it.
|
|