If I have one or more friendly units and I want that when you select an enemy unit or any unit that is not mine, I want a trigger to reselect my unit with certain conditions as to be heroic for example.
I've thought about when you press the right mouse button as an event necessary to run the trigger, but I don't know how to select my unit under certain conditions for selecting a heroic unit.
Obviously youll have to customize this to fit your map. Youll need to set a global variable as the unit you want selected, set the variable to the unit immediately after its created via trigger, or set it if its placed. Then replace UNITGLOBALVARIABLE with the variable you used for the unit you want selected if the player selects something other than a unit owned by them.
If I have one or more friendly units and I want that when you select an enemy unit or any unit that is not mine, I want a trigger to reselect my unit with certain conditions as to be heroic for example.
I've thought about when you press the right mouse button as an event necessary to run the trigger, but I don't know how to select my unit under certain conditions for selecting a heroic unit.
Try something like this:
Obviously youll have to customize this to fit your map. Youll need to set a global variable as the unit you want selected, set the variable to the unit immediately after its created via trigger, or set it if its placed. Then replace UNITGLOBALVARIABLE with the variable you used for the unit you want selected if the player selects something other than a unit owned by them.
Thank you very much, it works perfectly.
I made some modifications in cases where there is more than one player if not match with player 1, I changed the number 1 by (Triggering player).
Would be something like this: