Damage Multiplier Ability Problems.

Aniconic

I am the very model of a modern major general!
Reaction score
3
I'm working on a self target Ability that gives you a buff for 5 seconds.

I want it to work so that, if you deal damage with a melee attack, the game multiplies the damage by a factor of 4 and then removes the buff. I thought I had it figured out.

The ability works, and gives the Casting hero the buff for the right amount of time, but Whenever I deal melee damage with the buff on the unit, the game crashes.

Here is the trigger:

Trigger:
  • GDDEvent
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GDD_DamageSource has buff Vital Stab (Boolean Buff)) Equal to True
        • Then - Actions
          • Set Vital_Stab_Damage = (GDD_Damage - (GDD_Damage x 4.00))
          • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing Vital_Stab_Damage damage of attack type Spells and damage type Normal
        • Else - Actions
      • Game - Display to (All players) the text: ((Name of GDD_DamageSource) + ( has damaged + ((Name of GDD_DamagedUnit) + ( for + (String(GDD_Damage))))))


Any Ideas?

Much appreciated in Advance!
 

Komaqtion

You can change this now in User CP.
Reaction score
469
That is because the action:
Trigger:
  • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing Vital_Stab_Damage damage of attack type Spells and damage type Normal


Will start the trigger all over again (Since the event basically is "Any unit Takes damage"), and thereby causing an infinite loop :p

So prevent this, simply turn off the trigger as the first action, and then turn it on as the last and, problem solved ;)
 

Aniconic

I am the very model of a modern major general!
Reaction score
3
That is because the action:
Trigger:
  • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing Vital_Stab_Damage damage of attack type Spells and damage type Normal


Will start the trigger all over again (Since the event basically is "Any unit Takes damage"), and thereby causing an infinite loop :p

So prevent this, simply turn off the trigger as the first action, and then turn it on as the last and, problem solved ;)

Thank you so much ^^

Instead of closing the trigger, i decided to just have the then actions immediately remove the buff from the GDD_Damage source. That way it will stop the loop. :] Works perfectly now!
 
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