New Room when object finishes animating

Started by Nixxon, Wed 18/06/2003 18:30:25

Previous topic - Next topic

Nixxon

Greetings :D
Simply put, how would i script a new room to load once my object has finished it's animation view/loop?

heres the object and animation in question -
SetObjectView(1,22);
AnimateObject(1,0,3,0);

thanks :D

EDIT -
Tried this to no avail
while (IsObjectAnimating(1)==0) NewRoom(9);

Scummbuddy

Why not put in a wait command with as many game cycles that the animation takes to go after the animate call, and then do newroom?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Archangel (aka SoupDragon)

The code should read this:

SetObjectView(1,22);
AnimateObject(1,0,3,0);
while (IsObjectAnimating(1)) {
Wait(1);
}
NewRoom(9);

TerranRich

Quote from: Archangel on Wed 18/06/2003 20:51:34
The code should read this:

SetObjectView(1,22);
AnimateObject(1,0,3,0);
while (IsObjectAnimating(1)) {
Wait(1);
}
NewRoom(9);

Yes, because other wise the game would be trying to change rooms every single time it checks to see if the object is animating, which is usually 40 times per second, unless changed.
Status: Trying to come up with some ideas...

Nixxon

#4
Thanks people,
I often avoid using wait, sinse my comp is a mediocre chunk of shyte Wait(40) which is equal to 1 second can often be around 6 seconds, hard to keep things in sync. Anyways ill try the code, Cheers ;)

- Yup all workies :D thanks again

Timosity

The other code may work but you were close with your original one

This is how it works

while (IsObjectAnimating(1)==1) Wait(1);
NewRoom(9);

it will wait till the animation completes and then go to the new room

SMF spam blocked by CleanTalk