consecutive actions.

Started by passer-by, Sat 10/12/2005 09:15:51

Previous topic - Next topic

passer-by

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.

Ishmael

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 used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

passer-by

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...
:(

mozza

If you script it for each hotspot you can just copy & paste and that would make it easier IMO.

Ashen

#4
Or, as Ishmael said, make a custom function, something like:
Code: ags

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.
I know what you're thinking ... Don't think that.

Elliott Hird

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.

Ashen

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
I know what you're thinking ... Don't think that.

passer-by

Yes, I messed it! :-[

Interaction editors are nice things to have around, lol

But thanks for the suggestions.


SMF spam blocked by CleanTalk