Player moves to a room then 10 seconds later player moves to a different room

In the game if the player goes to the lake then lake becomes impure and a message is displayed that the lake has turned black.
There is a 10 second pause then the player is moved to the land of the dead and the game finishes.

My problem is finding a move the player to two difference places with a 10 second gap in between.
If this is not possible then I'd have to add in the displayed message that the player has moved to the lake and has caused the late to turn black resulting in the player going to the land of the dead.


SetTimeout (1) {
}

That's what you're looking for. After the number in () brackets (as seconds) has elapsed, anything between the {} brackets will trigger.

So, you want something like...

msg ("The lake has turned black...")
SetTimeout (10) {
MoveObject (player, Land of the Dead)
}

Now, say you want this to be a challenge - the player has to figure out something's wrong and get the hell out of there before it's too late.

msg ("The lake has turned black... Perhaps you should leave, quickly!")
SetTimeout (10) {
if (player.parent = "Lake") {
MoveObject (player, Land of the Dead)
}
}

Which would move the player to the Land of the Dead unless they were no longer in the Lake room.


Thanks Pykrete.

So it looks like you can type in commands while a timeout is taking place. It must interrupt the timer and ignore the commands after the timerout in the scrip.
It could be fun to use this feature in a game.


Log in to post a reply.

Support

Forums