Open LuanHimmlisch opened 1 month ago
To illustrate my example further, here's the code of how would you do it currently
As you can see, the opts key is being filled by suppositions based on the equality of the values with its parent, however this may be correct or incorrect, as a child could sync any value relative to a parent, thus not being the same value.
Having a getter to get these options would make it possible to recreate hierarchies on the fly.
Reviewed guidelines
Checked for duplicate suggestions
Summary
Being able to get the options that a IWorldInstance is configured in a parent:![image](https://github.com/Scirra/Construct-feature-requests/assets/46875694/42f0dc38-d68e-4a85-8f10-bfbb9338909b)
It should return a similar object as the one passed when adding a child:![image](https://github.com/Scirra/Construct-feature-requests/assets/46875694/c7096fd2-65ad-425f-b437-e2712daa4a94)
Possible workarounds or alternatives
There's no way to know the configuration of a child.
Proposed solution
Add a
getParentOpts()
or similar to get the options:Also, a QOL feature would be to automatically attach this object when iterating over children with
allChildren
. Maybe on an extrahierarchyOpts
key.Why is this idea important?
This would allow to automatically create hierarchies on the fly perfeclty.
The current case, is for syncing an entire hierarchy tree using the Multiplayer Sync.
You could sync just one object, and have the host send the objectType names + hierarchy options. And have the client recreate the hierarchy perfectly with the same options, with minimal code.
Additional remarks
No response