Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: MalleTheRedPhoenix on Sun 11/05/2008 22:35:48

Title: Displayspeech after a time
Post by: MalleTheRedPhoenix on Sun 11/05/2008 22:35:48
I have a problem.

I want that the character says a sentence after I didn't something in the game.

Example:

I'm in the startscreen and I have to click on the start-button. The character begins to be nervous and says: "Please click on the start-button."

After a short time, when I didn't something again, the character says: "Didn't hear me. I said you must click the start-button to start the game." etc.

Can somebody help me?
Title: Re: Displayspeech after a time
Post by: TwinMoon on Sun 11/05/2008 22:48:06
SetTimer works for me.
Title: Re: Displayspeech after a time
Post by: MalleTheRedPhoenix on Sun 11/05/2008 22:50:27
Can you give me an example or how should I write it in the script?

And where should I put it: In R. Execute or Players Enters Room (a.f)?
Title: Re: Displayspeech after a time
Post by: TwinMoon on Sun 11/05/2008 22:54:29
in room_Load or room_AfterFadeIn, put:


  SetTimer(1, 400);


40 is one second, so 400 will be about 10 seconds.
in the repeatedly execute of that room, put:


if (IsTimerExpired(1) == 1) {
  character.Say("Please click on the start-button. It's getting boring now.");
}
Title: Re: Displayspeech after a time
Post by: Khris on Sun 11/05/2008 22:59:54
And add SetTimer(2, 400); after the .Say for the next sentence.
Title: Re: Displayspeech after a time
Post by: MalleTheRedPhoenix on Sun 11/05/2008 23:18:37
Thanks for the help. It functions! :)