#Damage filter record

1 messages · Page 1 of 1 (latest)

viscid bay
#

Is there a way to know the damage event record in the filter?
OnTakeDamage has the record, but the filter doesn't have it in the event table

Since I'm tracking attack events, I could try filtering out inflictor calls, but that just leaves me with any attack from the unit, and I can't differentiate between them.

exotic saddle
#

there is no record because you're filtering the damage instance before its started

viscid bay
#

are records from attacks different from records for damage?

#

tl;dr
I'm trying to convert crit damage into something else
so I need to reduce the damage done by the crit

exotic saddle
#

i believe you could reduce the crit with the special value override. and there was that crit detection modifier you had a thread about before

viscid bay
#

no like, the total damage done by crits
not just the increased amount
and yeah I'm using that crit detection to detect if the attack is a crit, but I don't know how to alter the total damage of the attack once I know that it is
wondering if I can use outgoing damage for it atm

exotic saddle
#

you could yeah, it gets called for every damage instance

viscid bay
#

outgoing damage is called before precritical_strike

#

so I can't filter out non-crits

#

the order doesn't work

exotic saddle
#

what if you use GetModifierPreAttack_BonusDamagePostCrit and return a negative value

#

or maybe use a second modifier on the target with Incoming Damage instead of outgoing? unsure of the exact order

viscid bay
#

incoming is only called for parent, just tested it

#

same issue
PostCrit is just bonus damage that isn't included in the crit multiplier (like old feast)

#

which is weird actually

#

it should be called after the multiplier is calculated

#

otherwise how does it increase the damage without having it get crit amped

#

I could reduce all outgoing damage to 0, then apply the damage when the attack lands, since I can detect the crit there
but thats a jank ass way of doing it

#

sounds like dota modding to me

viscid bay
#

ie; I hit something, function isn't called

#

only when the parent takes damage is incoming called

exotic saddle
#

using a second modifier on the target

viscid bay
#

oh
I mean I could
but that sounds even more jank than just removing outgoing damage from attacks and applying the damage myself

exotic saddle
#

assuming the order is correct, its definitely less jank

#

but you do you

viscid bay
#

how would I communicate the record between the modifiers? stack count = record?
that just feels more janky, what makes you say its less jank

exotic saddle
#

the record would be the same in the incoming event (i think), and you dont need to do anything on the client for this so you can just findmodifierbynameandcaster

viscid bay
#

well since its a record it should be the same, unless damage events and attack events have a different record

exotic saddle
#

what makes you say its less jank
you'd actually be manipulating the damage instance instead of discarding it and making a new one.

viscid bay
#

I see what you mean

viscid bay
#

looks like it works
order wise at least

viscid bay
#

I got it to work

#

then I had a realisation

#

this method works fine
except
it doesn't include barriers

#

barriers proc beforehand
so the barrier takes full damage, then the converted damage

#

which means we're back to my way

#

your way alters damage after its being applied, mine alters it beforehand

#

damn
there goes like 3 hours

#

as for how I know;
my conversion uses SetHealth() so it can bypass barriers
conversion at 100% still damages barriers, so woops it doesn't work

chilly pollen
#

what you trying to do? you need reduce crit damage like crit resist in lol?

viscid bay
#

ehh
kind of?

#

its not the end goal but functionally yes

viscid bay
#

my way doesn't really work either since I can't filter out proc damage (monkey king bar) from the outgoing damage reduction

chilly pollen
#

you can detect crit in modifier and reduce incoming damage isn't? or if you already use damage filter change damage in it? but I probably don't fully understand your problem.

viscid bay
#

my problem is that my reduced damage is still reducing barrier health

#

thats it

#

ie; 100% damage reduction, still lose barrier health

#

I have everything else working

chilly pollen
#

did you try to use modifier with constant block in damage filter and destroy it after take damage?

viscid bay
#

damage filter can't know when a damage instance is a crit since it has no record passed to it

chilly pollen
#

ok but total constant block or same property shoud know about it

viscid bay
#

...and?

#

yes, the damage block would have the record

#

thats not useful though

#

its a very specific combination thats creating this issue

#

if I didn't care about which attack it was (ie; didn't need to record) I could use damage filter
if I wasn't trying to pierce through barriers then I can just use the outgoing damage
but because I'm trying to have deterministic barrier piercing from a recorded damage instance it breaks

#

if I could correct the barrier then it wouldn't be an issue either
but theres no barrier amount property
thats handled solely but the class that creates the barrier
I could have a universal way of doing it for any instances I create myself, which would allow me to adjust the barrier health outside of the barrier's class
but that doesn't work for built-in barriers

#

because barriers are a new feature they're implemented so they work, but not so that they're overly versatile

chilly pollen
#

If you use custom barriers, you can make a general modifier for barriers and tell it when to block damage and when not to block damage

viscid bay
#

It needs to work with the built in barriers

viscid bay
#

I have come to the conclusion that what I am trying to do is just straight up impossible

floral grove
#

wait, what is your aim exactly?
I read the whole thread, and still don't know what you are trying to do

viscid bay
#

% of damage from crit pierces through barrier

green hull
#

yeah that just works against most of the game's systems

#

barrier is supposed to block all damage of a certain type, and there's no such mechanic where damage can pierce it

#

if Valve would've given us a damage flag like DAMAGE_FLAG_PIERCE_BARRIER then maybe, but they didn't (which makes sense as there is no such mechanic in Dota)

#

And that's not even talking about calculating percentages of damage after crits

#

I like the idea but it's just not a good fit onto Dota's systems. If you wanted to, you could remake crit and barrier systems on your own and implement this behavior

viscid bay
#

ultimately if I was to make a full custom mode then I would be able to make it work myself, theres only one or two major hiccup that stops it from working, alas I'm trying to make it work with the built in systems so I have to give up on the idea

green hull
#

You can tweak the design a bit. For example, make attacks against units that have barrier deal bonus damage. Or make attacks deal an instance of damage that is pure (which most barriers won't block).

Fit your ideas to the engine limitations

viscid bay
#

yeah but its just a shame I can't do that specific thing

green hull
#

Yeah. :/

floral grove
#

bypasses_block, no_dmg_multiplier and hploss seems promising

viscid bay
#

they don't work

#

the only way to pierce the barrier is to directly sethealth
unless theres some specific combination of flags I missed

#

bypass block I assume was for stout shield

floral grove
#

have you considered using modifier priority?
like, having your own barrier, but higher priority so that your barrier that is gonna be calculated

#

would it override, or fall down