howdy!
Is there a way to trigger an action by selecting (clicking on) a piece?
howdy!
Is there a way to trigger an action by selecting (clicking on) a piece?
Look at the Action Button trait.
True i totally forgot.
Iâd rather have the trigger only active when the unit is selected though. And deactivate once it isnât selected anymore. Otherwise the player always has to click the unit a second time to deactivate the trigger action.
Isnât there a basic property in each piece called selected with the value true and false or something? Maybe i could build a trigger on that?
Iâd rather have the trigger only active when the unit is selected though. And deactivate once it isnât selected anymore. Otherwise the player always has to click the unit a second time to deactivate the trigger action.
Your terminology doesnât make sense. Trigger Actions donât get âdeactivatedâ. Perhaps if you describe what you want to achieve without assuming a solution I can better advise as I need a picture of what you want to do.
You mean using the Vassal Property Selected in the expression Selected == âtrueâ All the Vassal Properties you can use (including âSelectedâ are in this list here.
Right, so i want to have an Area of Effect that is shown when a piece is selected, but that goes away automatically when i click somewhere else (when the piece is not selected anymore).
Ok, Now I know what you want! Yes, there is a way. Almost.
In the Area of Effect, uncheck the âFixed Radiusâ option and in the Radius Marker field enter the name of a Calculated Property in the piece (say Range).
Then create the Calculated Property name Range with the Expression
Selected ? 2 : 0
When selected, the piece will have an Area of Effect of 2, when unselected it will have an Area of Effect of 0.
The Almost is because when an AoE is showing, a range of 0 means the current hex is highlighted, so it doesnât quite go away.
Perhaps it would make sense that a -ve Range turns the Area display off altogether? That would be a simple change.
You can turn an AoE on and off using Key Commands, but this becomes vastly more complex (if at all possible) to achieve what you want.
Ha! Perfect, thank you!