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

Usage #1

Closed
rosshadden opened this issue Jul 25, 2017 · 19 comments
Closed

Usage #1

rosshadden opened this issue Jul 25, 2017 · 19 comments

Comments

@rosshadden
Copy link

Can you explain how to install and use this? I know you just created and are working on this project and that's of course why there aren't any docs, but I would love to start using it and helping out where I can.

@rosshadden
Copy link
Author

@endragor to be more specific, what is the entry point? I compiled and run apigen.nim, which successfully created a bunch of nim files as I would expect. I tried compiling nimruntime.nim and godot.nim, but start to get errors later on down the pipeline. In general I can't figure out how to generate the .so library file I believe I need to point godot to in order to use the nim bindings.

@endragor
Copy link
Member

Hmm, this got attention faster than I expected :) Thank you for your interest, @rosshadden. I'll add sample project soon enough (hopefully today) - there are still several fixes that need to be applied to Godot for this to fully work.

@endragor
Copy link
Member

I added simple project as a setup example: https://github.com/pragmagic/godot-nim/tree/master/examples/simple
It shows how to load/instantiate scenes, handle input, perform actions on game tick. Hopefully this can serve as a starting point. The rest actually comes from Godot API knowledge which you can get from either going through the generated files (in godotapi folder) or official documentation.

I haven't tested it on Linux so if it doesn't work there (could be because of wrong paths in build script, for example), then please let me know or make a PR that fixes it.

@rosshadden
Copy link
Author

rosshadden commented Jul 26, 2017

Awesome, thanks!

By the way, the reason I found this so quickly is that had have been planning to do this for a couple months (I figured I would have to, since Nim isn't as popular as it deserves yet), and coincidentally just sat down this week to start seeing what was necessary by looking at existing bindings for other languages. Part of that research involved searching GitHub for "Godot bindings", which surprisingly led me to this which you had literally just started 😂.

@endragor
Copy link
Member

Alright :) It's actually quite complete already, there are few known bugs that are going to be fixed by the end of the week. We are using it to develop an actual commercial game (actually, in the process of migrating an existing unpublished game from UE4).

@rosshadden
Copy link
Author

I got it all working. Thanks for your help, and for making the project. Sorry for the noise---I had made some comments while trying to figure something out, and have since deleted them.

@endragor
Copy link
Member

endragor commented Jul 26, 2017

nake build is supposed to create .so. There is no way the example can work without it :)
And regarding the symlink - yeah, there was one step missing in the instructions. It is to install the library in advance, so that nakefile can access apigen: nimble install https://github.com/pragmagic/godot-nim.git. Will add that.

@ghost
Copy link

ghost commented Jul 27, 2017

Yay, much thanks for these bindings!!!!!
Nim is a perfect fit for Godot!
Much thanks again!

@ghost
Copy link

ghost commented Jul 28, 2017

@endragor can you please give links to the PR's that are required to use default godot branch?

@endragor
Copy link
Member

https://github.com/godotengine/godot/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aendragor%20

Only godotengine/godot#9721 is left and we discussed a different approach with @karroffel. I'll implement it today and release v0.3.0, there is a bunch of changes incoming. I'll add documentation when everything works as expected.

@ghost
Copy link

ghost commented Jul 28, 2017

@endragor ok, thanks!

@ghost
Copy link

ghost commented Jul 28, 2017

@endragor so we can use prebuilt godot now?

@endragor
Copy link
Member

endragor commented Jul 31, 2017

The fork is not required anymore, you can use godot's official master branch: https://github.com/godotengine/godot

If by "prebuilt godot" you refer to 3.0-alpha1, then no, it cannot be used, because it was built earlier than the PRs were merged. But the next alpha/beta release will work.

@ghost
Copy link

ghost commented Aug 1, 2017

@endragor I have an issue compiling godot-nim on Windows:
Invalid GODOT_BIN path: "E:\godot\bin\godot.windows.opt.tools.32.exe"

@ghost
Copy link

ghost commented Aug 1, 2017

Ah, it seems that it doesn't like quotes in path to bin

@R3D9477
Copy link

R3D9477 commented Jun 9, 2018

@endragor Sorry, I've never used Godot and godot-nim, yet. Does godot-nim use GDNAtive for communication with Godot?

@rosshadden
Copy link
Author

Yeah man, GDNative, or whatever they are calling it these days.

@R3D9477
Copy link

R3D9477 commented Jun 9, 2018

@rosshadden sorry for another stupid question: can game with nim be ported to mobile platforms?

@rosshadden
Copy link
Author

Maybe I don't understand your question, but the languages you use to program a game---whether they are built-in or through gdnative---have nothing to do with Godot's export capabilities.

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