Has anyone successfully used the native function UnitWeaponGet (aka Unit Weapon)? I believe it's broken.
Event: Player Any Player types a chat message containing "Weapon", matching Exactly
Variables:
gl_weapon = No Game Link <Game Link - Weapon>
str_Weapon = "" <String>
Actions:
Variable - Set gl_weapon = ((Random Living unit from (Selected units for player 1)) weapon 1)
General - Switch (Actions) depending on gl_weapon
Cases
General - If (Marine - C-14 Gauss Rifle)
Actions
Variable - Set str_Weapon = "Gauss!"
General - If (SCV - Fusion Cutter)
Actions
Variable - Set str_Weapon = "SCV!"
General - If (Reaper - P-45 Gauss Pistol)
Actions
Variable - Set str_Weapon = "Reaper!"
General - If (Marauder - Punisher Grenades)
Actions
Variable - Set str_Weapon = "Punisher!"
Default
Variable - Set str_Weapon = "Nothing!"
UI - Display (Text(str_Weapon)) for (All players) to Subtitle area
The above trigger returns Nothing! even if I've got a marauder or reaper or scv or marine selected. I've tried indices -100 to 100 (including 0). I've also added like ninety weapons. All Nothing! Can anyone confirm this? Or tell me what I'm doing wrong?
Has anyone successfully used the native function UnitWeaponGet (aka Unit Weapon)? I believe it's broken.
Event: Player Any Player types a chat message containing "Weapon", matching Exactly
Variables:
gl_weapon = No Game Link <Game Link - Weapon>
str_Weapon = "" <String>
Actions:
Variable - Set gl_weapon = ((Random Living unit from (Selected units for player 1)) weapon 1)
General - Switch (Actions) depending on gl_weapon
Cases
General - If (Marine - C-14 Gauss Rifle)
Actions
Variable - Set str_Weapon = "Gauss!"
General - If (SCV - Fusion Cutter)
Actions
Variable - Set str_Weapon = "SCV!"
General - If (Reaper - P-45 Gauss Pistol)
Actions
Variable - Set str_Weapon = "Reaper!"
General - If (Marauder - Punisher Grenades)
Actions
Variable - Set str_Weapon = "Punisher!"
Default
Variable - Set str_Weapon = "Nothing!"
UI - Display (Text(str_Weapon)) for (All players) to Subtitle area
The above trigger returns Nothing! even if I've got a marauder or reaper or scv or marine selected. I've tried indices -100 to 100 (including 0). I've also added like ninety weapons. All Nothing! Can anyone confirm this? Or tell me what I'm doing wrong?
@xenrathe: Go
Bump - need confirmation before I report to Blizzard
@xenrathe: Go
Resolved. I'm not sure whether this counts as a bug or not, but perhaps it will help someone later on down the line.
If a unit doesn't have the standard 'Attack' ability, then GetWeapon returns nothing.