Community
SCI Programming => SCI Syntax Help => Topic started by: Cloudee1 on January 29, 2007, 07:38:50 AM
-
So over the years, i have been adding bits and pieces here and there to the template game some of which I made comments about and some of them I didn't so it is impossible for me to actually find all of the edits.
Anyway, I have noticed something in my quest for memory domination ;D and I was wondering if this was caused by some of my edits or if this is the case for everyone. I have noticed that if I change the end of the title screen script from (send gRoom:newRoom(INITROOMS_SCRIPT)) to (send gGame:restart()) alot more memory resources are freed up. I'm still using a list of UnLoad(rsVIEW 800) for every resource I used, but that same list is used both ways.
I just ran a little test and using initrooms script I have 13930 free Bytes of heap, using restart gets me to the same point with 16428 free Bytes. Have I changed something causing my initrooms script to malfunction or is it indeed true that using restart instead of initrooms frees more memory at game start?
-
It does have very slight difference here too. At first the free heap was 17262 bytes, but with restarting it was 17354. As the manual states about the RestartGame() function .. "It restarts the game by stopping all the sounds, disposing of the menubar, clearing the heap status, and disposing of all the scripts. ". But I wonder where this difference comes from ..
-Eigen
-
Actually, this is the usual way of skipping past/ending the intro in SCI games. The template game is modeled after LSL3; that one is an anomaly. Most other games don't use an INITROOMS script at all - I'm surprised you'd try this, though.
Lars
-
Trying it was a result of putting buttons up "start" "intro" "restart" on the titlescreen after clicking the mouse. I had the syntax handy for restart so I copied and pasted it in there for the start button figuring it puts at the same point as the end of the initrooms script.
I had assumed however that restart at some point crossed paths with the initrooms script. But reading your last comments, I guess it probably doesn't afterall. I'm also guessing that since the title screen is the only thing that ever calls the initrooms script (I don't see any others anyway) then we really don't need the initrooms script at all.