Delaying MoveObject

Started by , Fri 29/08/2003 16:55:25

Previous topic - Next topic

Plog

I have this script for my intro but I'm not sure how to make its so the MoveObject command plays when its supposed to. I have delays on the loops for my animating objects if that helps.

function room_a() {
 // script for room: First time player enters screen
SetObjectView(0,3);
SetObjectView(1,3);
SetObjectView(2,3);

AnimateObject(0,0,5,0);
AnimateObject(1,2,5,0);
MoveObject(3,200,170,5);
AnimateObject(2,3,5,0);
 

}

Scummbuddy

Wait
Wait (int time)

Pauses the script and lets the game continue for TIME loops. There are normally 40 loops/second (unless you change it with SetGameSpeed), so using a value of 80 will wait 2 seconds. Note that no other text scripts can run while the Wait function is in the background.
Example:

MoveCharacterBlocking(EGO,120,140,0);
Wait(80);
FaceLocation(EGO,1000,100);

will move the character EGO to 120,140, wait until he gets there (MoveCharacterBlocking) then wait for 2 seconds (80 game cycles) and then face right.
See Also: WaitKey, WaitMouseKey
- 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

SSH

However, the AnimateObject function isn't blocking. So, if you want that move to happen after the first two object animations are complete, then you need to use AnimateObjectEx with the blocking parameter set to 1.
12

SMF spam blocked by CleanTalk