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

[Solved] "wait" not working or bug

Status
Not open for further replies.
Level 12
Joined
Mar 24, 2011
Messages
1,082
A very stupid thing which i cant understand at all...
Thats the problamatic trigger.

  • Kick
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Kick
    • Actions
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing ((Real((Level of Kick for (Triggering unit)))) x (Real((Agility of (Triggering unit) (Include bonuses))))) damage of attack type Normal and damage type Force
      • Wait 2.00 seconds
      • Unit - Remove All buffs from (Target unit of ability being cast)
The evemt and conditions are ok. The damage part too but the problem is the wait part.
At the begining I used this
  • Wait (1.00 + ((Real((Agility of (Casting unit) (Include bonuses)))) / 5.00)) seconds
(The base ability i used is "shadow strike" (elves), 4 lvls with 0 dmg, atack and ms factor 0.80 with 0.05 less/lvl. The duration is 15.10s (I thought i don't need to change that to test it) )
But the buff didnt disappear for all 15 sec so (short version :D ) I started messing with the buff remove part... no change so i thought I messed a lot of other things before finding the problem. Changed back to 1 sec and it worked. The buff disappeared after 1 sec. Tryed again with the previous... not working. So now i tried with 2s,3s,5s and so on and it didn't work again...

So the wait part doesnt work with anything other than 1 sec. WTF??!!

Any ideas how to... fix this... bug maybe or ppl stupidity (mine)?

ps: heroe's agi=20
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Target unit of ability being cast event response won't work after a wait.

->
  • Custom script: local unit u = GetSpellTargetUnit()
  • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing...
  • Wait 2.00 seconds
  • Custom script: set udg_unit = u
  • Unit - Remove All buffs from unit
  • Custom script: set u = null
Create a variable called unit in the variable editor.
 
Level 4
Joined
Feb 22, 2012
Messages
74
the built-in functions that reference units, like "casting unit," "target of ability," and "triggering unit" are not saved for each trigger. so, once another trigger's event happens, you have a new unit that is being referenced by "triggering unit" and the one you were using gets thrown out. wait will really only work properly on empty test maps with no other triggers running.
 
Status
Not open for further replies.
Top