In my map you can fly around in a ship. While doing this, you have a spellbook ability that contains all your flight commands. So while you're flying, the spellbook is always open and you're just casting abilities inside it as you go. If your ship is blown up, I have a trigger to detect this, and move your pilot (Hero) to the point of death. I then select your hero for you.
PROBLEM: if your hero is selected by the trigger, he has no abilities. Not even move/patrol, etc. He will move if you right-click. It's as if the interface is showing a blank open spellbook or something.
IN GAME SOLUTION: Oddly, if I leave out the "select pilot" action of the trigger and manually select the hero in game by pressing F1, I get all my abilities as normal.
Here is the relevant trigger parts:
- I added a forced "Press ESC" command to try to get out of the spellbook when the unit dies. It doesn't work (that is still in the trigger, but removing it doesn't fix anything)
- I've tried removing the spellbook ability from the unit when it dies
- I've tried removing the unit from the game when it dies
- I've tried selecting and de-selecting the unit with triggers, but the abilities stay gone until I do it manually in game.
- I've tried putting in a wait command before reselecting the pilot. That does not work, though if I wait in game and select the hero manually he does have all his abilities.
- I've tried making the player select their pilot manually by forcing them to press "F1" but that didn't seem to work.. I'm not sure "F" followed by "1" translates to the F1 function key
PROBLEM: if your hero is selected by the trigger, he has no abilities. Not even move/patrol, etc. He will move if you right-click. It's as if the interface is showing a blank open spellbook or something.
IN GAME SOLUTION: Oddly, if I leave out the "select pilot" action of the trigger and manually select the hero in game by pressing F1, I get all my abilities as normal.
Here is the relevant trigger parts:
-
Ship dies
-
Events
- Unit - A unit Dies
-
Conditions
- ((Triggering unit) is A Hero) Not equal to True
-
Actions
- Set DeadUnit = (Triggering unit)
- -------- --------- --------
- -------- UNHIDE HERO if there is one --------
- -------- --------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- deathInteger Less than or equal to 10
-
Then - Actions
- Game - Force (Owner of (Triggering unit)) to press Escape/Cancel
- Selection - Remove (Triggering unit) from selection for (Owner of (Triggering unit))
- -------- ************* Dying Unit is one of the Hero's Ships ******************* --------
- -------- move hero --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Hero[deathInteger] is hidden) Equal to True
- HeroInSomething[deathInteger] Equal to False
-
Then - Actions
- -------- hero in ship --------
- Set tempDeathPoint = (Position of (Dying unit))
- Unit - Move Hero[deathInteger] instantly to tempDeathPoint
- Unit - Unhide Hero[deathInteger]
- Set defaultSelection[deathInteger] = Hero[deathInteger]
- Camera - Reset camera for (Owner of DeadUnit) to standard game-view over 0.00 seconds
- Custom script: call RemoveLocation (udg_tempDeathPoint)
- Selection - Select Hero[(Custom value of (Triggering unit))] for (Owner of (Triggering unit))
- Else - Actions
-
If - Conditions
-
Else - Actions
- -------- ----- --------
- -------- lower FlierCounter --------
- -------- ----- --------
- Set FliersNumber = (FliersNumber - 1)
-
If - Conditions
- -------- --------- --------
-
Events
- I added a forced "Press ESC" command to try to get out of the spellbook when the unit dies. It doesn't work (that is still in the trigger, but removing it doesn't fix anything)
- I've tried removing the spellbook ability from the unit when it dies
- I've tried removing the unit from the game when it dies
- I've tried selecting and de-selecting the unit with triggers, but the abilities stay gone until I do it manually in game.
- I've tried putting in a wait command before reselecting the pilot. That does not work, though if I wait in game and select the hero manually he does have all his abilities.
- I've tried making the player select their pilot manually by forcing them to press "F1" but that didn't seem to work.. I'm not sure "F" followed by "1" translates to the F1 function key