Bevy version
V 0.3.0
Operating system & version
Ubuntu 18.04
What you did
I was following getting started in the Bevy book and at the step 2.3, I copied the code. (I checked if i had missed some part of the code, and added nothing that wasn't mentioned in the book).
What you expected to happen
I expected my result to be the same as write in Bevy Book
What actually happened
I got the following errors after compiling:
- {unknown}
no method named `system` found for fn item `fn(bevy::prelude::Commands) {add_people}` in the current scope
`add_people` is a function, perhaps you wish to call itrustc(E0599)
- {unknown}
no method named `system` found for fn item `for<'r, 's> fn(&'r Person, &'s Name) {greet_people}` in the current scope
`greet_people` is a function, perhaps you wish to call itrustc(E0599)
Any additional information you would like to add such as screenshots, logs, etc.
My code:
use bevy::prelude::*;
struct Name(String);
struct Person;
fn hello_world() {
println!("hello world!");
}
fn add_people(mut commands: Commands) {
commands
.spawn((Person, Name("Elaina Proctor".to_string())))
.spawn((Person, Name("Renzo Hume".to_string())))
.spawn((Person, Name("Zayna Nieves".to_string())));
}
fn greet_people(_person: &Person, name: &Name) {
println!("hello {}!", name.0);
}
fn main() {
App::build()
.add_startup_system(add_people.system())
.add_system(hello_world.system())
.add_system(greet_people.system())
.run();
}
In addition, this error is maybe due to this commit #876, the Bevy Book may need some adjustment
@Laozey is one of my student and would love to be mentored to fix the docs. I am sure! :D
Also I think the right repository was https://github.com/bevyengine/bevy-website/ where the book source belong.
馃憢 welcome !
The issue is that the website follow the released version of bevy, version 0.3.
If you try running the code against the latest version from git, you will have issue... Similarly, you can't run the examples from git against the released version. This is a recurring issue with no obvious solution.
For the example, there's now a note in the readme: https://github.com/bevyengine/bevy/tree/master/examples#%EF%B8%8F-note-for-users-of-releases-on-cratesio
There's also issue #407 discussing publishing git API docs.
The issue would be to have website (or other documentation) for released version and for master, with an easy way to know which is which
I think the difficult aspect is to keep master bevy up to date with master book _at all times_. @cart said developer priority should not be focused on documentation as the codebase is quite volatile, but I'm not exactly sure what update cycle for the book it implies (would we only update the book on releases?).
I think what needs to be resolved is that some people are using bevy git master when they are not working directly on bevy.
We can make this happen less by removing the advice of running against git master from the book, or strongly flag that the book content won't be compatible with git master.
This is at the bottom of the "getting started" part of bevy book. https://bevyengine.org/learn/book/getting-started/ :
NOTE: Bevy is currently being updated at a rapid pace. Taking a dependency on the git repo instead of the cargo crate will allow you to receive the latest updates as fast as possible.
The current phrasing makes it sound like a good idea.
bevyengine/bevy-website#66 is progress to closing this / closes this.
Most helpful comment
I think what needs to be resolved is that some people are using bevy git master when they are not working directly on bevy.
We can make this happen less by removing the advice of running against git master from the book, or strongly flag that the book content won't be compatible with git master.
This is at the bottom of the "getting started" part of bevy book. https://bevyengine.org/learn/book/getting-started/ :
The current phrasing makes it sound like a good idea.