• 🏆 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!

Get Unit Weapon Integer Field

Status
Not open for further replies.
Level 1
Joined
Jun 10, 2019
Messages
4
Hello,

the new functions that come with patch 1.31 like 'get Unit weapon Integer field' for example are ment for getting or setting the values during the game, aren't they?
Now my question is: the function from above has a value called 'at index: 0'. What does it mean?
for example: This function allways returns 0...i tried it with Intex -10 to 10...same result. My unit has base damage set to 100 in objekt editor.

Event
-Player 1 types a chat message containing 'test' as...

Action
-Display to all players the text (String((Unit: 'my Unit' Weapon Integer Field: Attack Damage Base at Intex: 0
 

Attachments

  • index.JPG
    index.JPG
    18.2 KB · Views: 319

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,892
For every unit and building, there two attack forms (weapons, same thing) so 0 refers to the first and 1 to the second. Obviously not all units have both attacks enabled, flying machine does, footman doesn't.
 
Level 1
Joined
Jun 10, 2019
Messages
4
Thanks Wrda,
the triggering Unit has only attack 1 enabled. Base damage is set to 100. The result is still 0. The old function 'unit - base damage' works fine..
 

Attachments

  • index2.JPG
    index2.JPG
    52.8 KB · Views: 175
Thanks Wrda,
the triggering Unit has only attack 1 enabled. Base damage is set to 100. The result is still 0. The old function 'unit - base damage' works fine..

I use the JASS function BlzSetUnitBaseDamage (result of converting "unit - base damage" into text) and I have the following behavior :
- Works fine if I play with Warcraft 1.30.4, the damage amount is set
- Doesn't work if I play with Wacraft 1.31.XXX, the damage amount is unchanged.

When you say it works fine for you, are you playing with 1.30.4 or 1.31 ?

Edit: it seems the reason is because in 1.30.4 weapons are 1-indexed (weapon 1, weapon 2) and in 1.31.XX weapons are 0 indexed (weapon 0, weapon 1). And those Blizzard crappy developers don't convert the value...
 
Last edited:
Status
Not open for further replies.
Top