What is a Damage Type Class?

I’ve been researching this for hours now and I have no idea how to use it.

I tried to make the actor perform different processing based on this class, but it could not be used for branching, and even when I tried to write additional information, it was impossible because it was specified as a class type, and I was also unable to add tags. Instead, some meaningless parameters are set by default.

What is this for? It seems to be intended for use only under very limited circumstances. Personally, I think a simple object-type input for the damage event is enough. Why is it implemented in such an inconvenient way?

But there’s nothing else that seems like it could be used to separate damage types…Can someone tell me how to use it?

you’d extend the base class with a virtual function such as ApplyCustomDamage, which you could override in children, so you could do Physical/Magical/Fire damage etc as different classes

then you pass through the class, construct the object and call the function.

that said i prefer to make my own custom damage systems

1 Like

I’ve seen this kind of usage in many tutorial videos, but it’s still very inconvenient.

For example, if each attribute has a different resistance, you need to pass all of those values ​​to the function. If we can classify damage type on the actor side, we can use Switch to refer to the value of each variable directly.
However, the damage type does not know anything about the actor, so you need to pass all variables or refer to the actor’s information.With every damage.

But the default damage system still shows promise. In particular, the ability to obtain hit information separately from hit events is something that is difficult to replace elsewhere.

nah just pass in the actor and use an interface. so pass an actor to fire damage type and it uses the interface to GetFireResistance etc.

switch is fine in small projects but if you have many damage types and maybe want to add more in ‘expansions’ it gets unwieldy.

you can do this with any interface

This only works if the actors are derived from a single class. Unfortunately, that’s not the case in my case.
If the switch can be used on the actor side, the actor class is irrelevant.

thats why i said use an interface but yeah i dont use it either, and doesnt like you want to. it was more to answer the quesion of ‘Why would you use it’ to whoever reads this later.

1 Like