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.
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...
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...
:(
If you script it for each hotspot you can just copy & paste and that would make it easier IMO.
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.
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.
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
Yes, I messed it! :-[
Interaction editors are nice things to have around, lol
But thanks for the suggestions.