[Solved] Stackable attack speed by %!

Level 11
Joined
Jun 20, 2017
Messages
380
I want 3 different abilities that can increase your attack speed by a percentage!
Ability: Each consecutive attack against the same target increases attack speed by 6%, up to a maximum of 200%. Effect is lost after not attacking for 10 seconds.
Ability: Each consecutive attack against the same target increases attack speed by 8%, up to a maximum of 200%. Effect is lost after not attacking for 10 seconds.
Ability: Each consecutive attack against the same target increases attack speed by 10%, up to a maximum of 200%. Effect is lost after not attacking for 10 seconds.
Reset if the target/source is dead or a new target.
How can I detect if it is the same target or not? Should I use dds?
What if for some reason I attack the target in 1 second and the second attack was delayed like 3 seconds later?
 
Level 10
Joined
Jan 26, 2019
Messages
90
You asked a question about an ability that is quite complex for most users.
This requires a damage engine (or reforged functions) and a stat system that will add green attack speed (Custom stats system)

I created this skill in attached example map, this map require YDWE PK editor.

In any case, you can check this map to understand the logic of this ability.
However, I will not waste time looking for crutches in order to make a map on other editors that have too few gui functions.
 

Attachments

  • Fervor Skill.w3x
    33.9 KB · Views: 2
Level 45
Joined
Feb 27, 2007
Messages
5,578
Enemy1PK probably has given a good solution but I didn't look at the map. In general detecting the attacks is not really difficult; the flow of the ability can be simplified to something like this:
  1. Use a DDS to detect when a unit with this ability hits a target with an attack and save this target by attaching it to the attacker in an array, struct, or hashtable.
  2. Before saving check if the about-to-be-saved unit is the same as the last saved target. If the same, increase the level of the attack speed ability by 1 (level 0 should give no bonus AS); if different, set the level of the AS ability to 1.
  3. Start a 10s timer and attach it to this attacking unit; if a timer already exists, pause and restart it again instead of making a new timer.
  4. If the timer started in step 3 ever manages to expire, it should set the level of the AS ability back to 0, then pause itself.

  5. In a separate trigger using the "A unit is attacked" event, detect when a unit with this ability begins an attack on another unit. If it isn't the saved target, set the AS ability back to 0.
Step 5 is optional and its only purpose is to prevent the first attack against a new target from benefiting from stacked AS (since it would affect the windup animation for the attack there IS a way to abuse it). It has another issue of clearing stacks if you begin an attack on a different target but cancel your swing before connecting. Pick your poison.
 
Level 10
Joined
Jan 26, 2019
Messages
90
Pyrogasm, if you're interested, this is my solution, literally one pure gui trigger without custom code.
Which is not surprising, because i put a lot of effort into making this possible for gui users.
Unfortunately, translation is still not perfect, so not everything may be clear to the uninitiated user.
Native speakers could help with this, but they are more interested in making crutches in reforged editor.
1.png
This skill is so hard and I can’t imagine how anyone will do it on the default gui.
It is not at all surprising that there are no messages with solutions here, unlike in many other topics.
Most people don’t even realize how powerful the built-in Damage Engine and Custom Stats System, as well as convenient hash tables, local variables and timers, provide.
I did it in a few minutes, I just had to think through the logic of the ability, all the necessary tools were available.
I wish good luck to those who will do this on the default gui.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Native speakers could help with this, but they are more interested in making crutches in reforged editor.
That tool of yours looks quite impressive ;)

But you're assuming that people know that it even exists or that they'd understand how to use it. I'm going to continue to suggest standard solutions to what I see as standard problems. A lot of people are at the stage where they're still learning what an Array is and suggesting to use an alternate editor is quite a leap. In a perfect world, we could push these (again, impressive) tools for mass adoption but that's a tall order. (Everyone switch to Lua!!!)

Also, I'd argue that it's not so hard to create this effect in GUI once you know the quirks.

Here's my take. Of course, this is made much easier with the reliance of systems, but the one's I'm using here are sort of GUI standards at this point. Bribe's Damage Engine and Unit Indexer are being used here plus a little system I made for handling Timers:
  • SAS On Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageAttack Equal to True
    • Actions
      • Set VariableSet SAS_CV = (Custom value of DamageEventSource)
      • -------- --------
      • -------- Add the attack speed bonus ability if it doesn't exist: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Attack Speed (SAS) for DamageEventSource) Equal to 0
        • Then - Actions
          • Unit - Add Attack Speed (SAS) to DamageEventSource
        • Else - Actions
      • -------- --------
      • -------- Reset if it's a new target: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SAS_Attack_Target[SAS_CV] Not equal to DamageEventTarget
        • Then - Actions
          • Set VariableSet SAS_Attack_Speed[SAS_CV] = 0.00
        • Else - Actions
      • -------- --------
      • -------- Store the target: --------
      • Set VariableSet SAS_Attack_Target[SAS_CV] = DamageEventTarget
      • -------- --------
      • -------- Increase the bonus attack speed variable: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SAS_Attack_Speed[SAS_CV] Less than 200.00
        • Then - Actions
          • Set VariableSet SAS_Attack_Speed[SAS_CV] = (Min((SAS_Attack_Speed[SAS_CV] + 6.00), 200.00))
          • -------- --------
          • -------- Apply attack speed to the ability: --------
          • Ability - Set Ability: (Unit: DamageEventSource's Ability with Ability Code: Attack Speed (SAS))'s Real Level Field: Attack Speed Increase ('Isx1') of Level: 0 to (SAS_Attack_Speed[SAS_CV] x 0.01)
          • Unit - Increase level of Attack Speed (SAS) for DamageEventSource
          • Unit - Decrease level of Attack Speed (SAS) for DamageEventSource
        • Else - Actions
          • Set VariableSet SAS_Attack_Speed[SAS_CV] = 200.00
      • -------- --------
      • Game - Display to (All players) for 3.00 seconds the text: ((Name of DamageEventSource) + ( attack speed: + ((String(SAS_Attack_Speed[SAS_CV])) + %)))
      • -------- --------
      • -------- Use the GST system to start a 10.00 second timer (or restart the existing one): --------
      • Set VariableSet GST_Trigger = SAS Reset Attack Speed <gen>
      • Set VariableSet GST_RestartKey = SAS_CV
      • Custom script: call GST_Unit( udg_DamageEventSource, false, 10.00 )
  • SAS Reset Attack Speed
    • Events
    • Conditions
    • Actions
      • -------- This trigger is using the GST system. It's hooked up to a timer that will expire after 10.00 seconds. --------
      • -------- GST_Unit1 = The DamageEventSource from SAS On Damage. --------
      • -------- --------
      • -------- Reset the bonus attack speed variable: --------
      • Set VariableSet SAS_CV = (Custom value of GST_Unit1)
      • Set VariableSet SAS_Attack_Speed[SAS_CV] = 0.00
      • Set VariableSet SAS_Attack_Target[SAS_CV] = No unit
      • -------- --------
      • -------- Apply attack speed to the ability: --------
      • Ability - Set Ability: (Unit: GST_Unit1's Ability with Ability Code: Attack Speed (SAS))'s Real Level Field: Attack Speed Increase ('Isx1') of Level: 0 to 0.00
      • Unit - Increase level of Attack Speed (SAS) for GST_Unit1
      • Unit - Decrease level of Attack Speed (SAS) for GST_Unit1
It's definitely not as clean as one trigger and is a bit more convoluted, but someone can open my map and copy and paste everything into their Editor and be mostly done with it. Also, the Damage Engine is not necessary here (can be done using 1.31+ natives).
 

Attachments

  • Stacking Attack Speed 1.w3m
    73.2 KB · Views: 5
Last edited:
Level 10
Joined
Jan 26, 2019
Messages
90
But you're assuming that people know that it even exists or that they'd understand how to use it. I'm going to continue to suggest standard solutions to what I see as standard problems. A lot of people are at the stage where they're still learning what an Array is and suggesting to use an alternate editor is quite a leap. In a perfect world, we could push these (again, impressive) tools for mass adoption but that's a tall order.
Of course not, I think that the "Demo maps" folder exists solely for beauty.
Of course, just because all the Chinese were able to use it does not mean that you can too.
And the fact that i was able to learn this when the translation was much worse and there was no one to ask (unlike the current time when people can ask me) is also an accident, it’s not that I made an effort, it’s just luck because that I'm the chosen one, like neo from "Matrix"
No one succeeds without trying.
(Everyone switch to Lua!!!)
I used to also say some things for which I am now ashamed, the problem was that I said what I heard from others, although I myself did not understand it, sweet old times..
Lua is only useful to those who are programmers or understand lua well, there is a big gap between professional jass user and lua, not to mention the fact that there are too few tools for lua, you can’t even convert a trigger into code, and don’t forget that almost all systems are made on jass.
Therefore, lua will forever remain the most niche programming language within wc3, which is used by literally only a few.
but someone can open my map and copy and paste everything into their Editor and be mostly done with it.
In ydwe pk everything is just as easy, the only difference is that your solution is only work for reforged, and mine is for any wc3 version.

Well, one more thing, all your systems force you to store global variables in the gui global variables section, creating a garbage dump there, while you yourself suggest using arrays, it turns out that you are creating inconvenience for yourself.
Btw, you use arrays not because it is the best option, but simply because you cannot conveniently use hashtable, and the difference between those who know how to use hashtable and those who do not is quite large.

In any case, I gave what the author asked for - I showed how to build logic in this ability, and it doesn’t matter how exactly he is going to implement it.
You successfully coped with finding a crutch in the default gui, which means i did everything correctly, or will you claim that you didn’t look at my example and did everything yourself?
 
Level 11
Joined
Jun 20, 2017
Messages
380
Thank you guys for your efforts.

Enemy1PK, I opened your map and editor and it was different from the standard version and unfortunately it required WC3 1.26-1.27.
We hope our editor will have more GUI functions in the future like yours.

There is a weird problem, I built a tower and wanted to upgrade it to a new tower, the previous attack counted for the upgraded tower!
Perhaps as Pyrogasm pointed out!
Step 5 is optional and its only purpose is to prevent the first attack against a new target from benefiting from stacked AS (since it would affect the windup animation for the attack there IS a way to abuse it). It has another issue of clearing stacks if you begin an attack on a different target but cancel your swing before connecting. Pick your poison.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
There is a weird problem, I built a tower and wanted to upgrade it to a new tower, the previous attack counted for the upgraded tower!
Perhaps as Pyrogasm pointed out!
Those triggers still need to be modified to work with your map. Look at the Conditions for the Damage Event trigger:
  • Conditions
    • IsDamageAttack Equal to True
It literally runs for anything that can "attack", regardless of the situation.

So if you want attack speed to get reset when a unit upgrades then you will need to create a trigger to reset things on upgrade:
  • SAS Reset On Upgrade
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Level of Attack Speed (SAS) for (Triggering unit)) Equal to 1
    • Actions
      • -------- Reset the bonus attack speed variable: --------
      • Set VariableSet SAS_CV = (Custom value of (Triggering unit))
      • Set VariableSet SAS_Attack_Speed[SAS_CV] = 0.00
      • Set VariableSet SAS_Attack_Target[SAS_CV] = No unit
      • -------- --------
      • -------- Apply attack speed to the ability: --------
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Attack Speed (SAS))'s Real Level Field: Attack Speed Increase ('Isx1') of Level: 0 to 0.00
      • Unit - Increase level of Attack Speed (SAS) for (Triggering unit)
      • Unit - Decrease level of Attack Speed (SAS) for (Triggering unit)
I took the SAS Reset Attack Speed trigger and changed the Event + Event Responses. The comments explain what's going on and should help you do this yourself.


Of course not, I think that the "Demo maps" folder exists solely for beauty.
Of course, just because all the Chinese were able to use it does not mean that you can too.
And the fact that i was able to learn this when the translation was much worse and there was no one to ask (unlike the current time when people can ask me) is also an accident, it’s not that I made an effort, it’s just luck because that I'm the chosen one, like neo from "Matrix"
No one succeeds without trying.
That's just idealistic. I help others make 20+ triggers a month, I'm not going to suggest that every single person downloads and installs version 1.26/1.27 of Warcraft 3, downloads that tool, and then proceeds to learn some entirely new method of working in the Trigger Editor, so that the trigger I suggest to them can be faster to create, MAYBE.

Also, the Chinese are one homogenous group of people while this site deals with people from around the world. I imagine they have a much easier time with things like this since it's completely tailored to them.

Lua is only useful to those who are programmers or understand lua well, there is a big gap between professional jass user and lua
Coding in general is always going to be superior to any GUI solution. You should see WCSharp which can be used with "Lua mode" enabled, you can program your map in C# which is a much easier to learn and use programming language than both Jass/Lua. That library also provides all of the tools you'd need (it makes 95% of Jass/Lua tools obsolete). Anything it's missing can just be ported over. But again, I'm not going to suggest it to people unless they're trying to learn Jass/Lua and are working on a brand new map, which is almost never the case. In a perfect world, we'd all use it.
 
Last edited:
Level 11
Joined
Jun 20, 2017
Messages
380
I meant when you have a tower that can be upgraded to other towers, the first tower does nothing but attack (doesn't have the attack speed ability).
So when the first tower attacks, its projectiles are in the air towards the enemy and you decide to upgrade that tower during this time, so when those projectiles hit the enemy (your tower is still upgrading, the upgrade did not complete yet!) it counts the projectiles!
How can I prevent those projectiles from being counted?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I meant when you have a tower that can be upgraded to other towers, the first tower does nothing but attack (doesn't have the attack speed ability).
So when the first tower attacks, its projectiles are in the air towards the enemy and you decide to upgrade that tower during this time, so when those projectiles hit the enemy (your tower is still upgrading, the upgrade did not complete yet!) it counts the projectiles!
How can I prevent those projectiles from being counted?
Like I said:

Those triggers still need to be modified to work with your map. Look at the Conditions for the Damage Event trigger:
  • Conditions
    • IsDamageAttack Equal to True
It literally runs for anything that can "attack", regardless of the situation.

So add a Condition that prevents this from running when you don't want it to. You can check for an Ability, you can check for a Unit-Type, you can check for any kind of Variable that you've Set beforehand, etc. Here's an example of tracking the upgrading state of your units:
  • Events
    • Unit - A unit Begins an upgrade
  • Conditions
  • Actions
    • Set Variable Is_Upgrading[(Custom value of (Triggering unit))] = True
  • Events
    • Unit - A unit Cancels an upgrade
    • Unit - A unit Finishes an upgrade
  • Conditions
  • Actions
    • Set Variable Is_Upgrading[(Custom value of (Triggering unit))] = False
 
Level 11
Joined
Jun 20, 2017
Messages
380
Thanks, I think I solved it but can it be simplified more?
  • SAS On Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource) Greater than 0
      • IsDamageAttack Equal to True
      • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource).) Equal to True
    • Actions
      • Set VariableSet SAS_CV = (Custom value of DamageEventSource)
      • -------- --------
      • -------- Reset if it's a new target --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SAS_AttackTarget[SAS_CV] Not equal to DamageEventTarget
        • Then - Actions
          • Set VariableSet SAS_AttackSpeed[SAS_CV] = 0.00
        • Else - Actions
      • -------- --------
      • -------- Store the target --------
      • Set VariableSet SAS_AttackTarget[SAS_CV] = DamageEventTarget
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of DamageEventSource) Equal to Cannon Tower
        • Then - Actions
          • -------- Add the attack speed bonus ability if it doesn't exist --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource) Equal to 0
            • Then - Actions
              • Unit - Add Item Attack Speed Bonus (Greater) [Custom] SAS to DamageEventSource
            • Else - Actions
          • -------- --------
          • -------- Increase the bonus attack speed variable --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SAS_AttackSpeed[SAS_CV] Less than 200.00
            • Then - Actions
              • Set VariableSet SAS_AttackSpeed[SAS_CV] = (Min((SAS_AttackSpeed[SAS_CV] + 6.00), 200.00))
              • -------- --------
              • -------- Apply attack speed to the ability --------
              • Ability - Set Ability: (Unit: DamageEventSource's Ability with Ability Code: Item Attack Speed Bonus (Greater) [Custom] SAS)'s Real Level Field: Attack Speed Increase ('Isx1') of Level: 0 to (SAS_AttackSpeed[SAS_CV] x 0.01)
              • Unit - Increase level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource
              • Unit - Decrease level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource
            • Else - Actions
              • Set VariableSet SAS_AttackSpeed[SAS_CV] = 200.00
          • -------- --------
          • Game - Display to (All players) for 3.00 seconds the text: ((Name of DamageEventSource) + ( attack speed: + ((String(SAS_AttackSpeed[SAS_CV])) + %)))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of DamageEventSource) Equal to Cannon Tower (Super)
            • Then - Actions
              • -------- Add the attack speed bonus ability if it doesn't exist --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource) Equal to 0
                • Then - Actions
                  • Unit - Add Item Attack Speed Bonus (Greater) [Custom] SAS to DamageEventSource
                • Else - Actions
              • -------- --------
              • -------- Increase the bonus attack speed variable --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SAS_AttackSpeed[SAS_CV] Less than 200.00
                • Then - Actions
                  • Set VariableSet SAS_AttackSpeed[SAS_CV] = (Min((SAS_AttackSpeed[SAS_CV] + 8.00), 200.00))
                  • -------- --------
                  • -------- Apply attack speed to the ability --------
                  • Ability - Set Ability: (Unit: DamageEventSource's Ability with Ability Code: Item Attack Speed Bonus (Greater) [Custom] SAS)'s Real Level Field: Attack Speed Increase ('Isx1') of Level: 0 to (SAS_AttackSpeed[SAS_CV] x 0.01)
                  • Unit - Increase level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource
                  • Unit - Decrease level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource
                • Else - Actions
                  • Set VariableSet SAS_AttackSpeed[SAS_CV] = 200.00
              • -------- --------
              • Game - Display to (All players) for 3.00 seconds the text: ((Name of DamageEventSource) + ( attack speed: + ((String(SAS_AttackSpeed[SAS_CV])) + %)))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of DamageEventSource) Equal to Cannon Tower (Ultra)
                • Then - Actions
                  • -------- Add the attack speed bonus ability if it doesn't exist --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource) Equal to 0
                    • Then - Actions
                      • Unit - Add Item Attack Speed Bonus (Greater) [Custom] SAS to DamageEventSource
                    • Else - Actions
                  • -------- --------
                  • -------- Increase the bonus attack speed variable --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SAS_AttackSpeed[SAS_CV] Less than 200.00
                    • Then - Actions
                      • Set VariableSet SAS_AttackSpeed[SAS_CV] = (Min((SAS_AttackSpeed[SAS_CV] + 10.00), 200.00))
                      • -------- --------
                      • -------- Apply attack speed to the ability --------
                      • Ability - Set Ability: (Unit: DamageEventSource's Ability with Ability Code: Item Attack Speed Bonus (Greater) [Custom] SAS)'s Real Level Field: Attack Speed Increase ('Isx1') of Level: 0 to (SAS_AttackSpeed[SAS_CV] x 0.01)
                      • Unit - Increase level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource
                      • Unit - Decrease level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource
                    • Else - Actions
                      • Set VariableSet SAS_AttackSpeed[SAS_CV] = 200.00
                  • -------- --------
                  • Game - Display to (All players) for 3.00 seconds the text: ((Name of DamageEventSource) + ( attack speed: + ((String(SAS_AttackSpeed[SAS_CV])) + %)))
                • Else - Actions
      • -------- --------
      • -------- Use the "GST system" to start a 10.00 second timer (or restart the existing one) --------
      • Set VariableSet GST_Trigger = SAS Reset Attack Speed <gen>
      • Set VariableSet GST_RestartKey = SAS_CV
      • Custom script: call GST_Unit( udg_DamageEventSource, false, 10.00 )
  • SAS Reset Attack Speed
    • Events
    • Conditions
    • Actions
      • -------- This trigger is using the "GST system". It's hooked up to a timer that will expire after 10.00 seconds --------
      • -------- "GST_Unit1" = The DamageEventSource from "SAS On Damage" --------
      • -------- --------
      • -------- Reset the bonus attack speed variable --------
      • Set VariableSet SAS_CV = (Custom value of GST_Unit1)
      • Set VariableSet SAS_AttackSpeed[SAS_CV] = 0.00
      • Set VariableSet SAS_AttackTarget[SAS_CV] = No unit
      • -------- --------
      • -------- Apply attack speed to the ability --------
      • Ability - Set Ability: (Unit: GST_Unit1's Ability with Ability Code: Item Attack Speed Bonus (Greater) [Custom] SAS)'s Real Level Field: Attack Speed Increase ('Isx1') of Level: 0 to 0.00
      • Unit - Increase level of Item Attack Speed Bonus (Greater) [Custom] SAS for GST_Unit1
      • Unit - Decrease level of Item Attack Speed Bonus (Greater) [Custom] SAS for GST_Unit1
  • SAS Reset On Upgrade
    • Events
      • Unit - A unit Begins an upgrade
      • Unit - A unit Finishes an upgrade
      • Unit - A unit Cancels an upgrade
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Cannon Tower
          • (Unit-type of (Triggering unit)) Equal to Cannon Tower (Super)
          • (Unit-type of (Triggering unit)) Equal to Cannon Tower (Ultra)
    • Actions
      • -------- Reset the bonus attack speed variable --------
      • Set VariableSet SAS_CV = (Custom value of (Triggering unit))
      • Set VariableSet SAS_AttackSpeed[SAS_CV] = 0.00
      • Set VariableSet SAS_AttackTarget[SAS_CV] = No unit
      • -------- --------
      • -------- Apply attack speed to the ability --------
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Item Attack Speed Bonus (Greater) [Custom] SAS)'s Real Level Field: Attack Speed Increase ('Isx1') of Level: 0 to 0.00
      • Unit - Increase level of Item Attack Speed Bonus (Greater) [Custom] SAS for (Triggering unit)
      • Unit - Decrease level of Item Attack Speed Bonus (Greater) [Custom] SAS for (Triggering unit)
  • SAS 1
    • Events
      • Unit - A unit Begins an upgrade
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Cannon Tower
          • (Unit-type of (Triggering unit)) Equal to Cannon Tower (Super)
          • (Unit-type of (Triggering unit)) Equal to Cannon Tower (Ultra)
    • Actions
      • Set VariableSet SAS_IsUpgrading[(Custom value of (Triggering unit))] = True
      • -------- --------
      • Unit - Remove Item Attack Speed Bonus (Greater) [Custom] SAS from (Triggering unit)
  • SAS 2
    • Events
      • Unit - A unit Finishes an upgrade
      • Unit - A unit Cancels an upgrade
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Cannon Tower
          • (Unit-type of (Triggering unit)) Equal to Cannon Tower (Super)
          • (Unit-type of (Triggering unit)) Equal to Cannon Tower (Ultra)
    • Actions
      • Set VariableSet SAS_IsUpgrading[(Custom value of (Triggering unit))] = False
      • -------- --------
      • Unit - Add Item Attack Speed Bonus (Greater) [Custom] SAS to (Triggering unit)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
What you have seems fine but you're aren't using SAS_IsUpgrading at all.

This variable is meant to track the state of all Towers so you can use it any of your triggers:
  • Towers Begins An Upgrade
    • Events
      • Unit - A unit Begins an upgrade
    • Conditions
      • ((Triggering unit) is a building) Equal to True
    • Actions
      • Set VariableSet SAS_IsUpgrading[(Custom value of (Triggering unit))] = True
  • Towers Finishes OR Cancels An Upgrade
    • Events
      • Unit - A unit Finishes an upgrade
      • Unit - A unit Cancels an upgrade
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is a building) Equal to True
    • Actions
      • Set VariableSet Tower_IsUpgrading[(Custom value of (Triggering unit))] = False
Now we always know whether our towers are in the process of upgrading or not.

Then you can reference this variable in the SAS On Damage trigger to reset the attack speed if it's upgrading. Also, you don't need to repeat yourself so much in your Actions, see how I'm handling the different types of towers now:
  • SAS On Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource) Greater than 0
      • IsDamageAttack Equal to True
      • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource).) Equal to True
    • Actions
      • Set VariableSet SAS_CV = (Custom value of DamageEventSource)
      • -------- --------
      • -------- Reset if it's a new target OR if the tower is upgrading --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • SAS_AttackTarget[SAS_CV] Not equal to DamageEventTarget
            • Tower_IsUpgrading[SAS_CV] Equal to True
        • Then - Actions
          • Set VariableSet SAS_AttackSpeed[SAS_CV] = 0.00
        • Else - Actions
      • -------- --------
      • -------- Store the target --------
      • Set VariableSet SAS_AttackTarget[SAS_CV] = DamageEventTarget
      • -------- --------
      • -------- Add the attack speed bonus ability if it doesn't exist --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource) Equal to 0
        • Then - Actions
          • Unit - Add Item Attack Speed Bonus (Greater) [Custom] SAS to DamageEventSource
        • Else - Actions
      • -------- --------
      • -------- Get how much attack speed we're going to add --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of DamageEventSource) Equal to Cannon Tower
        • Then - Actions
          • Set VariableSet SAS_Amount = 6.00
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of DamageEventSource) Equal to Cannon Tower (Super)
            • Then - Actions
              • Set VariableSet SAS_Amount = 8.00
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of DamageEventSource) Equal to Cannon Tower (Ultra)
                • Then - Actions
                  • Set VariableSet SAS_Amount = 10.00
                • Else - Actions
      • -------- --------
      • -------- Increase the bonus attack speed variable by this amount --------
      • Set VariableSet SAS_AttackSpeed[SAS_CV] = (Min((SAS_AttackSpeed[SAS_CV] + SAS_Amount), 200.00))
      • -------- --------
      • -------- Apply attack speed to the ability --------
      • Ability - Set Ability: (Unit: DamageEventSource's Ability with Ability Code: Item Attack Speed Bonus (Greater) [Custom] SAS)'s Real Level Field: Attack Speed Increase ('Isx1') of Level: 0 to (SAS_AttackSpeed[SAS_CV] x 0.01)
      • Unit - Increase level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource
      • Unit - Decrease level of Item Attack Speed Bonus (Greater) [Custom] SAS for DamageEventSource
      • -------- --------
      • Game - Display to (All players) for 3.00 seconds the text: ((Name of DamageEventSource) + ( attack speed: + ((String(SAS_AttackSpeed[SAS_CV])) + %)))
      • -------- --------
      • -------- Use the "GST system" to start a 10.00 second timer (or restart the existing one) --------
      • Set VariableSet GST_Trigger = SAS Reset Attack Speed <gen>
      • Set VariableSet GST_RestartKey = SAS_CV
      • Custom script: call GST_Unit( udg_DamageEventSource, false, 10.00 )
 
Last edited:
Level 10
Joined
Jan 26, 2019
Messages
90
Coding in general is always going to be superior to any GUI solution. You should see WCSharp which can be used with "Lua mode" enabled, you can program your map in C# which is a much easier to learn and use programming language than both Jass/Lua. That library also provides all of the tools you'd need (it makes 95% of Jass/Lua tools obsolete). Anything it's missing can just be ported over. But again, I'm not going to suggest it to people unless they're trying to learn Jass/Lua and are working on a brand new map, which is almost never the case. In a perfect world, we'd all use it.
What is this all for? if you raise the stakes like that, then why not immediately teach AI to make maps or hire 1000 people to develop maps like Amazon did in their stores.
Gui and Jass have always been and will be the most popular methods for creating triggers, and this is really enough for most maps, it matters much more about the number of good functions rather than the programming language you use.
What you mentioned will have about the same success as wc3 community edition and uJapi (~zero), that's my opinion.
That's just idealistic. I help others make 20+ triggers a month, I'm not going to suggest that every single person downloads and installs version 1.26/1.27 of Warcraft 3, downloads that tool, and then proceeds to learn some entirely new method of working in the Trigger Editor, so that the trigger I suggest to them can be faster to create, MAYBE.
I know that those who are already making a map using reforged cannot roll back to older versions, and also know that the majority of the English-speaking community will always choose reforged despite all its shortcomings, simply because these people prefer solutions from blizzard "out of the box" what could be simpler than opening the game launcher and seeing the “Launch Map Editor” button there?

It’s a fact that the gui methods in the reforged editor are much worse, but i’m not going to argue or talk about it, i just provided a method that i would use myself.
Yes, you do not and will never have such functionality, but you can still open a map with just one simple trigger and understand how to make this ability.
I don’t need to give someone a ready-made solution when there are people who help other people do 20 triggers a month, i’m just explaining and showing how to do it yourself because knowledge is more useful than the systems that you use but don’t understand how it works.
We hope our editor will have more GUI functions in the future like yours.
Unfortunately, this will not happen, blizzard still hasn’t even added all the new reforged functions to the gui, and much larger things are already presented here.
It is much more likely that a reforged gui will appear in ydwe pk.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
What is this all for? if you raise the stakes like that, then why not immediately teach AI to make maps or hire 1000 people to develop maps like Amazon did in their stores.
Gui and Jass have always been and will be the most popular methods for creating triggers, and this is really enough for most maps, it matters much more about the number of good functions rather than the programming language you use.
What you mentioned will have about the same success as wc3 community edition and uJapi (~zero), that's my opinion.
My point was that there are objectively better solutions in terms of features and flexibility, however, they aren't good suggestions to people looking for help on here. It's not realistic to expect people to adopt your solution when it requires so much change from the norm.

but they are more interested in making crutches in reforged editor.
This rubbed me the wrong way. It's fine to suggest alternative solutions but to imply that otherwise you're enabling some kind of bad behavior isn't true. We're suggesting the most realistic solutions to the average user, that's all there is to it.
 
Top