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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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