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

Chance to get buff when attacked

Status
Not open for further replies.
Level 4
Joined
Jul 20, 2012
Messages
83
Hello there, I've been creating my new Hero and everything went fine until something happened, then simple triggers such as these aren't working properly or at all... I don't know why...

  • Killing Machine Time to kill
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Level of Killing Machine for (Attacked unit)) Greater than 0
          • (Random integer number between 0 and 100) Less than or equal to (2 x (Level of Killing Machine for (Attacked unit)))
    • Actions
      • Unit - Create 1 Meat Wagon (Dummy) for (Owner of (Attacked unit)) at (Position of (Attacked unit)) facing (Position of (Attacked unit))
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • Unit - Add Killing Machine (Dummy) to (Last created unit)
      • Unit - Set level of Killing Machine (Dummy) for (Last created unit) to (Level of Killing Machine for (Attacked unit))
      • Unit - Pause (Last created unit)
      • Unit - Unpause (Last created unit)
      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Attacked unit)
Before you ask, "Killing Machine" is a passive skill that Hero has, "Meat Wagon (Dummy)" is a dummy unit with everything prepared to cast spells instantly on any target, "Killing Machine (Dummy)" is a unit spell for the dummy unit based on Bloodlust spell which increases MS and AS etc.
This spell should work like there's a certain chance that the attacked Hero has a 2-20% based on skill level to become enraged... very simple and still not working :(

I'd really like to get this working, and I think it's a random integer number condition issue, because other familiar simple trigger with 50% chance to proc doesn't work neither...
 
Level 4
Joined
Jul 20, 2012
Messages
83
The thing is I've never had an issue with Pause/Unpause function, in fact, it helped me sometimes to avoid some bugs long ago... I was trying it on full skill level of 10 with 20% chance all the time and it never occured...
I'll try it with reals and without pause/unpause next time I get to it...
Thanks for reply...
 

sentrywiz

S

sentrywiz

Thing is, the unit getting attacked doesn't equal the unit taking damage. This is a known issue and is solved by implementing a gui damage system. You can browse the forum for that. But the pause/unpause make both the dummy unit not doing what its told because the trigger fires when a unit is being attacked. When two or more units strike the same target, each dummy pause unpause overlaps the first, the second, the third... the n-th. You get no active procs on the spell and dummies also overlap, some die some don't. This lags and creates leaks, which show in game stutter and lag after some time.

Visit the link rulerofiron99 gave you so you can learn to remove leaks and learn to create variables so you can remove all the things that currently are leaking in your trigger, like the position you give dummies on each creation. That leaks, big time. Also your conditions -> you don't need the all conditions are true. Just add the two conditions in the conditions part and it will work, because that is the default state of conditions.

Remove the pause/unpause, add a casting time to the bloodlust spell if you want a small delay effect and possibly make the dummy last a full second.
 
Level 4
Joined
Jul 20, 2012
Messages
83
I want them to make the Hero enraged on attack, not when damage is dealt... And the MUI thing doesn't bother me here neither, I only wanted to know why it doesn't work at all, I was asking because it wasn't working at all even on single player...
There's no way 2 or more units strike at the very same time, and adding expiration timer is for last created unit and the only one, then it adds exp.timer for another unit created...
I also didn't mention anything about fixing leaks, but thanks guys for advices, I'll check it out ;)
 
Status
Not open for further replies.
Top