#Damage filter record
1 messages · Page 1 of 1 (latest)
there is no record because you're filtering the damage instance before its started
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
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
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
you could yeah, it gets called for every damage instance
ahhhh
outgoing damage is called before precritical_strike
so I can't filter out non-crits
the order doesn't work
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
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
is incoming not post-crit?
^
ie; I hit something, function isn't called
only when the parent takes damage is incoming called
using a second modifier on the target
oh
I mean I could
but that sounds even more jank than just removing outgoing damage from attacks and applying the damage myself
how would I communicate the record between the modifiers? stack count = record?
that just feels more janky, what makes you say its less jank
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
well since its a record it should be the same, unless damage events and attack events have a different record
what makes you say its less jank
you'd actually be manipulating the damage instance instead of discarding it and making a new one.
looks like it works
order wise at least

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
what you trying to do? you need reduce crit damage like crit resist in lol?
my way doesn't really work either since I can't filter out proc damage (monkey king bar) from the outgoing damage reduction
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.
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
did you try to use modifier with constant block in damage filter and destroy it after take damage?
damage filter can't know when a damage instance is a crit since it has no record passed to it
ok but total constant block or same property shoud know about it
...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
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
I have come to the conclusion that what I am trying to do is just straight up impossible
wait, what is your aim exactly?
I read the whole thread, and still don't know what you are trying to do
% of damage from crit pierces through barrier
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
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
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
yeah but its just a shame I can't do that specific thing
Yeah. :/
the only way is to block a portion, then give separate damage instance that pierces through barrier, right?
have you tried each of these flags?
https://moddota.com/api/#!/vscripts?search=damage flag
bypasses_block, no_dmg_multiplier and hploss seems promising

