Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: passer-by on Sat 10/12/2005 09:15:51

Title: consecutive actions.
Post by: passer-by on Sat 10/12/2005 09:15:51
I need the following actions realised after I "look at" a hotspot:
Let's say I look at Hotspot 1. I want message 0 displayed, hotspot 2 enabled and 1 point added on first execution. So far so good, I use the interaction editor and everything is fine, only I want this sequence to happen for all the remaining hotspots...
Example: Look at hotspot 1, display message 0, enable hotspot 2, add 1 point on first execution, look at hotspot 2, display message 1, add 1 point on first execution, enable hotspot 3 and so on...

Is there a quicker way than using the interaction editor?

Thanks.
Title: Re: consecutive actions.
Post by: Ishmael on Sat 10/12/2005 11:39:20
You'll just need to script each hotspot on it's own. Unless you want to make a custom function that would handle it via mouse click detection. That would anyhow be about as much work as going through them one by one, I think...
Title: Re: consecutive actions.
Post by: passer-by on Sat 10/12/2005 11:40:45
Quote from: Ishmael on Sat 10/12/2005 11:39:20
You'll just need to script each hotspot on it's own. Unless you want to make a custom function that would handle it via mouse click detection. That would anyhow be about as much work as going through them one by one, I think...

I thought so...
:(
Title: Re: consecutive actions.
Post by: mozza on Sat 10/12/2005 11:53:48
If you script it for each hotspot you can just copy & paste and that would make it easier IMO.
Title: Re: consecutive actions.
Post by: Ashen on Sat 10/12/2005 12:12:36
Or, as Ishmael said, make a custom function, something like:

function HotspotLook () {
  Hotspot *theHot = Hotspot.GetAtScreenXY(mouse.x,mouse.y);
  Display("Check");
  if (hotspot[theHot.ID +1].Enabled == false) {
    hotspot[theHot.ID +1].Enabled = true;
    GiveScore(1);
  }
}


And just copy/paste HotspotLook(); for every hotspot.
Title: Re: consecutive actions.
Post by: Elliott Hird on Sat 10/12/2005 12:27:58
or define hotspotlook in the global script and export it, in the room header add import function hotspotlook, and just use hotspotLook(); copynpasted for each 1.
Title: Re: consecutive actions.
Post by: Ashen on Sat 10/12/2005 12:32:15
Ah, yes. If you want to use it in more than one room, make sure you declare it and import it globably (functions don't need to be exported). I'd assumed it was just needed in a specifc location, in wich case just putting it in the Room Script would be OK
Title: Re: consecutive actions.
Post by: passer-by on Sat 10/12/2005 17:27:29
Yes, I messed it! :-[

Interaction editors are nice things to have around, lol

But thanks for the suggestions.