• 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.

Raw Attack Cooldown Decrease?

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
Well, the idea behind this is to create an Attacks # system like in StarCraft II. That solution would cause A LOT of bloat! Like, a RIDICULOUS amount.

These are the triggers (Using looking_for_help's DDS at the moment):

  • Tank First Attack
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of source) Equal to Arcane Tank
              • (Unit-type of source) Equal to Arcane Tank (Deployed)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (source is in TankUnitGroup) Equal to False
            • Then - Actions
              • Unit Group - Add source to TankUnitGroup
              • Unit - Add Arcane Tank Second Attack to source
              • Set TankMaxIndex = (TankMaxIndex + 1)
              • Set TankUnit[TankMaxIndex] = source
            • Else - Actions
        • Else - Actions
  • Tank Attack Update
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
    • Actions
      • For each (Integer TankUpdateInit) from 1 to TankMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TankAttackCooldown[TankUpdateInit] Less than or equal to 166
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • source Equal to TankUnit[TankUpdateInit]
                  • (source is in TankUnitGroup) Equal to True
                • Then - Actions
                  • Game - Display to (All players) the text: FIRED!
                  • Set TankAttackIndex[TankUpdateInit] = (TankAttackIndex[TankUpdateInit] + 1)
                  • Game - Display to (All players) the text: (ATTACK INDEX SET TO + (String(TankAttackIndex[TankUpdateInit]))) \\Debug text is debug text
                • Else - Actions
            • Else - Actions
  • Tank Attack Calc
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TankInit) from 1 to TankMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TankAttackIndex[TankInit] Greater than or equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TankAttackCooldown[TankInit] Less than 166
                • Then - Actions
                  • Set TankAttackCooldown[TankInit] = (TankAttackCooldown[TankInit] + 1)
                  • Game - Display to (All players) the text: (COOLDOWN AT + (String(TankAttackCooldown[TankInit]))) \\Debug text is debug text
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TankAttackCooldown[TankInit] Equal to 166
              • TankAttackIndex[TankInit] Less than 2
            • Then - Actions
              • Unit Group - Remove TankUnit[TankInit] from TankUnitGroup
              • Unit - Remove Arcane Tank Second Attack from TankUnit[TankInit]
              • Set TankAttackIndex[TankInit] = TankAttackIndex[TankMaxIndex]
              • Set TankAttackIndex[TankMaxIndex] = 0
              • Set TankAttackCooldown[TankInit] = TankAttackCooldown[TankMaxIndex]
              • Set TankAttackCooldown[TankMaxIndex] = 0
              • Set TankUnit[TankInit] = TankUnit[TankMaxIndex]
              • Set TankUnit[TankMaxIndex] = No unit
              • Set TankMaxIndex = (TankMaxIndex - 1)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TankAttackIndex[TankInit] Equal to 2
            • Then - Actions
              • Unit Group - Remove TankUnit[TankInit] from TankUnitGroup
              • Unit - Remove Arcane Tank Second Attack from TankUnit[TankInit]
              • Set TankAttackIndex[TankInit] = TankAttackIndex[TankMaxIndex]
              • Set TankAttackIndex[TankMaxIndex] = 0
              • Set TankAttackCooldown[TankInit] = TankAttackCooldown[TankMaxIndex]
              • Set TankAttackCooldown[TankMaxIndex] = 0
              • Set TankUnit[TankInit] = TankUnit[TankMaxIndex]
              • Set TankUnit[TankMaxIndex] = No unit
              • Set TankMaxIndex = (TankMaxIndex - 1)
            • Else - Actions
Basically, just change "TankAttackIndex[TankInit] Less than 2" and "TankAttackIndex[TankInit] Equal to 2" and it'll do however many attacks you want, at the speed you want in a copied Gloves of Haste, and then stop for it's normal cooldown, then repeat.

I call the number of attacks Attack Indexes and the actual set of attacks before each real cooldown Attack Instances.

But here lies the problem, Gloves of Haste cannot reduce Attack Speed below ~0.22. This is quite a big limit, and in fact will make "Volleys" near-to-impossible unless you use Barrage, but those will all go to separate units and not to the same unit. That's what this is suppose to do. Doing what you suggested, doing this for multiple units, will cause a HORRIBLE amount of bloat, greatly increasing the loading time of maps, the only fix possible would be using a map optimizer.

So there's just gotta be a better way. xD

EDIT: There may be a way to use Barrage to actually do this right, however the damage from Barrage cannot be made into a range (10 - 20 damage) so that'll have to be blank and the damage be scripted for this to work 100% properly.

EDIT2: After messing around with it, it does not seem to be so. =\
 
Last edited:
Level 12
Joined
Feb 22, 2010
Messages
1,115
If you would use a unit indexer in your map your life would be much much easier lol.

Even someone like this helps.
  • Events
    • Unit - a unit enters playable map area
  • Conditions
    • (Level of locust) for (entering unit) equal to 0
  • Actions
    • set UnitID = UnitID + 1
    • Unit - set custom value of entering unit to unitID
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
No it maxes out at exactly 400% and -80%. Basically 5 times the number off attacks per unit time to 1/5 times the number of attacks per unit time.

The only way to bypass this limit is to make a new unit type which has a faster base attack speed and to reduce the faster attack percentage. You can also consider migrating to StarCraft II where there is no limit to faster attack speed next to the 16 attacks per second (once per deterministic frame) that the engine imposes (which is lower than the absolute maximum WC3 imposes but units should never attack that fast anyway).
 
Level 12
Joined
May 20, 2009
Messages
822
Sorry, but kind of the whole point was meant to be proof that for something like this you DON'T need to migrate to SC2. And to be honest, this does still work with pretty much as many attacks as you want it just doesn't have a very modifiable delay between attacks.

I suppose one way this could be done is just have the attack cooldown on the unit be zero and then entirely script their attack. Though that could have small problems with UI. Like the Attack icon won't always be highlighted...There'd probably be a way to get around other problems that it would cause too.

EDIT: Also, I said ~450%. I wasn't completely sure where exactly. xD
 
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
I have a feeling that agility might do exactly what you want. Still maxes out at a factor of 5 though.

Question that isn't entirely on topic:

Does increased attack speed from agility work differently than just giving a unit increased attack speed from an ability?
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
I am not entirely sure. At some point it just seemed to me that every next point of agility increases damage more. However, this might also be because by default agility increases both damage and attack rate, while attack rate itself increases damage exponentially when combined with damage.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
There is no absolute modification for attack cooldown other than the unit type specification. And it probably would not change the cap. The spectrum depends on the base cooldown and the limits were already stated.

min: base / 5
max: base * 5

So you may pick an appropriate base. But more than 2 attacks per second blur the animation anyway. Interpolating it via trigger or count attacks double would not make a big difference.

@Xonok: Agility heroes get damage adds from agility.
 
Level 12
Joined
May 20, 2009
Messages
822
So then the only way to achieve this is scripting the auto attacks and making an artificial attack cooldown, which can actually end up making quite a lot of issues like I said before. But at least, I think anyway, all of those issues CAN be ironed out. Maybe I'll see what I can do about this later. I really feel like this can work.

But then things like Gloves of Haste would end up having to be scripted, too.

Now, I guess this doesn't have to be for every single unit but I want it to have the OPTION of doing that...
 
A method would be to use a stat mod system for attack speed (several exist, it's hard to make one yourself) for all attack speed changes, which are all a percentage. Then, have the base attack speed for all units that you use recorded and a function that turns a change of attack speed (like +0.05 sec between attacks) into a percentage based off of the unit's base attack and use the mod system for it. Still not perfect though.
 
Status
Not open for further replies.
Top