Hi,
I’m busy coding a plugin in c++ and so far implemented 2 different approaches to the same problem both having drawbacks. So I’m hoping that someone can suggest perhaps a better alternative that I overlooked. I’ll explain the basic scenario.
I have Actor A with an ActorComponent that hosts some variables. I have Actor B with another ActorComponent that Actor A is communicating with.
I would like Actor B’s ActorComponent to be able to override the variables from Actor A.
Actor A is likely something easily identifiable like a Player Character whilst Actor B could be any actor.
The methods I tried so far are:
-
Actor B has a copy of each variable along with a separate Boolean to leverage EditInLine so it is possible to choose which variables this overrides. This approach gives the best featured user experience in the editor but isn the least flexible in my opinion. There are lots of variables, adding new, removing or changing would be cumbersome.
-
Variables are stored in Classes which provide greater flexibility in the system, allowing the selection of specific classes to be used. But as it isn’t possible to know which classes are going to be used, Actor B has to replace the entire class in order to change a sticker property. Imagine Actor A component has Class A, a developer makes Class B, C etc. How could Actor B override specific variables in any of those new classes.
I’m trying to make it as generic as possible.
I’m not sure if I’ve explained this well, but any other thoughts on a better approach or perhaps another entity I can consider to host the data.
Thanks in advance