Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: metalmario991 on Sun 18/01/2015 03:40:54

Title: First
Post by: metalmario991 on Sun 18/01/2015 03:40:54
How do I make it so an event happens only the first time you do it?
Title: Re: First
Post by: monkey424 on Sun 18/01/2015 04:15:16
Quote from: metalmario991 on Sun 18/01/2015 03:40:54
How do I make it so an event happens only the first time you do it?

Depends what event it is.

If the event is walking into a room, use function room_FirstLoad().

If the event is something else, say clicking on a hot spot, then declare a boolean variable with an initial state of 0, and set it to 1 once the event has happened. Only run the event on the condition that the variable is 0.

Good luck!
Title: Re: First
Post by: monkey0506 on Sun 18/01/2015 08:31:24
Game.DoOnceOnly, followed by RTFM.


I wasn't going to, but with a thread title like that...