• 🏆 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!

[Solved] damage sharing - damage engine troubleshooting

Status
Not open for further replies.
Level 21
Joined
Mar 29, 2020
Messages
1,237
TLDR: this thread kind of changed topic mid flight, the main topic - I am trying to get damage engine to help me transfer the damage one unit gets to a different one, and for some reason having trouble doing this. I'm using damage engine V5.6.0 bc I'm using patch 1.31.1.


hey all,

I'm trying to create an ability that makes a few allied units take damage instead of the caster, sort of a 1 way spirit link.
the way I came up with to do this was to have the caster cast spirit link with 100% damage sharing (distributed damage factor set to 0.01), and make the targeted unit take a percentage of his damage, thus distributing it among the spirit link.

it's not working....the caster is taking full damage, and only the targeted unit is taking damage from him. it's not being distributed further. what did I do wrong? (I am using bribe's unit indexer and damage engine)

  • Carried setup
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Carried
    • Actions
      • Set CV = (Custom value of (Triggering unit))
      • Set CarriedTarget[CV] = (Target unit of ability being cast)
      • Unit Group - Add (Triggering unit) to CarriedGroup
      • Trigger - Turn on Carried loop <gen>
  • carried damage
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is in CarriedGroup) Equal to True
    • Actions
      • Set CV = (Custom value of DamageEventTarget)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Carried for DamageEventTarget) Equal to 1
        • Then - Actions
          • Unit - Cause DamageEventSource to damage CarriedTarget[CV], dealing (DamageEventAmount x 0.30) damage of attack type Normal and damage type Normal
          • Set DamageEventAmount = (DamageEventAmount x 0.70)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Carried for DamageEventTarget) Equal to 2
            • Then - Actions
              • Unit - Cause DamageEventSource to damage CarriedTarget[CV], dealing (DamageEventAmount x 0.50) damage of attack type Normal and damage type Normal
              • Set DamageEventAmount = (DamageEventAmount x 0.50)
            • Else - Actions
              • Unit - Cause DamageEventSource to damage CarriedTarget[CV], dealing (DamageEventAmount x 0.70) damage of attack type Normal and damage type Normal
              • Set DamageEventAmount = (DamageEventAmount x 0.30)
  • Carried loop
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CarriedGroup and do (Actions)
        • Loop - Actions
          • Set CV = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (CarriedTarget[CV] has buff Carried ) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from CarriedGroup
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CarriedGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
(this one is initially off...)

thanks!
 
Last edited:
Level 24
Joined
Feb 9, 2009
Messages
1,787
First and foremost, do a simple equation that causes & reduces the damage:
DEAL DAMAGE = (DamageEventAmount x (0.10 + (0.20 x (Real((Level of SPELL for DamageEventTarget))))))
REDUCE DAMAGE = (DamageEventAmount x (1.00 - (0.10 + (0.20 x (Real((Level of SPELL for DamageEventTarget)))))))


Edit
(Working from 1.31)
My version seems to work fine so it might be some variable error.
Carried (Spirit Link Type Spell) | HIVE
 
Last edited:
Level 21
Joined
Mar 29, 2020
Messages
1,237
First and foremost, do a simple equation that causes & reduces the damage:
DEAL DAMAGE = (DamageEventAmount x (0.10 + (0.20 x (Real((Level of SPELL for DamageEventTarget))))))
REDUCE DAMAGE = (DamageEventAmount x (1.00 - (0.10 + (0.20 x (Real((Level of SPELL for DamageEventTarget)))))))


Edit
(Working from 1.31)
My version seems to work fine so it might be some variable error.
Carried (Spirit Link Type Spell) | HIVE

thanks! btw cool map. no idea whats going on there, but very intriguing. In your map the ability does indeed transfer the damage from the caster to the target, but it's not a spirit link. it's only to one target. maybe I wasn't clear - what I wanted was for it to cast spirit link and link through X (lets say 4) targets, and have them all split the damage coming from the caster. I think should be easy enough to deal with anyways. I don't really understand all parts of your trigger though - does everything that has CaRi on it have to do with my spell? whats all the stuff about missiles? there are no missiles in this spell... will this work by just copying the four relevant triggers to my map, or do I need to alter anything in the damage engine config?


That looks like it should work fine. Try using DamageEvent becomes equal to 1.00 as the Event, and also maybe update the Damage Engine (Bribe has released a lot of patches recently).

nope, that didn't do it. as for updating damage engine - I'm also with 1.31.1 and I think the newer versions are mostly for reforged...

also - it seems like originally my setup was transfering damage to the whole spirit link, just that spirit link doesn't share friendly damage and thats how I was testing it...
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
>I don't really understand all parts of your trigger though
Your triggers man, only difference should be variables, a config, and some math, just delete the "CaRi_Config_Damage_Dis[1-3]" as I realized much later it wasn't needed.

>will this work by just copying the four relevant triggers to my map, or do I need to alter anything in the damage engine config?
Ensure your preferences in your editor are variable friendly, the buff & ability variable is set in the config, and the required systems are included.

>I don't really understand all parts of your trigger though - does everything that has CaRi on it have to do with my spell? whats all the stuff about missiles? there are no missiles in this spell...
That's trigger comments, they do not effect the trigger in any way shape or form, if they cause headaches then you must preform a very advanced method which is to select it all and press delete, warning, overexposure from preforming this technique is highly dangerous, consult your doctor before exposing yourself to loose text.
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
lol

just delete the "CaRi_Config_Damage_Dis[1-3]" as I realized much later it wasn't needed.

that is pretty much what caused all of my confusion. that first trigger of which I had a hard time understanding the relation to my spell...
the buff & ability variable is set in the config
do you mean in the configuration of the damage engine?(hope not, bc I have not been touching that for anything...) or just to insert the correct ability and buff as the variable?
>I don't really understand all parts of your trigger though - does everything that has CaRi on it have to do with my spell? whats all the stuff about missiles? there are no missiles in this spell...
That's trigger comments, they do not effect the trigger in any way shape or form, if they cause headaches then you must preform a very advanced method which is to select it all and press delete, warning, overexposure from preforming this technique is highly dangerous, consult your doctor before exposing yourself to loose text.
again, I was thrown off by the first trigger, which by it's label seemed to be connected, but by it's content did not. although I am but a novice GUIer, I am versed in the art of the trigger comment... but maybe I should consult my doctor just to be sure.


Back to the spell - the reason i assumed you did something different, was bc even when I just changed what you wrote in your first post, or even copied that from your map - it still wont work in mine. that's why I assumed the devil was in the details. so for some reason i still can't get my spell to make the caster transfer the damage to the target of the ability. ... ?

EDIT: don't bother answering this. I'm going to try and build it bottom up properly and not hitch a ride on spirit link... thanks for the help, I'm sure I'll be back with more questions soon... :ogre_hurrhurr:
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
Forgot you're on 1.31 (i'll remember eventually).

I'm still confused as to what your goal is with this spell. Does the base spell have to even be Spirit Link? I'd try it out using just normal abilities, having Dummy's apply the buffs if needed or maybe use Auras for the buffs (Self-targeting auras to mimic the behavior of a buff, although un-dispellable).

From what I can gather by your triggers, this is what you're going for:
The caster targets a unit and links itself to it. Whenever the caster takes damage, a portion of that damage is instead dealt to the linked target.

The caster may only be linked to one target at a time.

When the target loses the buff, the caster is unlinked from it (but still potentially retains it's own buff, which could happen if the target is dispelled, serving no purpose besides a status icon).
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
hey,

I really appreciate all the help. as of now I am kind of completely reconstructing this whole spell, and on the way slightly changing the concept. for now I have it under control.
EDIT: don't bother answering this. I'm going to try and build it bottom up properly and not hitch a ride on spirit link... thanks for the help, I'm sure I'll be back with more questions soon... :ogre_hurrhurr:

my original intention was to have the caster make a bunch of units take damage for it and split that damage between them. originally I tried taking a shortcut and just giving the caster's damage to one of them with triggers, and having the rest of the units share the damage via spirit link. Now I am working on triggering the whole thing to make it smoother, look better, and not give a free random spirit link to all the affected units (I only wanted them splitting the damage from the caster between them, not sharing each other's damage)
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
hi again,

I recreated the spell and am bumping into the same problem with the damage engine. I pinpointed it now - this works, and nullifies the damage done to the unit:
  • damage test
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • DamageEventTarget Equal to Team Killer 0017 <gen>
    • Actions
      • Set DamageEventAmount = 0.00
but once I add a line (see following trigger) that uses info from damageEventAmount before it - the original damage is no longer nullified.
  • damage test
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • DamageEventTarget Equal to Team Killer 0017 <gen>
    • Actions
      • Unit - Cause DamageEventSource to damage Spirit Walker 0023 <gen>, dealing DamageEventAmount damage of attack type Spells and damage type Normal
      • Set DamageEventAmount = 0.00
any Idea why this is happening?
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
I found the following workaround to get it to work but now I'm suspicious that I somehow have damage engine configured incorrectly... it also gave my map some lag spikes, which is really strange bc it's a tiny trigger.

In addition I seem to not have the components of damage engine that dictate damage type and attack type. shouldn't 5.6. have that stuff?

  • damage test
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • DamageEventTarget Equal to Team Killer 0017 <gen>
    • Actions
      • Set real = DamageEventAmount
      • Set DamageEventAmount = 0.00
      • Unit - Cause DamageEventSource to damage Spirit Walker 0023 <gen>, dealing real damage of attack type Spells and damage type Normal
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
The lag is likely from recursion with a damage being caused within a damage trigger, but I recall that Bribe fixed that in later versions....

Try enclosing the cause damage line in turn off & on (this trigger) and see if it alleviates the lag.

you said your'e also not reforged - what version of damage engine are you using? I couldn't find anything more advanced than 5.6.0 that was compatible with patch 1.31.1....

"Try enclosing the cause damage line in turn off & on (this trigger) and see if it alleviates the lag." - no discernible difference.
 
Last edited:
Level 21
Joined
Mar 29, 2020
Messages
1,237
I think I located the problem - I'm a moron. It seems this whole time I had a really early version of damage engine (maybe I took the one from the demo map... ). So I tried a quick fix for the problem by just ripping the damage engine from the map @Devalut attached to this thread. and got a whole bunch of errors bc apparently it's not that simple.

what do I have to do to make the damage engine from your map (or any recent one for 1.31.1) work for me?
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
in general my spell is working well now, just I'm not sure I applied damage type correctly. is this right?:
thanks.
  • Carried damage Copy
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is in CarriedCasterGroup) Equal to True
    • Actions
      • Set TempUnit = DamageEventSource
      • Set TempReal = DamageEventAmount
      • Set ID = (Custom value of DamageEventTarget)
      • Set real = (CarriedFraction[ID] x TempReal)
      • Set TempInteger = (Number of units in CarriedDummyGroup[ID])
      • Set DamageEventAmount = (DamageEventAmount - (real x (Real(TempInteger))))
      • Unit Group - Pick every unit in CarriedDummyGroup[ID] and do (Actions)
        • Loop - Actions
          • Set CV = (Custom value of (Picked unit))
          • Set NextDamageType = DamageEventDamageT
          • Unit - Cause TempUnit to damage CarriedTarget[CV], dealing real damage of attack type Spells and damage type Universal
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
Spells are only reduced by heroes armor type, so Spelll + Universal will do that exact amount of damage, using SPELL + Normal will have the unit's armor reduce it.
Source

On another note, I'm sure with bribe's system you could get the damage type and apply it.
Lastly, why add a second variable for DamageEventAmount?
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
that was me trying to apply the damage type with bribe's engine. :hohum: I thought the way to do that was to put this line before the damage : Set NextDamageType = DamageEventDamageT

the only variable of type "damage type" the damage engine supplies is "Converted_damage_type" and I was not sure how to activate that.

if you know the right way to do that please enlighten me...

as for adding the TempReal variable - that was bc I ran into trouble when I used "cause unit to damage" before altering DamageEventAmount. so by saving it I was able to alter it, and then still access the original value. It's possible that now that I updated the damage engine it's not necessary, but it doesn't hurt anyways...
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
upload_2020-7-10_3-20-4.png

This will take the damage event's attack type & damage type, you can also find reference to this in the test map in the demo triggers in either the summoned unit bonus damage or the damage reporting.
 
Status
Not open for further replies.
Top