I currently got this trigger;
Unit Selection - Any Unit is Selected by player Any Player
Unit Selection - Deselect all units for player (Triggering player)
General - If (Conditions) then do (Actions) else do (Actions)
(CurrentHero[(Triggering player)] is alive) == True
Unit Selection - Select CurrentHero[(Triggering player)] for player (Triggering player)
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:
Catalog - Set value of Units (Unit type of (Last created unit)) FlagArray[Unselectable] for player (Triggering player) to (String(0))
How would I go around making a unit permanently selected?
Gridlock TD : Elements
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 playercondition: or* selected unit =! playerunit* any unit is deselected actions:deselect all units for player triggering player select playerunit for player triggering player
I'm watching you
Need Help with dialogs? Use Dialogception
ou right, he didn't deselect.
Your method should work fine.
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.
You must login to post a comment. Don't have an account? Register to get one!