Using map movement Key Command with multiple map windows

Howdy all,

The map window feature of Key Command to apply to all units ending movement on this map: is very handy.

A module might have multiple map windows which pieces may move between, and the action(s) invoked due to the piece movement may depend on which map the piece ends its movement. I see two ways to achieve different behaviors depending on which map the piece ends its movement:

  1. Have KeyCommand_A named in map_A properties for TriggerAction_A when the piece ends its movement on map_A, KeyCommand_B named in map_B properties for TriggerAction_B when the piece ends its movement on map_B, etc.

  2. Use a common Key Command such as “OnMove” with all maps and have TriggerAction_A trigger when CurrentMap == map_A, TriggerAction_B trigger when CurrentMap == map_B, etc.

For both schemes, the designer would need to write a Trigger Action for each case.

Is there a compelling reason to use one scheme over the other?

Is there another scheme that might be better than the two I have identified?

I have found it useful to have different map movement key commands when the maps are distinct in some way - eg. main map vs a setup map or player hand. This saves a clause in the triggers simply to determine what kind of map you are on.

Conversely, it is useful to use the same key command when the maps are essentially clones of each other - ie. logic is the same on each map, though access may different; obvious example; Player Hands.

One tip - use long form Key Commands for map movement. It avoids the possibility of users accidentally pressing a map movement key command, assuming you don’t want to allow this for some reason I can’t think of. Also, you can make these descriptive - e.g. mapMove, handMove etc.

1 Like

Thanks.

As you recommended, I use Named Key Commands in lieu of the traditional (keystroke based) Key Commands. I do so, not for the reason you stated which is a great reason that hadn’t entered my mind, but to help me keep straight what each of my Named Key Commands is supposed to do.

1 Like

Getting a bit off-topic here, but personally, I don’t think anyone should ever use keystroke-based commands for any actual game logic, for the reason pawnpusher just suggested. Better to use all Named Key Commands, and then have Trigger Actions that convert keystrokes or menu commands to Named Key Commands where you actually want the player to be able to directly trigger something.

4 Likes