So, here is the scoop:
I am attempting to write a scenario where the main character walks around the map screen and a random event can occur in certain rooms. When the event occurs, a shadow will cross the ground. Afterwards, the player will have a certain amount of time to leave the room before the dragon appears and begins to swoop after him. If the player doesn't make it in time, then a new scene will begin.
So, here are my problems:
I am having difficulty making a gap of time, between the shadow passing and the dragon appearing, to allow the player some time to react. Instead of waiting for the time I've given, it just tosses the dragon in right when the script starts to run.
My second issue is figuring out how I can get the dragon to move until it's reached a certain point to start the new scene and allow the player to still have control until that point is reached.
Here is the script I've currently got:
// script for Room: Player enters screen (after fadein)
int ran=Random(4);
if (ran==0) cDragon.ChangeRoom(-1);
else if (ran==1) cDragon.ChangeRoom(-1);
else if (ran==2) cDragon.ChangeRoom(-1);
else if (ran==3) { object[0].Visible = true;
object[0].Transparency = 50;
object[0].Move(380, 145, 3, eNoBlock, eAnywhere);
Wait(200);
cDragon.ChangeRoom(7);}
return;
In order to make the dragon appear AFTER the length of time you choose, you could set a timer and check in rep_execute whether the timer's expired, and if so, bring in the dragon.
The second issue is similar - put a command like cDragon.WalkTo(x,y) when you want to start movement, and then in rep_exec check whether the dragon IS at those coordinates, and if so, run the code. Or, alternatively, and I'd feel more comfortable this way myself, you can add a bool or a variable, and set it to 1 AFTER you tell the dragon to move. Then in rep_exec you can do "if [variable]==1 && cDragon.Walking==0)".
Mind you, this is off the top of my head, I'm kinda sure these names aren't the actual names you'll use.