• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Something with the ability causes it to trigger twice?

Status
Not open for further replies.
Level 8
Joined
Apr 8, 2009
Messages
499
Hey there fellow hivers,


I've made a very basic spell based on the mountain king's Stormbolt ability.

The hero throws an object at an enemy, stunning it and dealing damage....
The damage is custom triggered, so that it can be manipulated and is influenced by stats.

To have the damage happen once the missile actually hits the target, I used the following trigger:


  • Kunoichi Hidden Weapon
    • Events
      • Conditions
        • (Unit-type of (Damage source)) Equal to Kunoichi
        • (Damage taken) Less than or equal to 1.00
      • Actions
        • Game - Display to (All players) the text: triggered
        • Game - Display to (All players) the text: (actual damage done + (String((Damage taken))))
        • Set Real_Temp = (150.00 + ((Real((Agility of (Damage source) (Include bonuses)))) x (1.50 + (0.05 x (Real((Level of Hidden Weapon [Kunoichi] for (Damage source))))))))
        • Unit - Cause (Damage source) to damage (Triggering unit), dealing Real_Temp damage of attack type Hero and damage type Normal


In a different trigger I add units to the event list - "add to trigger x, event '(picked unit) takes damage)".
The ability being used is set to do 1 damage in the ability editor.

The problem is however, that the trigger runs twice (sometimes even thrice!)
And I haven't the foggiest as to why it would do that.

I have checked all these triggers and i'm 99.99% sure it's not my triggers doing anything wrong.

At this point I'm wondering if the 'stun' buff itself counts as damage being dealt (albeit 0 damage).

Any people who know what's going on?
 
Level 8
Joined
Apr 8, 2009
Messages
499
Is ensured that the unit is not registered multiple times at the damage event trigger? Would you mind to post the demo?

I checked the 2 damage event adding triggers specificly and they don't misbehave for any of my other damage event triggers.

Also tried out varying tests, it'll trigger 2-3 times, each doing different amounts of damage.
-1st time = 0 damage
-2st time = 1 damage
-3st time = 0 damage (if there is a 3rd time)

This potentially solves the problem since I can add a condition that the damage has to be above 0, but I'm still confused why it would do this.

---EDIT----:

Also, the amount of times it gets triggered is based on the damage the ability is set to deal in the ability editor.

set to 1 damage = 3 times, set to 1.5 damage = 2 times, set to 2 damage = 0 times.

What the hell right?

---EDIT----:

In hindsight, I can be 100% sure it's not the damage taken events, since if that where the case the damage taken should be the same all the time right?
 
Last edited:
Level 11
Joined
Dec 19, 2012
Messages
411
It is because your damage in the action re-trigger the action (event - unit A take damage, in action deal damage to A, and in cycle), but due to unit would have some resistance to damage, so damage dealt will be lesser and lesser until the damage no longer causes trigger to re-fire again (over low damage will round to 0, which doesn't trigger event)

Just turn off the trigger and re-enable it could solve the problem.


EDIT :

Ok I see your trigger wrongly, perhaps a test map with the problem could let the other people have a deeper look into it.
 
Last edited:
Level 8
Joined
Apr 8, 2009
Messages
499
It is because your damage in the action re-trigger the action (event - unit A take damage, in action deal damage to A, and in cycle), but due to unit would have some resistance to damage, so damage dealt will be lesser and lesser until the damage no longer causes trigger to re-fire again (over low damage will round to 0, which doesn't trigger event)

Just turn off the trigger and re-enable it could solve the problem.


EDIT :

Ok I see your trigger wrongly, perhaps a test map with the problem could let the other people have a deeper look into it.

Once again, 100% sure it's NOT the trigger.
Hence why I posted it in the world editor section, it's due to the ability's nature, which I don't know too much about :)


Will put up a demo map soon.
 
Level 12
Joined
Jun 15, 2016
Messages
472
I have no idea why would it do that, but you could try turning off the trigger and then turning it back on (not sure if you need a "wait" action between off and on). It might be the "dumb" way but it usually works.

EDIT: So just to be sure, the trigger runs more then once even if you turn it off at the end of the effect? (that is without turning it on again)
 
Last edited:
Level 8
Joined
Apr 8, 2009
Messages
499
I have no idea why would it do that, but you could try turning off the trigger and then turning it back on (not sure if you need a "wait" action between off and on). It might be the "dumb" way but it usually works.

Tried that, turn off at start, turn on at end, no change, hence my believe that it's inherent to the stormbolt ability
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
4,992
Try this: disable whatever lines add new damage events to your trigger (so even when you cast the dummy storm bolt nothing should happen but its tiny damage) and see if you still get multiple damage instances-- if so maybe you have another trigger somewhere messing with yours.

Next I'd try keeping that disabled but placing a couple target units down with the Unit Palette and manually adding the events to the damage detection trigger to see how many times it will fire.
  • Kunoichi Hidden Weapon
    • Events
      • Unit - TestUnit 001 <gen> takes damage
      • Unit - TestUnit 002 <gen> takes damage
 
Level 8
Joined
Apr 8, 2009
Messages
499
Try this: disable whatever lines add new damage events to your trigger (so even when you cast the dummy storm bolt nothing should happen but its tiny damage) and see if you still get multiple damage instances-- if so maybe you have another trigger somewhere messing with yours.

Next I'd try keeping that disabled but placing a couple target units down with the Unit Palette and manually adding the events to the damage detection trigger to see how many times it will fire.
  • Kunoichi Hidden Weapon
    • Events
      • Unit - TestUnit 001 <gen> takes damage
      • Unit - TestUnit 002 <gen> takes damage

Result stays the same. if I disable all triggers that add events-- -nothing happens. If I manually add a unit takes damage event, it still runs twice.
Now I'm even more sure it's not a trigger issue :)
Very sure stormbolt FOR SOME REASON "deals" 0 damage, maybe stun buff related.
 
Level 8
Joined
Apr 8, 2009
Messages
499
More confirmation that stormbolt is weird as hell---

When the ability's damage is set to 0 in the editor, IT STILL TRIGGERS THE EVENT.

Halp, I'm both 100% confused and annoyed by this :(
 
Level 4
Joined
Jul 26, 2016
Messages
88
More confirmation that stormbolt is weird as hell---

When the ability's damage is set to 0 in the editor, IT STILL TRIGGERS THE EVENT.

Halp, I'm both 100% confused and annoyed by this :(
Pretty sure dealing 0 damage always triggers damage events, not just stormbolt.
 
Level 20
Joined
Aug 29, 2012
Messages
825
I suggest that you use some kind of workaround for this.

For instance, you could use a Wait (Distance between Unit A and Unit B / speed of the missile), so that the actions will trigger at the correct time.

It's easily doable with just a couple variables, and bypasses the damage detection nonsense.
 
Level 12
Joined
Jun 15, 2016
Messages
472
If turning off the trigger at the end causes it to fire only once ( and if your ability isn't MUI, hopefully) then you could try turning off the trigger at the end without turning it on again, instead creating another trigger which turns it on when the unit starts casting the ability. Hopefully with that "down time" between each cast the trigger will only fire once.
 
Level 8
Joined
Apr 8, 2009
Messages
499
I suggest that you use some kind of workaround for this.

For instance, you could use a Wait (Distance between Unit A and Unit B / speed of the missile), so that the actions will trigger at the correct time.

It's easily doable with just a couple variables, and bypasses the damage detection nonsense.

Sounds like the best idea so far, will have to try it out :)!


Just wish I knew why stormbolt inherently does damage twice/thrice :(
 
Level 20
Joined
Aug 29, 2012
Messages
825
Yeah I know, it sure is better to know how to pinpoint exactly where the problem is.

Truth is, I had soooo many problems with my triggers that I got used to tinker around and find some temporary (or not) ways to make it work x) hope this one will fix it for ya.
 
Status
Not open for further replies.
Top