Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Candle on Thu 07/07/2005 04:13:55

Title: remove hotspot not disable
Post by: Candle on Thu 07/07/2005 04:13:55
I found that if you have a hotspot and then put one over it you can't get at the one below .
So I had to split the doorknob in half and then use the disable one so the other one would ..
I have a dog watching a door and if you click on the doorknob before you feed him he bites you .
So had to do the half and half with the two DisableHotspot(3); .one is able while the other is not .
Title: Re: remove hotspot not disable
Post by: Gilbert on Thu 07/07/2005 05:16:47
That's how the areas works, areas cannot overlap, bear in mind about that.
Title: Re: remove hotspot not disable
Post by: Candle on Thu 07/07/2005 05:18:42
Ya that came to me when I couldn't get it to work . lol
Title: Re: remove hotspot not disable
Post by: Ashen on Thu 07/07/2005 11:24:31
Why did you need to use two hotspots for that? You could just use a condition:


//pseudocode
if (dogisfed == 0) {
  //Bite
}
else {
  //Open door
}


Or have I misread your post?
Title: Re: remove hotspot not disable
Post by: Candle on Thu 07/07/2005 19:00:28
How does the "if dog is fed" fit into it ?
Title: Re: remove hotspot not disable
Post by: Ashen on Thu 07/07/2005 20:24:54
Quoteif you click on the doorknob before you feed him he bites you

I read it as one hotspot triggered the 'Dog bites you' reaction, then when you feed the dog it disables that hotspot, and enables the one that opens the door. Although, as I said, I might've misunderstood the original post - I don't quite get why you needed, or thought you needed, two overlapping hotspots.

So, that code would go in the hotspot interaction, and isdogfed would be an int  (or maybe a bool if you're using 2.7) that gets changed when you feed the dog, to make the second interaction work. However, that was only psuedocode - if you tried to use it exactly as is it wouldn't work, e.g. you need to (at least) declare int dogisfed;.
Title: Re: remove hotspot not disable
Post by: Candle on Thu 07/07/2005 20:28:56
Oh man way above my head with that now .
Title: Re: remove hotspot not disable
Post by: Ashen on Thu 07/07/2005 21:30:13
Which bit? It's not actually that advanced, I'm probably just not explaining myself very well.

Start with the basics: Was I right in my guess as to whay you wanted 2 hotspots (one for before the dog was fed, one for after)?
Title: Re: remove hotspot not disable
Post by: Candle on Thu 07/07/2005 21:48:07
Yes , I have it like this .
Dog is by door . you have to give the dog" Treat inv #8 that removes the hotspot #2 and enables #1
So hotspot 1 takes you to room 7
The give dog treat is done in his  DOG character Interaction .
I guess I'm happy the way I have it now as it works and thats all that matters to me .
Title: Re: remove hotspot not disable
Post by: monkey0506 on Fri 08/07/2005 06:10:44
Question:

Couldn't you just set a global variable depending on whether the player gave the dog the treat or not, and then test it and base the interaction of a single hotspot upon the value of said global variable?

It seems a lot simpler than using two hotspots and having to enable/disable them and what-not.

Just a question/suggestion...
Title: Re: remove hotspot not disable
Post by: Ashen on Fri 08/07/2005 10:38:26
Which is exactly what I meant, I just didn't put it as clearly.
Title: Re: remove hotspot not disable
Post by: monkey0506 on Fri 08/07/2005 13:05:07
Oh, I thought that you were trying to help him do it his way... Once again...me when I'm tired.  I didn't go to sleep last night.  I was too concerned about one of my friends.  But I still found time to try and be helpful...not very successfully.
Title: Re: remove hotspot not disable
Post by: Ashen on Fri 08/07/2005 13:59:11
Well, if it actually helps to sort out the problem - rather than confusing things further like I did - that seems quite successfull. I wasn't complaining about you saying the same thing as me, just pointing out that you said it better.