Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: DrewCCU on Sat 17/04/2010 20:57:40

Title: Bool issue
Post by: DrewCCU on Sat 17/04/2010 20:57:40
Okay ... i dont know exactly how i need to set this code up or exactly where (room or global) - i've tried a couple different things but can't get anything that doesn't give me an error. Maybe you guys could help me out real quick and tell me what i need to do. here is what i need.

I have a bool - when it is set to false and you click on certain buttons within gui menus then i need certain stuff to happen. 

So ...

If (!bool) {
    press this gui button and you get this result.
}

the bool will be turned on/off by switch in the game the player can flip on and off again anytime they want. so i assume i would also need something thats constantly checking if that bool is on or off?
Title: Re: Bool issue
Post by: Gilbert on Sat 17/04/2010 21:18:32
You shouldn't need to do the checking constantly, just declare that boolean variable as global and check it in the GUIs buttons' script.
Title: Re: Bool issue
Post by: DrewCCU on Sat 17/04/2010 21:28:25
wow. i feel like an idiot. that was much simpler than i was trying to make it. lol. thanks!