Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: HaReL on Fri 10/08/2007 13:28:35

Title: Adding timer to the game?
Post by: HaReL on Fri 10/08/2007 13:28:35
I want to make a room , that after 3 seconds (for example), it will pass to the next room.
How do I do it?
Thank U in advance... ;)
Title: Re: Adding timer to the game?
Post by: Akatosh on Fri 10/08/2007 13:36:54
Been asked and answered before (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=30403.0).
Title: Re: Adding timer to the game?
Post by: strazer on Fri 10/08/2007 17:16:10
HaReL, what do you want to do exactly? Is it a cutscene or is the room interactive? More info please.
Title: Re: Adding timer to the game?
Post by: HaReL on Sun 12/08/2007 11:04:51
I want to do cutscene.. after you do somthing, a screen with "After Few Hours" appear, and then you in move to another room...

I've tried the link that Akatosh gave me, but it didnt work... :-\
Title: Re: Adding timer to the game?
Post by: Khris on Sun 12/08/2007 16:13:26
In the room with the message, put this in "player enters screen (after fadein)":

  Wait(GetGameSpeed()*3);  // 3 seconds delay
  player.ChangeRoom(x);  // put the new room number here instead of the x


The player isn't supposed to interact with stuff anyway, so you don't need a timer to do it. Just call Wait to block the game for a couple of seconds, then load the next room.

Wait is blocking, so if you didn't use a transparent sprite for the wait cursor, it will show.
If you don't want this, hide the mouse in "player enters screen (before fadein)".
Just call "mouse.Visible=false;".

Do the same in the following room but set it to "true" to make the mouse visible again.
Title: Re: Adding timer to the game?
Post by: HaReL on Sun 12/08/2007 17:52:23
well, thanks for the response, but i didn't understand so well.
How do i do the "player enters screen"?

i've search in the help, but the only thing i found is

on_event (EventType event, int data)
Called whenever certain game events happen.
...
eEventEnterRoomBeforeFadein
      called just before room Player Enters Room event is run.
      DATA = new room number


and I understand that this go to the global script, not into the room...

if you can explain me again how to do this exactly, it will be great.. ;)
Title: Re: Adding timer to the game?
Post by: Khris on Sun 12/08/2007 17:55:32
I recently explained this in another thread:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32074.msg413927#msg413927
Title: Re: Adding timer to the game?
Post by: HaReL on Sun 12/08/2007 18:33:52
OK, it's works!

Thank you! ;)