Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: nightmarer on Wed 18/03/2020 19:22:00

Title: [SOLVED] function room_SecondLoad()?
Post by: nightmarer on Wed 18/03/2020 19:22:00
Good evening all.

How can I create a function which activates if it is not the first time it loads, or if it is the third or forth time?

Regards.
Title: Re: function room_SecondLoad()?
Post by: Cassiebsg on Wed 18/03/2020 19:31:21
Depends, do you need to know how many times you visit the room, create an int variable, add +1 every time the player enters the room and then do an if condition to check where the counter is at.

If you just want something to happen the same every time except the first time, then just use the before and after fade in existing functions.
Title: Re: function room_SecondLoad()?
Post by: TheManInBoots on Thu 19/03/2020 02:33:41
In case it might be helpful I'd like to mention that there is also a room_FirstLoad() function that is only triggered once the very first time when the player enters the room
(if you check the room's events panel).
Title: Re: function room_SecondLoad()?
Post by: nightmarer on Thu 19/03/2020 10:38:47
Quote from: TheManInBoots on Thu 19/03/2020 02:33:41
In case it might be helpful I'd like to mention that there is also a room_FirstLoad() function that is only triggered once the very first time when the player enters the room
(if you check the room's events panel).

Yes, I know. My question was about a function which is not this one.
Title: Re: function room_SecondLoad()?
Post by: nightmarer on Thu 19/03/2020 10:40:01
Quote from: Cassiebsg on Wed 18/03/2020 19:31:21
Depends, do you need to know how many times you visit the room, create an int variable, add +1 every time the player enters the room and then do an if condition to check where the counter is at.

If you just want something to happen the same every time except the first time, then just use the before and after fade in existing functions.

Thank you very much. This works!!