Wait using frames.
Posted: Mon May 18, 2009 7:45 pm
I made another script, this one lets you wait for a set amount of frames.
Sentex - FrameWait(frames, "actor", 0 or 1). The FrameWait function disables the actors events intill the amount of frames has been reached. frames is the ammount of frames you want to wait for, actor is the name of the actor you want to pause, and 0 or 1 is the repeat. When it' on, it will constantly repeat the pause. To reset the pause, and use it again, simply make an event like this. Script editor > finish = 0;. You will need to put this in the global code.
Sentex - FrameWait(frames, "actor", 0 or 1). The FrameWait function disables the actors events intill the amount of frames has been reached. frames is the ammount of frames you want to wait for, actor is the name of the actor you want to pause, and 0 or 1 is the repeat. When it' on, it will constantly repeat the pause. To reset the pause, and use it again, simply make an event like this. Script editor > finish = 0;. You will need to put this in the global code.
- Code: Select all
int count;
int start;
int finish;
void FrameWait(int frames, char actor[255], int repeat)
{
if (count == 0)
{
start = 1;
EventDisable(actor, EVENTALL);
}
if (count != frames)
{
count = count + 1;
}
if (count== frames)
{
finish = 1;
start = 0;
}
if (finish == 1)
{
EventEnable(actor, EVENTALL);
count = 0;
}
if (repeat == 1)
{
finish == 0;
}
}