Can you pass a variable to a Damage Type class during Apply Damage?

Is there any way to change the variables held inside a Damage Type class at runtime during the Apply Damage event or are they static? I was hoping to use one Damage Type Class containing a map of the various types of damage (fire, ice, etc.) to allow for multiple damage types on the same attack and modify this at runtime through the actor causing the damage, is this possible or will I need to create my own Damage event?

1 Like

That’s the whole point of using damage type:

Create your own damage type:

309303-newdamage.jpg

Define any behaviour you need:

And then you can use it with the damage system. Also, do consider spending 10 minutes with this short tut in case you’re unfamiliar with Interfaces:

They make the whole system work smoothly.

3 Likes

Sorry for necroposting @Everynone, and thanks for the video (and all your other precious answers!)

Do you know if there’s a way to pass a parameter during “apply damage” itself without creating too many damage type classes?

For example imagine that I want to apply water damage, but I also need to pass whether it’s physical or not to use different stats during the damage calculation.
Is it possible without overriding the ApplyDamage function in the actor class or without creating a duplicate datatype (DT_Water_Physical, DT_Water_Special)

Thank you in advance!

Hi there,
I haven’t tested it myself, but before applying damage, perhaps you want to get your damage class with custom variables, create object from class, modify variables values based on current ability, then get class and connect it to apply damage. On the other side, event any damage, get damage class, create object from class and get your custom variables to proceed with the rest of your damage calculation workflow.

Again, not sure if that works. Perhaps the solution with interface communication from the previous post should do the trick much easier.

You may want to try creating a data table for every damage type with all parameters associated based off a struct variable. On the target side, event any damage, get damage type and read a data table to extract queried variables.

Thanks for the answer, I’ve already tried to expose the variables on spawn and do what you said but ApplyDamage has a pure class input (purple node) and I wasn’t able to pass the created object.

Maybe there’s a different way to do it, I’ll try to dig deeper

1 Like

Got it. I’ll see if I find something and share it here.

Good luck.

1 Like