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."
Development > Triggers
(Solved) Permanent Unit Selection.
- 7 posts
-
Charysmatic Regular Shmoe
- Join date
- Dec 29, 2011
- Location
- United States
- Reputation
- 0
- Posts
- 90
- Last login
- May 24, 2013
Last edited Feb 23, 2013 by Charysmatic -
KingRadical Regular Shmoe
- Join date
- Oct 20, 2011
- Location
- United States
- Reputation
- 3
- Posts
- 149
- Last login
- May 24, 2013
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))"
-
DemoniacMilk Regular Shmoe
- Join date
- Feb 14, 2013
- Location
- Germany
- Reputation
- 0
- Posts
- 15
- Last login
- May 09, 2013
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?
-
willuwontu Regular Shmoe
- Join date
- Nov 17, 2012
- Location
- United States
- Reputation
- 10
- Posts
- 372
- Online now!
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 playerLast edited Feb 24, 2013 by willuwontuI'm watching you
-
DemoniacMilk Regular Shmoe
- Join date
- Feb 14, 2013
- Location
- Germany
- Reputation
- 0
- Posts
- 15
- Last login
- May 09, 2013
-
Demtrod Regular Shmoe
- Join date
- Mar 27, 2012
- Location
- Denmark
- Reputation
- 3
- Posts
- 255
- Last login
- May 23, 2013
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.
- 7 posts
Demtrod Regular ShmoeI 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?
Gridlock TD : Elements