HELP - I want a movement to a location trigger an action

I have a map with numbered locations representing HP. Players can move an HP counter piece between the numbers to track their HP or an enemy’s HP. I would like the movement of the HP counter to the “0 HP” location to automatically trigger a message such as “The enemy has been defeated” and maybe play a sound. So on the HP counter piece I set a Trigger Action to trigger when properties match: {LocationName==“0 HP”} and send out CTRL D. There is also a Report Action set to display on CTRL D. However this doesn’t work. I CAN right click to display the message when the piece is at 0 HP but it is not automatic. I guess I am using the Trigger Action property incorrectly? How should I go about doing this?

Have you got your Trigger Action’s WATCH FOR THESE KEYSTROKES set to fire on MovedOnMap?

By the way, its not mentioned in the manual, but you can use strings like “reportHPsZero” instead of key combinations like CTRL D. This is kind of obvious (as the strings are just long key combinations) - but wasn’t to me, and using descriptive terms has made developing a lot easier for me.

Hi Danny,

The properties match field on a trigger is a “necessary but not sufficient” condition for the trigger to fire – it still has to receive an incoming “keystroke” – either by the player activating it manually (e.g. when you use the right click menu) or if a keystroke (real or virtual) is received from somewhere else. So as Martinov mentions, you’ll want to open up the properties for your “Map” that these counters move on, and the very bottom box is “Key Command to apply to all units ending movement on this map” – if there’s nothing there, make a Named Keystroke (e.g. “MovedOnMap”). Then, go back to your checking-for-0-hp trigger, and in the “Watch For These Keystrokes” part of the trigger, add “MovedOnMap” (or whatever other keystroke you use there).

So now, whenever the HP marker moves, it is receiving a “MovedOnMap” trigger, and so if your trigger is listening for it, it will then check its propertymatch condition that you have set, and when it’s on the 0 space will fire to display your message.

Thanks a lot Martinov and Cattlesquat. That makes so much sense now. It worked!