amethyst / specs

Specs - Parallel ECS
https://amethyst.github.io/specs/
Apache License 2.0
2.49k stars 219 forks source link

Re-add support for dynamic components (for scripting) #763

Closed lambdadog closed 1 year ago

lambdadog commented 1 year ago

Description

It looks like previously support for dynamic components was added in #70, but it was unceremoniously removed in ee46654, without any references to its addition or removal in the changelog at any point.

As far as I can tell, shred itself can currently already support for this by using "dynamic IDs" as per the ResourceId documentation, it'd be nice to support this again in specs.

Motivation

Essentially what was noted in #64, engine and modding support that wish to dynamically create components via, for example, an embedded scripting language like Lua.

Drawbacks

Since the existing API can continue to be used by just wrapping this "with_id" API with an ID of 0, there should be exactly no drawbacks to adding this.


I'm absolutely open to work on this if it's approved. My Rust is a little rusty, but it should be a simple enough thing to implement since there's full support already existing in shred.

lambdadog commented 1 year ago

I've decided to just go ahead and use shred directly for my usecase.