Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: sazterM on Mon 10/11/2008 23:10:11

Title: using 3 switches to trigger room change? [SOLVED]
Post by: sazterM on Mon 10/11/2008 23:10:11
Im at a loss TBH , what i want to do is use three switches to trigger a room change. i want it so the room changes only after all have been tripped (preferably in any order). Any advice on how i could do this would be great.
Title: Re: using 3 switches to trigger room change?
Post by: Trent R on Mon 10/11/2008 23:28:49
In the rep_exec in your room script:

if (trigger1==true && trigger2==true && trigger3==true) {
  //Whatever code, probably player.ChangeRoom
}


This makes your triggers each boolean (which would have to be declared at the top of the room script), but depending on what you want you can make it when another character leaves the room, or the player gets an inv. item, etc, etc. Either way, you should use && in the if statement.

~Trent
Title: Re: using 3 switches to trigger room change?
Post by: sazterM on Tue 11/11/2008 00:45:20
Thanks, all sorted now