Does anyone know, by any chance, if there are any existing BP-based “framework” for UE that utilize UObject as modules, akin to what ActorComponents do? Does not matter if it is abandoned or no longer supported.
What kind of “framework” are you talking about?
What is it you want to do?
Just was curious if anyone tried to basically re-invent the wheel of ActorComponents but using UObjects as modules (purely in BP space). I’m doing something akin to that myself and would love to get some insight into existing stepstones to save some time.
What do you believe an UObject component should do? What’s the shared behavior you’re after, here?
You could easily build two UObject subclasses, UComposableObject
and UObjectComponent
. The UComposableObject
would have an array of Children
. The UObjectComponent
would have a Parent
UComposableObject
.
You coud then implement AttachComponent
and DetachComponent
functions, AttachComponent
would first detach the component from whatever other object, and then attach it to the given object.
Maybe you also add event dispatchers for on-attached and on-detached events.
This is 30 minutes of work. And then what? What benefit do you get from this composition, where there’s no other commonality between objects? It won’t replicate. It won’t have a transform hierarchy. It won’t really … solve any problem that I’m aware of.
What’s your use case, concretely?
Also, I’m a little confused by something in the question: What would using an UObject
as a module have to do with this? A module is a unit of code that gets separately loaded, like a DLL. Your typical C++ or blueprint library is a module (or part of a module); there’s no UObject
involved there. Do you mean “module” as in “component that gets attached?”
Module as in modular. The context was purely in BP space so the idea is reusable functionality logic, where FL wont apply (state).
Not sure why you suddenly got so invested into trying to prove it has no use.
If you are looking for a framework/library, it’s helpful to know what needs/features it should have.
UActorComponent
is a UObject
already, as is most anything that lives in Blueprint space. It’s possible to make BP-only child classes for an actor component.
A well-encapsulated blueprint class can be modular, and can be based on UObject
, UActorComponent
, or any other Blueprintable
object type.
I think what @jwatte meant is the word “module” in context of Unreal is used for an actual Engine module.
Only useable on Actors. You can’t reuse it anywhere.
That’s not my question. I’m asking what the use is, because without knowing a particular use case, it’s impossible to provide any kind of directed advice.
As I said: having an UObject class that has an Array of child UObjects called Children, and another (or same) class that has a Parent property UObject is quite simple to build up, and achieves the “composable UObject” goal.
So, now that goal is achieved: What do you want to do with it? What is this helping out with? Where does this pattern come in such that capturing that Array and that Variable in the abstract, is helpful? If you have one of these generic UObjects, what are you going to do with it?