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

Question about Triggering

Status
Not open for further replies.
Level 8
Joined
Jun 2, 2015
Messages
85
I'm curious to know how I can make a single unit's attack speed increase instead of it being all the units of that type.
 

Attachments

  • OwO.JPG
    OwO.JPG
    98.7 KB · Views: 42
Level 25
Joined
Sep 26, 2009
Messages
2,378
You can use the "Unit - Set Unit Weapon Real Field" action. I also noticed in the screenshot that you are increasing damage. That can be done the similar way, but the action is "Unit - Set Unit Weapon Integer Field"
  • Actions
    • Set VariableSet att = (Attack Interval of Footman 0000 <gen> for weapon index 0.)
    • Game - Display to (All players) the text: (String(att))
    • Unit - Set Unit: Footman 0000 <gen>'s Weapon Real Field: Attack Base Cooldown ('ua1c')at Index:0 to Value: 1.00
    • Unit - Set Unit: Footman 0000 <gen>'s Weapon Integer Field: Attack Damage Base ('ua1b')at Index:1 to Value: 200
Do notice one thing:
For some reason the "Set Unit Weapon Real Field" uses zero-based indexing, while "Set Unit Weapon integer Field" uses non-zero-based indexing, so in case of a Footman, to increase his attack speed the weapon index is 0 but to increase his attack damage the weapon index must be 1.

I don't know if Blizz is planning to fix this discrepancy or not, but if they do then your triggers may start behaving incorrectly.
 
Level 8
Joined
Jun 2, 2015
Messages
85
You can use the "Unit - Set Unit Weapon Real Field" action. I also noticed in the screenshot that you are increasing damage. That can be done the similar way, but the action is "Unit - Set Unit Weapon Integer Field"
  • Actions
    • Set VariableSet att = (Attack Interval of Footman 0000 <gen> for weapon index 0.)
    • Game - Display to (All players) the text: (String(att))
    • Unit - Set Unit: Footman 0000 <gen>'s Weapon Real Field: Attack Base Cooldown ('ua1c')at Index:0 to Value: 1.00
    • Unit - Set Unit: Footman 0000 <gen>'s Weapon Integer Field: Attack Damage Base ('ua1b')at Index:1 to Value: 200
Do notice one thing:
For some reason the "Set Unit Weapon Real Field" uses zero-based indexing, while "Set Unit Weapon integer Field" uses non-zero-based indexing, so in case of a Footman, to increase his attack speed the weapon index is 0 but to increase his attack damage the weapon index must be 1.

I don't know if Blizz is planning to fix this discrepancy or not, but if they do then your triggers may start behaving incorrectly.
Thanks for the help. Yeah I noticed that which is why I have my Weapon Interval set to "WeaponInterval" which is set to 0 at the beginning. Blizzard needs to fix their broken programs. just like the ability boreal stuff where you need to have a number subtracted.
 
Status
Not open for further replies.
Top