• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Set Unit Weapon Integer Field issue

Status
Not open for further replies.
Level 5
Joined
Jun 12, 2018
Messages
148
Hi hivers,

I've been trying to use the new native functions to dynamically change unit field values.

I've noticed that the code below would not increase base damage of my tower but worse it would make it stop from attacking ever again... (I know this kind of loop function always leak)
  • Unit Group - Pick every unit in (Units in MapVision <gen> matching (((Unit-type of (Matching unit)) Equal to |cff80ff80Ancient Defender|r) and (((Matching unit) is alive) Equal to Vrai))) and do (Unit - Set Unit: (Picked unit)'s Weapon Integer Field: Attack Damage Base ('ua1b')at Index:0 to Value: ((Base Damage of (Picked unit) for weapon index 0) + 1))
However another native has been added and works as intended :
  • Unit - Set Base Damage of (Triggering unit) to ((Base Damage of (Triggering unit) for weapon index 0) + 1) for weapon index: 0
Is there any difference between these two function calls ? Does anyone have experienced same types of issues ?
 
Level 1
Joined
Jul 31, 2014
Messages
5
So it appears that you can set damage, just the indexes are all messed up... See attached map - I made a trigger for when you chat "-asdf", it SETS the unit's attack at index 1 (+1), but then displays the attack at indexes 0,1, & 2, and you see that 0 is going up. If you change it to SET the index at 0, it wont work....
 

Attachments

  • weapon index test.w3m
    16.6 KB · Views: 28
Level 5
Joined
Jun 12, 2018
Messages
148
So it appears that you can set damage, just the indexes are all messed up... See attached map - I made a trigger for when you chat "-asdf", it SETS the unit's attack at index 1 (+1), but then displays the attack at indexes 0,1, & 2, and you see that 0 is going up. If you change it to SET the index at 0, it wont work....
Good investigating, this is messed up.
 
Status
Not open for further replies.
Top