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

Add docs showing basic setup intructions #83

Closed
keeganstothert opened this issue May 7, 2018 · 6 comments
Closed

Add docs showing basic setup intructions #83

keeganstothert opened this issue May 7, 2018 · 6 comments

Comments

@keeganstothert
Copy link

I'm a rustacean and an indie game developer. The main reason i'm looking to switch to godot is for these rust bindings. Any chance someone could update the docs to show the basic path to integrating with godot and perhaps a list of missing features (missing api's, code completion, hot reloading, etc) to make it easier to determine the state of affairs.

Thanks for putting in the work guys!

@nical
Copy link
Contributor

nical commented May 8, 2018

Hi @keeganstothert, at the moment the best documentation is to look at the examples in the repository and the API doc in docs.rs (I just did a push to crates.io so the updated API should show up on docs.rs shortly).
I definitely agree that we need good tutorials, but for now I think that it's best for me to dedicate the limited amount of time I have to missing features.
To follow the status of the project I suggest looking at the issues, my experience is that I am not super good at keeping a separate TODO list in the README in sync, and I am also discovering godot's (very large) API as I work through the bindings so I don't even have a 100% accurate idea of how much's left.
That said there are plenty of things that are in place already, most of the automatically generated APIs are there although there might be some changes in the future in how non-reference counted objects are exposed and how they interact with memory safety (see issue). Perhaps the most outstanding missing thing right now is a high level API to add signal arguments to gdnative classes implemented in rust.

Feedback is very much welcome, so if you are missing something or believe something should be exposed differently, please let us know! Contributions are of course welcome too, this project has lots low hanging fruits to pick.

@bluenote10
Copy link
Contributor

One thing that is not very clear to me is how the setup on Godot side can be achieved. I can see the examples, and they work fine for me. The surprising thing is that they don't use a .gdns file -- somehow the native library is attached directly to the .gdnlib.

I've been trying to replicate this on Godot side in my own projects, but if I follow the instructions in the README:

Now the HelloWorld class can be added to any node by clicking the "add script" button. In the popup-select the "NativeScript" option and set the class name to "HelloWorld".

I always end up with a .gdns file instead (and they don't seem to load properly, maybe the direct loading is needed?).

Is the setup of the examples actually achievable from the Godot GUI or does it require manual editing of the scene sources? Would be nice to clarify "native script" vs "native library" and the role of .gdns files in the docs.

@ghost
Copy link

ghost commented Dec 22, 2019

@bluenote10 You need both the .gdnlib and the .gdns files. You can create both in the GUI. The setup is not specific to the Rust bindings. The Godot docs contains detailed instructions for creating the files: http://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-c-example.html#creating-the-gdnativelibrary-gdnlib-file

As for the README, right above the instruction you quoted there are instructions for creating the .gdnlib file:

All NativeScript classes live in a GDNative library. To specify the GDNative library, a GDNativeLibrary resource has to be created. This can be done in the "Inspector" panel in the Godot editor by clicking the "new resource" button in the top left.

With the GDNativeLibrary resource created, the path to the generated binary can be set.

@bluenote10
Copy link
Contributor

@toasteater What was confusing me is that the examples are made without a .gdns file, and I thought I had to replicate that setup. But it turned out that I had an unrelated issue, and it works now with .gdns + .gdnlib.

What I haven't figured out is how to achieve a setup without a .gdns file from the GUI, or why the examples do that in the first place. In the examples the content of the .gdns file is basically embedded in the scene file itself. I guess this can only be done by manual editing.

@ghost
Copy link

ghost commented Dec 22, 2019

@bluenote10 When attaching a script to a node using the Inspector (Inspector -> Script -> Drop Down -> New Script) you can choose to create a "Built-in Script". Such a script resource will be embedded in the scene file. As for why the examples are doing that though, I don't really know. Personally I still prefer separate files.

@ghost
Copy link

ghost commented Jan 2, 2020

Closed as the README now contains rather detailed information on installation as of Jan. 2020.

@ghost ghost closed this as completed Jan 2, 2020
This issue was closed.
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