A good and efficient way to deal damage with triggers?

X-maul

AKA: Demtrod
Reaction score
201
I was considering picking up a map I once worked on, which included hero units with upgradeable abilities, which also dealt damage acording to the items the unit had.

The way it worked was that the ability deals 100 damage + 0.1*Strength. I made an attribute behavior (not sure it's the right name) for the Strength stat, and set a variable to the amout of behaviors (which worked).

I then made the ability deal 100 damage (with effects), and a trigger that launched every time the effect fired, and dealt the damage acording the variable.

My question now is, is this the most efficient way? I could imagine that doing this with an ability that deals area of effect damage multiple times a second in a large area, it would end up causing lag. Is there a more efficient way to do this?

I was considering having 2 effects that deals damage, end then setting the damage field of the behavior to my desired amount, but is there a more efficient way to deal bonus damage according to a attribute behavior?
 

Glorn2

Slap n' Tickle
Reaction score
4
Again late, but it would seem as though you are overlooking the fact that you can use attributes and buffs to increase damage by a % as it stands. you can set it so a point of "intelligence" increases spell damage by 1%, or strength increases physical damage by 1%. Really, you can turn any aspect of a unit into a stat point. The same concept works for items; you can create an item which increases spell damage by 20%. The problem then I guess is if you dont want spell damage % increase from intelligence and spell damange increase from % items to stack multiplivity, but additivly. It would be an irritating amount of work for such a small change though.
 

X-maul

AKA: Demtrod
Reaction score
201
Well, yea that would work if it was a flat increase; increase all spell damage by 10%. As an example, I want a unit with an ability that deals 20% spell power on impact and then 5% spell power every second for 5 seconds.

As far as I know, this can't be done with your approach, the way I'm doing it now, is to have a trigger, which activates every time a unit has an attribute change, then I change the effect of the unit to match (setting DAMAGE to 10% of spell power for triggering unit). This works okay for now, though it would be better to be able to use an already made system.
 

Glorn2

Slap n' Tickle
Reaction score
4
Ahh, yeah, I see your issue. I encountered that on a project I created years ago; DoT abilities would become OP compared to single target abilities.
Another way to do it through data (may be painful) would be to have each damage effect apply a damage response buff to the unit, which has 1 charge and expires when used. You could use the damage response buff to add "spell damage reduction" to the unit being hit, for that hit. IT would allow you to reduce the damage of one effect by 80%, and another by 95%, to get your desired 20% and 5%.

A triggered system doesn't cause you any lag in a big team team, using AoE spells?
 

X-maul

AKA: Demtrod
Reaction score
201
Haven't tested out the data approach you're suggesting, but I like to also be able to display in my tooltips that the ability deals 100 impact damage and 50 damage every second, so I might stick with my current method, nice idea with the damage response though :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top