Builder Bob
Live free or don't
- Reaction score
- 249
Here's an action that is made for testing purposes. It can be called with a unit as parameter. It will then go through the unit's abilities and list the id of the ability, the id of the button, and lastly the hotkey.
The problem is, I'm unable to grab the hotkey correctly. Instead of getting the key I get (for psionic storm) Button/Hotkey/PsiStorm.
Does anyone have any tips on how to get the hotkey itself?
(Tested for many abilities. Psionic storm is here used as example)
Btw, this behavior is repeated in a number of fields for different objects, so I really hope there's a way around it.
The problem is, I'm unable to grab the hotkey correctly. Instead of getting the key I get (for psionic storm) Button/Hotkey/PsiStorm.
Does anyone have any tips on how to get the hotkey itself?
(Tested for many abilities. Psionic storm is here used as example)
Trigger:
- RegisterUnitAbilities 2
- Options: Action
- Return Type: (None)
- Parameters
- Unit = No Unit <Unit>
- Grammar Text: RegisterUnitAbilities 2(Unit)
- Hint Text: (None)
- Custom Script Code
- Local Variables
- abilityEntry = "" <String>
- Index = 0 <Integer>
- hotkey = "" <String>
- buttonEntry = "" <String>
- Actions
- General - For each integer Index from 0 to 11 with increment 1, do (Actions)
- Actions
- Variable - Set abilityEntry = (String((Unit ability Index)))
- Debug - Display (Text(abilityEntry)) as debug output using Type 1, and Do display it in the game window
- ------- abilityEntry will display PsiStorm as is the id of the ability for psionic storm
- Variable - Set buttonEntry = (Value of Abilities abilityEntry "CmdButtonArray[0].DefaultButtonFace" for player Any Player)
- Debug - Display (Text(buttonEntry)) as debug output using Type 1, and Do display it in the game window
- ------- buttonEntry will display PsiStorm as is the id of the button for psionic storm
- Variable - Set hotkey = (Value of Buttons buttonEntry "Hotkey" for player Any Player)
- Debug - Display (Text(hotkey)) as debug output using Type 1, and Do display it in the game window
- ------- hotkey will display Button/Hotkey/PsiStorm as is shown is the text key of the hotkey if you check it in the data editor
- Actions
- General - For each integer Index from 0 to 11 with increment 1, do (Actions)
Btw, this behavior is repeated in a number of fields for different objects, so I really hope there's a way around it.