Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch8 Items - ConvertSaveload in WantsToDropItem component #174

Open
dgobi opened this issue Sep 9, 2021 · 2 comments
Open

Ch8 Items - ConvertSaveload in WantsToDropItem component #174

dgobi opened this issue Sep 9, 2021 · 2 comments

Comments

@dgobi
Copy link

dgobi commented Sep 9, 2021

Hello,
I'm a beginner following along with the tutorial and I came across a derivation that seems to be incorrect:

#[derive(Component, Debug, ConvertSaveload, Clone)]
pub struct WantsToDropItem {
    pub item : Entity
}

From another closed issue it seems like the ConvertSaveload is an error? Either that or I'm missing something important. No matter how I change things in the includes I get errors about being unable to find 'serde' in the list of imported crates.

@dgobi dgobi changed the title Ch9 Items - ConvertSaveload in WantsToDropItem component Ch8 Items - ConvertSaveload in WantsToDropItem component Sep 10, 2021
@Frans-Lukas
Copy link

Chapter 10 goes through how ConvertSaveload is used. I also saw that it's written before being used (i.e. in ch. 8). If you want to fix the error import
use specs::saveload::{ConvertSaveload, Marker};

I also needed to use a specific version of serde for it to work, here's what I put in my cargo.toml:

serde = { version = "^1.0.44", features = ["derive"] }
serde_json = "^1.0.44"

@andreas-wolf
Copy link

And don't forget to add specs = { version = "0.18.0", features = ["serde"] } to cargo.toml. I was missing the features part and got unresolved import specs::saveload which I did not see at first because you're flooded with cannot determine resolution for the derive macro ConvertSaveload errors. This change is silently introduced in the sources chapter 11 (2.10 Saving and Loading).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants