Remember the old days of sequential programming when you would wait for something like user input or wait ‘till a task was done before progressing further in the code execution?
Well, for a while, I’ve been thinking of a way to be able to make gm objects work like that. Such as when you ask for text using get_string(), I wanted to be able to make my own GM objects act like a message box.
Or pop up a menu system that uses all of GM’s features, using objects and event to draw the menu, react to mouse click, alarms and so forth… But wait until the menu is done before continuing.
Well, here it is…
[Updated Feb 25 2008 12:43 PM]
I wrote a GMGameLoop that emulates a GM game frame with most events being triggered manually, to the best of my knowledge and skills.
What it allows to do (eventually) is to create an interface that works/acts as though it’s being run normally, but really, it’s executing within a loop.
Goodbye screen capture, instance_deactivate, clunkyness…
show_message(“Ah, you are done making your choice!? Good. Let’s get back to the game”);
So, would you kindly take a gander at the code and tell me what you think… If I missed anything or programmed something wrong…
Also, if you could try it out in one of your games? I need to know if I thought of everything and if everything is working as it would normally... There are simply too many variations to verify all by myself.
Also, check out the main function and see if anything could be made to work more efficiently.
Thanks, have fun. You’ll love this, I promise.
[Update Feb 23 2008]
Changed while for repeat in NSteps
Added Optional keyboard key in NSteps
moved var s to top of script
Added more accurate timer in GameFrame Tested with 240 room_speed (Yay) (Thank Yourself and myself)
[Update Feb 25 2008 12:43 PM]
Moved the Script in the demo object to an alarm (hoping this fixes GM6 hang problem)
Added recommended check if the event is currently executed so not to stack fault.
Fixed a code mistake for the _wasin local var... was using global_get (thank sinaz)
Potential fix for CPU hogging (thank xot)
-dumbfounded >>mouse down triggers mouse pressed<<
-solid object collision cannot be emulated (properly) unless I find a way to see if the colliding objects have a collision event. As the demo shows...
-demo ran in GM6 hangs (hopefully fixed Feb 25 2008)
-takes a lot of processor... (so!?? It's dedicated to the game Perhaps I can wip up a little DLL to handle this but I would prefer to keep this pure GML) (FEB 25 12:43 fixes it I hope)
>>issues with >>these<< means HELP ME!<<
Edited by icuurd12b42, 25 February 2008 - 05:48 PM.