Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: CyberUncleCat on Tue 02/01/2018 01:35:03

Title: Hotspot / Object activation
Post by: CyberUncleCat on Tue 02/01/2018 01:35:03
Hello!

Todays problem is a scripting one as i am a noob :) .

Let's say i have a 2 rooms, and in room1 there is an object1 i can look onto, and interact with. When i look on it it hero says "its an object!" and if i want to interact he says "i dont need it right now", and does not pick it up. Its ok.

Problems arise when i interact with object2 in room2 as i want this interaction to trigger different interaction with object1 in room1 - i want hero to say "i need this to advance" when looking on it, and be able to pick it up when interecting with it.

How do i do that sirs?
Title: Re: Hotspot / Object activation
Post by: Slasher on Tue 02/01/2018 06:14:50
You should use a boolean Variable...

set to false

set to true when required and use that condition

if true do this
else do this
Title: Re: Hotspot / Object activation
Post by: Khris on Tue 02/01/2018 13:21:48
One of the most asked questions of all time. Answers easily findable by searching this forum for "another room" topics.

http://www.adventuregamestudio.co.uk/forums/index.php?topic=51781.msg636508029
http://www.adventuregamestudio.co.uk/forums/index.php?topic=55188.msg636569703

Finally, how to do this is explained in the Beginner's FAQ (http://www.adventuregamestudio.co.uk/wiki/Scripting,_Code_%26_Interaction#Turning_Objects.2FHotspots.2FRegions_On_or_Off_in_another_room.)
Title: Re: Hotspot / Object activation
Post by: CyberUncleCat on Wed 03/01/2018 03:18:14
Well yes, ive tried to find it but i used different (and bad it seems) keywords. And in faq i wasnt even sure where and what i must search.

I see, i will try implement this solution when i will have some free time.

And thank you for actual help and not washing me away with "learn to search noob" :).
Title: Re: Hotspot / Object activation
Post by: Khris on Wed 03/01/2018 11:34:13
You're welcome :)

Part of the problem is that people don't pick good titles for their threads. "Hotspot / Object activation" sounds like a problem with linking events to functions, but this thread is actually about changing another room's state.
Title: Re: Hotspot / Object activation
Post by: CyberUncleCat on Sun 07/01/2018 07:55:05
All right i tried it today, and after some time it finally worked (i had to understand concept of variables) but i got it. Really, if i can do this then even dog can become scripter.

Again, thank you both for help. I will try to search harder from now on:).