OKAY SO... (long post warning)
Anyone out there ever use RPG Maker? It has this event system that is really sweet. Each event is only executed until after the previous one is done. This made it really easy to make little scripted sequences and full on cut scenes and such. I really want to be able to make something like it in Game Maker... but WHY?!
Well, up until now I've been using states and timers to do any sort of scripted sequence event. Like in Jottobots, the intro calls for a lot of things to happen. The screen starts off as black, and a bunch of little robots go flying by from the left to the right. Then the title drops down from the top of the screen and settles, followed by J. Otto and my name to appear with EXPLOSIONS. then after all of that, the character standing on the ground fades into view.
My current way of doing this relies on an object and a timer in that object that just always adds one to itself. So then I have "events" set up like so:
if (timer == 100) {
do the code to make an explosion
}
if (timer == 110) {
do the code to make a name appear
}
if (timer > 300 and timer <= 400) {
do the code to adjust the alpha to fade in the character
}
Then after all of this, when the timer reaches some value, it switches the "state" over to the normal game mode, which does no scripted sequences or anything. I guess this works, but it sucks when I have to adjust anything in the script. If I want to change the timing of something, I have to go and adjust every timer value until I fine tune it to get it right.
Now if I were to have some sort of system in place that executes scripts only when the previous one is done, then that sequence could be a whole lot simpler. It could be a matter of something like:
createJottobots(blah blah blah);
wait(500);
createTitle();
wait(200);
explode(something something something);
showText();
wait(20);
fade(the object covering the character and ground, time, etc etc);
controlRestore();
So each one of those would execute in order, waiting for the last one to finish before proceeding with the next. So if I wanted to adjust the order of something, all I have to do is just cut and paste, and adjust things like the wait() events.
That's a pretty simple linear example, and I had thought up of just a system of where there's an object that has some ds_queues. In the queues are the scripts and their respective arguments. It only executes while a flag says it's okay to do so, and every time it executes one it changes this flag to false, and the script itself is responsible for when it should be set back to true to run the next event.
But then I realized... it's going to be kinda hard to do stuff like if statements and loops, since they wont be part of the queue, and will be evaluated when the scripts are added! Not when they're executed...
So now I'm working on a different way to do this, but I guess
the point of all of this is: Does anyone know exactly what I'm talking about? Is there a certain term for this kind of system that I should know so I can look stuff up about it? Has anyone ever actually done anything like this before and can point me in the right direction like a kid with a blindfold on swinging a bat at a stuffed animal with candy inside?
So far I've found a "command stack" example on the GMC, but seems absurdly complicated from what I started with. There's also an "ai" extension of some sort, but it's not exactly what I'm looking for either. I'm working on my current version of this event system thing that should handle conditions and loops, and its showing some promise -- but if anyone has any resources about this stuff I'd appreciate it!
tl;drI want to make an event system like RPG Maker's in Game Maker. Haha.
p.s. special thx arthur lee