After the trigger selects the unit for the player, use the action "Enable/Disable Selection Type" then change the type parameter to "all." If the permanently selected unit dies or the unit that you want selected changes, you'll have to reenable the selection types before you select it for the player. I've seen some maps a method like yours before, but I think that was to allow units to be clicked and trigger the corresponding event. So if you do it this way, I'm assuming you won't be able to use the event "unit is clicked."
if you want, you could also try having another trigger with the event "any unit is deselected by any player" then have the action be "select (triggering unit) for (owner of (triggering unit))"
Wouldn't that cause a loop?
Reselecting the previously selected unit deselcts the selected one, starting the trigger again ... or does this not count for it was not the player who was deselecting the unit?
actually it would add a unit to the selection like you were holding shift.
what he wants is unit any unit is selected by player any player condition: or * selected unit =! playerunit * any unit is deselected actions: deselect all units for player triggering player select playerunit for player triggering player
I currently got this trigger;
While this works somehow okay, I want to completely prevent a player from selecting other units (as if the Unselectable flag was ticked).
I tried setting the unit owned by the player to be the only one with the Unselectable flag unticked, but the access was denied:
How would I go around making a unit permanently selected?
@Demtrod: Go
After the trigger selects the unit for the player, use the action "Enable/Disable Selection Type" then change the type parameter to "all." If the permanently selected unit dies or the unit that you want selected changes, you'll have to reenable the selection types before you select it for the player. I've seen some maps a method like yours before, but I think that was to allow units to be clicked and trigger the corresponding event. So if you do it this way, I'm assuming you won't be able to use the event "unit is clicked."
if you want, you could also try having another trigger with the event "any unit is deselected by any player" then have the action be "select (triggering unit) for (owner of (triggering unit))"
@KingRadical: Go
Wouldn't that cause a loop? Reselecting the previously selected unit deselcts the selected one, starting the trigger again ... or does this not count for it was not the player who was deselecting the unit?
@DemoniacMilk: Go
actually it would add a unit to the selection like you were holding shift.
what he wants is unit any unit is selected by player any player
condition: or
* selected unit =! playerunit
* any unit is deselected
actions:
deselect all units for player triggering player
select playerunit for player triggering player
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
@willuwontu: Go
ou right, he didn't deselect.
Your method should work fine.
@Charysmatic: Go
I used this method. I simply disabled all selection for the player (after his unit was selected) and then I enabled it again when it died.
Thanks for the suggestions though, but this seems to be the most clean and efficient way to do it.