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

Candidates for FAQ #8

Open
6 tasks
Bromeon opened this issue Oct 15, 2023 · 9 comments
Open
6 tasks

Candidates for FAQ #8

Bromeon opened this issue Oct 15, 2023 · 9 comments
Labels
new-topic New content added to the book

Comments

@Bromeon
Copy link
Member

Bromeon commented Oct 15, 2023

It's not yet clear whether we'll have an FAQ section in the book and if yes, how we are going to structure it. One idea would be to have 100% of the information as part of the tutorial, and use the FAQ only to refer to different chapters and sections. This way, people reading the book from A-Z would not miss anything, and we don't have to duplicate content.

This issue tracks potential candidates for often-asked questions. Once more basic parts of the book are done, we can decide what to do with these. Very basic questions such as "how can I use Gd" or "how do I export an enum" should NOT be part of the FAQ, these should be covered in the tutorial.


Questions, by category

Classes and objects

  • Can init take parameters?
  • How do I get a T from a Gd<T>?
  • Can I attach Rust scripts to a node?
    What do I do if one Rust class should be used by differently typed nodes in the tree?
  • How do I create a singleton?
  • Can I store references/lifetimes in a GodotClass?
  • GDExtension entry point 'gdext_rust_init' not found in library
    Typically indicates that lib.rs is not compiled, or the cdylib is created in a different path.

Tooling

@Bromeon Bromeon added the new-topic New content added to the book label Oct 15, 2023
@lilizoey
Copy link
Member

lilizoey commented Oct 15, 2023

(making a comment since i cant currently edit the issue directly)
questions i have seen people ask:

  • How do i get a T from a Gd<T>

Also a comment i made on discord about this list that im copying in here:

I think it'd be useful for this issue to not only track candidates for a potential future FAQ, but also other frequently asked questions people actually have. then we can in the future discuss where to best document the questions, whether it be in the FAQ, the book, or the API-docs.

@StatisMike
Copy link
Contributor

StatisMike commented Jan 27, 2024

Looking through current threads in #help-gdext, some possible candidates, with possible links to some additional tooling available:

  • project setup (structure etc): as it is already described, possible link to scaffold-godot-rust
  • accessing base - its usage and caveats
  • why Rust-defined methods for custom GodotClass don't show up on Gd<T> - bind()/bind_mut() additional explanation
  • Rust-defined GodotClass not showing in Godot-Editor - possible reasons, especially the lack of init impl
  • is unit testing possible - especially explanation why the #[test] doesn't work with Godot types, possible link to gd-rehearse
  • #[func(gd_self)] applications
  • passing Gd with multi-threading - current workaround of passing InstanceID (though depends of how temporary this workaround would be needed, seeing the current work made in multi-threading)
  • Builtin GodotClass not showing up in gdext often they are caused by not enabling the experimental-godot-api feature
  • Optional parameter for method not showing up: *_ex methods

@Wilker-uwu
Copy link
Contributor

maybe not as relevant of a question, but i've ran into this issue a couple times, which i think would be useful to point as a common case:

how do i make sure my exported game has access to the gdextension for release builds?

as of now, my game i exported with a .so or a .dll accompanying the executable. when people download my game from Itch.io or another place where they tend to get the game in a .zip file, they usually run the game without extracting it, and that has been causing a couple issues getting the game to work.

another issue is getting it to access the glibc provided by the OS. i've had a couple of linux build failing to recognize a package as the proper version required by the .so, and the game fails to run.

i think this question would cover a common enough case for the FAQ.

@GeorgeS2019
Copy link

possible to export as c# callable rust.dll?

@Bromeon
Copy link
Member Author

Bromeon commented Mar 25, 2024

@GeorgeS2019 could you elaborate?

@GeorgeS2019
Copy link

Rust FFI (Foreign Function Interface)

https://github.com/godot-rust/gdext/tree/master/godot-ffi

If my understanding is correct, RUST is available as GDExtension.

Is it possible to write RUST code to expose ported rust codes for c# consumption, e.g.
virtual-puppet-project/real-time-lip-sync-gd#3

@Bromeon
Copy link
Member Author

Bromeon commented Mar 25, 2024

GDExtensions can register custom classes and functions with the Godot engine, which then behave like built-in classes. So yes, they can also be invoked from C#. When it comes to dependencies and code generation, that's another topic though, see godot-rust/gdext#615.

Regarding whether this can be in FAQ: yes 🙂

@GeorgeS2019

This comment was marked as spam.

@Bromeon
Copy link
Member Author

Bromeon commented Jul 30, 2024

@GeorgeS2019 This is an issue regarding FAQ about the library itself, and not the place for advertising other projects. If your project is based on godot-rust, feel free to use our #showcase channel on Discord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-topic New content added to the book
Projects
None yet
Development

No branches or pull requests

5 participants