Is there a hotspot_WalkOff event?

Started by mode7, Mon 08/11/2010 14:20:43

Previous topic - Next topic

mode7

I noticed there's a WalkOn event for hotspots but there isn't a WalkOff one.
I want to give an object a certain tint while the player stands on hotspot and if the player walks off, I wont to remove the tint.

Of course I could use Regions for that, but there are only 15 Regions and that won't be enough, in fact even 30 Hotspots could also be problematic, as I'm using pretty big bgs. Maybe there's a possibiblity to increase the count?

Mouth for war

maybe you could use something like...I don't know...if the character is on a specific x,y coordinate, tint the character and then remove the tint when he's standing on a different coordinate. Just a thought and have no idea if it would work. I'm not a great scripter :D
mass genocide is the most exhausting activity one can engage in, next to soccer

mode7

yeah, that would work - but the whole code would get really confusing - well at least thats a possibility. Maybe there's another way

Matti

#3
What version are you using? In 3.2 there's a limit of 50 hotspots. Also, there's no "WalkOn" but only a "StandingOn" for hotspots.

But I'd do it like Mouth suggested, the script shouldn't get confusing doing this.

Edit: It should look somehow like this:

Pseudo-
Code: ags

if      (Hotspot.GetAtScreenXY(player.x, player.y) == hHotspot1) oObject.tint();
else if (Hotspot.GetAtScreenXY(player.x, player.y) == hHotspot2) oObject.tint();
else if (Hotspot.GetAtScreenXY(player.x, player.y) == hHotspot3) oObject.tint();
...
else oObject.RemoveTint;

mode7

Hm thanks Matti - this way it looks really straightforward - I'll try this

Wyz

You can use Matti's code in a function that is called by the WalkOn events. I believe hotspot 0 (hotspot less parts) also triggers the event. If not you can use the repeatedly execute event.
Life is like an adventure without the pixel hunts.

SMF spam blocked by CleanTalk