• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to change the value of "UNIT_WEAPON_IF_ATTACK_TARGETS_ALLOWED" ?

Status
Not open for further replies.
Level 2
Joined
Aug 27, 2019
Messages
7
Code:
local u = CreateUnit(Player(0), FourCC("hpea"), 0, 0, 0)   
     local isChanged = BlzSetUnitWeaponIntegerField(u, UNIT_WEAPON_IF_ATTACK_TARGETS_ALLOWED, 0,2)
     print(isChanged)
     print(BlzGetUnitWeaponIntegerField(u, UNIT_WEAPON_IF_ATTACK_TARGETS_ALLOWED,0))

BlzGetUnitWeaponIntegerField(u, UNIT_WEAPON_IF_ATTACK_TARGETS_ALLOWED,0) always return 0.
some target no return 0 .like "ground". So I'm not sure which string represents which int. it's bug? I wan't change "attack targets allowed" in code.What should i do?
 
Status
Not open for further replies.
Top