Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: alimpo83 on Sat 16/09/2006 14:36:06

Title: Hotspot On/Off
Post by: alimpo83 on Sat 16/09/2006 14:36:06
How can I create a Hotspot that is off then we click it it turns on, but if we click it one more time it turns off again? Please help! ;D
Title: Re: Hotspot On/Off
Post by: Ashen on Sat 16/09/2006 14:47:13
Well, you can turn hotspots On/Off with the Hotspot.Enabled (http://www.adventuregamestudio.co.uk/manual/Hotspot.Enabled.htm) property. But - obviously - if it's Off to start with, clicking it won't do anything.

What are you actually trying to do? Perhaps there's a way to work around it (e.g. using a variable for whether the hotspot is 'On' or 'Off', rather than actually enabling/disabling it).
Title: Re: Hotspot On/Off
Post by: alimpo83 on Sat 16/09/2006 15:07:06
Lol I'm sorry I meant a hotspot that is ON than you click it then it comes off then you click it and becomes on again. Like a light switch.
Title: Re: Hotspot On/Off
Post by: Ashen on Sat 16/09/2006 15:59:58
Well, you'll still have the thing that once you turn it Off, clicking it won't do anything.

Variables would probably be your best bet here, like I said. Unless turning the Hotspot On/Off affects something else (like turning an Object On/Off, changing the Background frame, etc), in which case you could use that instead of a variable.
Title: Re: Hotspot On/Off
Post by: R4L on Sat 16/09/2006 17:58:16
For a light switch, the Flashlight Plug-in would be your best bet, since you could use a hotspot, and only have to turn the flashlight on and off, not the hotspot.
Title: Re: Hotspot On/Off
Post by: alimpo83 on Sat 16/09/2006 20:04:55
No, I don't want a light switch, I just used that as an example. I'll explain the puzzle:

You enter a place that has multiple paths that lead to different rooms. Some rooms could only be entered if you click some buttons in other rooms, but If you click those button again, those room couldn't be accessed again. I'd use OtherRoom module for that, but ashen talked about variables. I get the idea, just don't know how to use them!
Title: Re: Hotspot On/Off
Post by: Ashen on Sat 16/09/2006 20:13:03
Well, check the BFAQ (http://americangirlscouts.org/agswiki/index.php/Scripting%2C_Code_%26_Interaction#Working_with_variables:_the_basics), search the forums (90% or more of answers involve variable use - even if it's not exactly what you want, it should give you a clue HOW to do it), and then try it out. If it doesn't work, post what you've got and we'll see.
Title: Re: Hotspot On/Off
Post by: mishels on Mon 18/09/2006 19:09:42
Mind you, alimpo that if you want something in one room to affect things in another room you have to use global variable. Check the manual for Global Variables.