Mittens 2018 will be in Boston this September. There are three spaces left, so check out the thread for details!

Author Topic: Hotspot / Object activation  (Read 257 times)

CyberUncleCat

  • Just old'n'lazy
Hotspot / Object activation
« on: 02 Jan 2018, 01:35 »
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?

Slasher

  • slasher
    • I can help with AGS tutoring
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Slasher worked on a game that was nominated for an AGS Award!
Re: Hotspot / Object activation
« Reply #1 on: 02 Jan 2018, 06:14 »
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

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Hotspot / Object activation
« Reply #2 on: 02 Jan 2018, 13:21 »
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

CyberUncleCat

  • Just old'n'lazy
Re: Hotspot / Object activation
« Reply #3 on: 03 Jan 2018, 03:18 »
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" :).

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Hotspot / Object activation
« Reply #4 on: 03 Jan 2018, 11:34 »
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.

CyberUncleCat

  • Just old'n'lazy
Re: Hotspot / Object activation
« Reply #5 on: 07 Jan 2018, 07:55 »
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:).