Open dyedquartz opened 3 years ago
Hi @dyedquartz, I haven't tried the deserialization by myself yet, but as I can see from documentation for legion::serialize
module, they pass a serde_json::Value
as an argument to deserialize()
, not a String
(because serde_json::to_value()
returns serde_json::Value
there).
What you can try is adding something like let json = serde_json::from_str(data).unwrap();
and then passing that json
to deserialize()
instead of data
.
Just solved the same issue by converting String
to json::Value
.
However, I have a next issue now: after calling as_deserialize_into_world(...).deserialize(json_value)
, I don't have the id of the newly created Entities.
How can I refer to the newly created entities?
@zedrian @dyedquartz Herbert, the author of the said tutorial and "Hands-on Rust" book (which is another tutorial), has created a forum. I've opened a topic about prefabs here (might take some time to pass pre-moderaion). I have also published a working deserializer in issue #269 in this repo.
Hi! I'm trying to follow the rust rogueliketoolkit tutorial and trying to convert it to legion.
I'm trying to deserialize a
savegame.json
file, but I'm getting errors. The deserializer isn't well documented, but I've tried my best:The
register_components!
macro is just a way to iterate over all my components and register them with a name of their lowercase struct namesorry for such a basic question, but I'm really having problems and I don't know how to fix it.