Buff Trigger not working all the time

excis

Member
Reaction score
1
Hi, in my trigger i've encountered a problem
Trigger:
  • Windfury Haste
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Enhancement Shaman
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) has buff Stormstrike [Shaman]) Equal to True
          • (Random integer number between 80 and 100) Equal to 80
        • Then - Actions
          • Unit - Create 1 Windfury Haste Dummy for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Orc Shaman - Lightning Shield (Attacking unit)
          • Unit - Add Windfury Haste [Proc] to (Attacking unit)
          • Wait 8.00 seconds
          • Unit - Remove Windfury Haste [Proc] from (Attacking unit)
        • Else - Actions
It is supposed to give a buff which increases the attack speed of the attacking unit, it works in the start but then after like 3 times it has procced it stops working.. Anyone got any idea why it wont work all the time?
 

Moridin

Snow Leopard
Reaction score
144
Unit - Remove Windfury Haste [Proc] from (Attacking unit)

I'm not sure if attacking unit isn't cleared after a wait.... can anyone else confirm?
 

Necrach

You can change this now in User CP.
Reaction score
62
To start with, the trigger gor leaks. but I think your main problem is the "Wait" action. Should this ability be MUI? Because you really need a system with Countdown timers or something

EDIT:
Unit - Remove Windfury Haste [Proc] from (Attacking unit)

I'm not sure if attacking unit isn't cleared after a wait.... can anyone else confirm?

The "Attacking unit" retains only if NO other unit attacks during the wait duration :p


I think the best way of doing this is either
1. Replace that haste ability with a buff ability that another dummy unit casts on the shaman.
2. (If you want it MPI but not necesserily MUI) Add a costum value equal to player number of owning player, both to the dummy unit and to the shaman. Set the expiration timer to 8 seconds. When the dummy expires, (Unit Dies event) remove the haste ability from unit with the same costum value (resetting costum value to 0)
 

excis

Member
Reaction score
1
To start with, the trigger gor leaks. but I think your main problem is the "Wait" action. Should this ability be MUI? Because you really need a system with Countdown timers or something

EDIT:


The "Attacking unit" retains only if NO other unit attacks during the wait duration :p

Should i use timers instead of the wait action? And if the trigger only applies to one unit is it still MUI then?
 

Necrach

You can change this now in User CP.
Reaction score
62
Should i use timers instead of the wait action? And if the trigger only applies to one unit is it still MUI then?

If it should only apply to a single unit in your map it is quite easy. Just start an expiration timer, put the unit in a unit variable and remove the ability from the unit!

If it should apply to a unit that each player only can have one of, make the same thing but have arrays in both the unit variable and the timer variable (starting the array of the player number of owner of unit) and making one trigger each player, removing the ability from unit[x] when timer[x] expires.

If this ability is usable for an unlimited amount of units, its a bit more complicated. I recommend just making a haste ability that lasts 8 seconds and is cast on the shaman, instead of fooling around with GUI static timers or other counting systems!
 

excis

Member
Reaction score
1
I think I fixed it, Used bloodlust for the attack speed increase thus nothing complicated involved :) thx anyway +rep
 

Bogrim

y hello thar
Reaction score
154
Just to clarify, there are two types of variables when dealing with handles (e.g. "triggering unit", "attacking unit", "target unit of ability being cast", etc.).

The first type is the most known type in the GUI, the global variable. A global variable is a variable any trigger can alter (hence "global", as in universal and shared). Examples of global variables include "(Integer A)", "(Target unit of ability being cast)", "(Attacking unit)" and pretty much every pre-set handle such as event responses.

The second type is barely included in the GUI, the local variable. A local variable can only be altered by the trigger the variable was created in (hence "local", as in private and not shared). The only example of a local variable in GUI is "Triggering unit".

The key to understanding why your wait action causes (Attacking unit) to stop working lies in the engine. Warcraft 3 is a linear engine, meaning that everything happens in the order the code is read in. Nothing ever happens at the same time, ever.

That said, the reason for (Attacking unit) stops working after your wait action is because you put in a space into your code with the wait action, allowing your global variables to be altered by other events during the wait, and losing your event responses.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top