Why is this trigger causing massive damage?

tommerbob

Minecraft. :D
Reaction score
110
I've got spell that stuns a target for 1 second, and then if it moves in the next 5 seconds, it will take additional damage.

The problem is that it causes ALOT more damage than it is supposed to. I'm talking like 500x damage, it instantly kills any unit after it is no longer stunned.

I have no idea why:

Trigger:
  • Ravage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ravage
    • Actions
      • Set RavageCaster = (Triggering unit)
      • Set RavageTarget = (Target unit of ability being cast)
      • Wait 1.00 seconds
      • Set RavagePoint = (Position of RavageTarget)
      • Unit - Create 1 Dummy Caster for (Owner of RavageCaster) at RavagePoint facing Default building facing degrees
      • Unit - Add Ravage (dummy) to (Last created unit)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb RavageTarget
      • Trigger - Turn on Ravage move damage <gen>


Trigger:
  • Ravage move damage
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set RavagePoint = (Position of RavageTarget)
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Region centered at RavagePoint with size (10.00, 10.00)) contains RavageTarget) Equal to True
        • Then - Actions
        • Else - Actions
          • Set RavageAmount = ((0.05 + ((Real((Level of Ravage for RavageCaster))) x 0.15)) x (Distance between (Position of RavageTarget) and RavagePoint))
          • Unit - Cause RavageCaster to damage RavageTarget, dealing RavageAmount damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of MangleTarget using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
          • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (RavageTarget has buff Ravage (dummy)) Equal to True
              • (RavageTarget is dead) Equal to True
        • Then - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
      • Custom script: call RemoveLocation(udg_RavagePoint)
 

Music Man

Cool Member
Reaction score
3
Try displaying floating text for the damage it is actually receiving, and just manipulate the damage by a factor to get what it actually should be. also you should display distance as floating text to make sure it is factoring in the right distance intervals. So if you find its doing 20times damage, add in a /20 to the math before it is applied as damage?

That the best way to figure out exactly what variable is messing up, by just displaying them before they do there operations. It does sound like you might have already done that, if you haven't though, maybe that is worth a shot.

Or perhaps your custom script is not able to reset it fast enough .10 seconds to accurately account for the position of the unit, in which floating text will also tell you if it is.
 

Music Man

Cool Member
Reaction score
3
Are you sure using waits in a periodic is even safe?

By "safe" the trigger does successful retain its same periodic value without bugging out. The only question might be if a certain variable is not being reset or "updated" fast enough to be evaluated with its correction in every subsequent trigger.
 

mapguy

New Member
Reaction score
46
Unit - Add Ravage (dummy) to (Last created unit)
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb
[/WC3]

Trigger:
  • Ravage move damage
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set RavagePoint = (Position of RavageTarget)
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Region centered at RavagePoint with size (10.00, 10.00)) contains RavageTarget) Equal to True
          • Special Effect - Create a special effect attached to the chest of MangleTarget using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
          • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (RavageTarget has buff Ravage (dummy)) Equal to True
              • (RavageTarget is dead) Equal to True
Instead of a wait in the first trigger use a timer.
the mass lag is caused because you are checking for a buff, creating one special effect and checking for units in region every 0.03 seconds. you also should not use waits, NEVER!
waits causes lag, I had a trigger in tha past that caused huge lag, then, I removed the waits, and it works fine.
 

tommerbob

Minecraft. :D
Reaction score
110
@Music Man: I'm already using floating text to detect the exact damage dealt. It is always somewhere around 550-650, which is dealt IMMEDIATELY after the stun duration. The unit hasn't even moved before it is dealt that damage. But the damage SHOULD be only 20% of the distance he moves every 1/10th of a second, which isn't very much--definitely not 600 damage.

@ Mapguy: There is no lag. That is not my problem. The problem is that the target unit is receiving alot mroe damage than it should be.

@Mapguy and Black Rose: How would I structure this spell to remove waits? What do you mean by using a timer instead?



EDIT: Okay, I changed around some stuff, and the target does not receive that massive damage, BUT now he doesn't receive any damage at all if he moves!! :(

Here are the new triggers:

Trigger:
  • Ravage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ravage
    • Actions
      • Set RavageCaster = (Triggering unit)
      • Set RavageTarget = (Target unit of ability being cast)
      • Set RavagePoint = (Position of RavageTarget)
      • Unit - Create 1 Dummy Caster for (Owner of RavageCaster) at RavagePoint facing Default building facing degrees
      • Unit - Add Ravage (dummy) to (Last created unit)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb RavageTarget
      • Custom script: call RemoveLocation(udg_RavagePoint)
      • Set RavagePoint = (Position of RavageTarget)
      • Trigger - Turn on Ravage move damage <gen>


Trigger:
  • Ravage move damage
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set RavageAmount = ((0.05 + ((Real((Level of Ravage for RavageCaster))) x 0.15)) x (Distance between (Position of RavageTarget) and RavagePoint))
      • Unit - Cause RavageCaster to damage RavageTarget, dealing RavageAmount damage of attack type Spells and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (X of RavagePoint) Not equal to (X of (Position of RavageTarget))
              • (Y of RavagePoint) Not equal to (Y of (Position of RavageTarget))
        • Then - Actions
          • Set RavagePoint = (Position of RavageTarget)
          • Special Effect - Create a special effect attached to the chest of MangleTarget using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (RavageTarget has buff Ravage (dummy)) Equal to True
        • Then - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
      • Custom script: call RemoveLocation(udg_RavagePoint)


What on earth is going on!?
 

tommerbob

Minecraft. :D
Reaction score
110
FIXED IT!! Woot!

The problem was here:

Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (RavageTarget has buff Ravage (dummy)) Equal to True
    • Then - Actions
    • Else - Actions
      • Trigger - Turn off (This trigger)


For some odd reason, the trigger is not recognizing that the target has the buff. I double-checked the Object Editor, and he definitely has the right buff, but the game isn't recognizing it... :(

I guess I will have to externally turn off the trigger. Unless someone else has another solution?
 

Music Man

Cool Member
Reaction score
3
Adding a custom value to the unit to signify that he has the buff when the dummy is created? :D.

Just change the value to 1 when he has it, and when the trigger signify that it is no longer there (the buff), change it back to 0.
So when your custom value of unit = 0, turn off the trigger.
 

tommerbob

Minecraft. :D
Reaction score
110
The problem is that the trigger isn't recognizing that the unit even HAS the buff. That's why the trigger was turning off and not dealing the appropiate damage. So its got to be something else besides checking for buff. For now I'll just use a Wait 7 seconds in the first trigger, and then turn off the second one.
 

Music Man

Cool Member
Reaction score
3
The problem is that the trigger isn't recognizing that the unit even HAS the buff. That's why the trigger was turning off and not dealing the appropiate damage. So its got to be something else besides checking for buff. For now I'll just use a Wait 7 seconds in the first trigger, and then turn off the second one.

Adding a custom value to the unit to signify that he has the buff when the dummy is created? :D.

Just change the value to 1 when he has it, and when the trigger signify that it is no longer there (the buff), change it back to 0.
So when your custom value of unit = 0, turn off the trigger.


What you do is instead of running the trigger through buff checks, you run it through with custom value of unit checks. You are essentially doing the buff check with the custom value.

Right when your guy casts the spell, change the "custom value of the unit of the target of the issued order" to 1 signify he has the buff. Then when a time of 5 seconds has elapsed change the custom value to 0 to signify it is off.
 
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