Open MiniaczQ opened 1 month ago
Aren't these just components? What else needs to be done?
Observers are components on a separate entity
So if I want to make a generic NPC bundle that has a "start conversation observer", I'd need to make an EntityCommands
extension rather than a Bundle
I think you can also stick an observer on the entity it's watching, which is fitting for this use case.
I see, I'd still like to hear James' opinion
@james-j-obrien what do you think?
While you can technically make the entity itself an observer you can't do that multiple times as the ObserverState
component would get overridden leading to serious issues. If that was exposed in bundles users could easily accidentally break things by inserting different bundles that each have observers.
Alternatively we could introduce some other component that has an on_add
hook to spawn an observer.
Installer (as I like to call it) pattern would work for simpler cases, good idea 🙂
Going one step further, how would observers work with serde/scenes? Was it discussed somewhere?
What problem does this solve or what need does it fill?
Ability to add observers as part of a bundle would help a lot in composing entities.
What solution would you like?
The simplest way I can think of is to allow
EntityCommand
trait as part of bundles.What alternative(s) have you considered?
Nothing else came to mind.
Additional context
Idea from https://discord.com/channels/691052431525675048/691052431974465548/1259529220892131348