Forcing unit selection without hiding UI buttons

Status
Not open for further replies.
Level 23
Joined
Mar 16, 2014
Messages
345
I have a problem. I am using the action "select X unit for player" function, but doing so gets rid of all of the UI buttons on the unit. I have to manually select another unit other than X, then select X manually to get the UI buttons. All UI buttons are gone including attack, move, hold position, etc, as well as abilities.

How do I force a player to select a unit without hiding the UI buttons?
 
Hmm I'm not getting that problem in this test map (press ESC to switch selected unit). Do you have any triggers to share? Or perhaps you can try reproducing it on a separate test map to see if there is something else involved that's causing a problem for you?
 

Attachments

I think I realize the issue. And no, add unit to selection instead of select unit doesn't do anything.

What I am doing is creating a unit when a unit casts a spell inside of a spellbook, and then instantly selecting that unit for the player. The issue is doing this leaves the player in some sort of weird state where the spellbook doesn't close, so they are left with the blank UI panel.
 
What I am doing is creating a unit when a unit casts a spell inside of a spellbook, and then instantly selecting that unit for the player. The issue is doing this leaves the player in some sort of weird state where the spellbook doesn't close, so they are left with the blank UI panel.
I can confirm that this is what's happening; messed with this a long time ago trying to make spells that could target multiple things at once. You could try using call ForceUICancel() before/after selecting the unit, but no guarantees on that.
 
Status
Not open for further replies.
Back
Top