You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
2.2 KiB
Markdown

4 years ago
# gdextension
4 years ago
GDExtension template that automatically builds into a self-contained addon for the Godot Asset Library.
4 years ago
4 years ago
### Getting started:
1. Clone this repository (or a new repository with this template) with submodules.
- `git clone --recurse-submodules https://github.com/nathanfranke/gdextension.git` \
3 years ago
- `cd gdextension`
2. Update to the latest `godot-cpp`.
- `git submodule update --remote`
3 years ago
2. Build a debug binary for the current platform.
4 years ago
- `scons`
4 years ago
3. Import, edit, and play `project/` using Godot Engine 4+.
3 years ago
- Alternatively, run the project using the terminal.
- Either alias an existing executable to godot4: `alias godot4="~/workspace/godot/bin/godot.linuxbsd.tools.x86_64"`
- Or, on Arch Linux, install `godot4-bin` from the AUR (`yay -S aur/godot4-bin`).
- Finally, `godot4 --path project/`
4 years ago
4. Check the output:
```
Hello GDScript!
Hello GDExtension Node!
Hello GDExtension Singleton!
```
### Repository structure:
4 years ago
- `project/` - Godot project boilerplate.
4 years ago
- `addons/example/` - Files to be distributed to other projects.¹
- `demo/` - Scenes and scripts for internal testing. Not strictly necessary.
- `src/` - Source code of this extension.
- `godot-cpp/` - Submodule needed for GDExtension compilation.
3 years ago
¹ Before distributing as an addon, all binaries for all platforms must be built and copied to the `bin/` directory. This is done automatically by GitHub Actions.
4 years ago
### Make it your own:
1. Rename `project/addons/example/` and `project/addons/example/example.gdextension`.
4 years ago
2. Replace `LICENSE`, `README.md`, and your code in `src/`.
3 years ago
3. Not required, but consider leaving a note about this template if you found it helpful!
4 years ago
### Distributing your extension on the Godot Asset Library with GitHub Actions:
4 years ago
1. Go to Repository→Actions and download the latest artifact.
2. Test the artifact by extracting the addon into a project.
4 years ago
3. Create a new release on GitHub, uploading the artifact as an asset.
4 years ago
4. On the asset, Right Click→Copy Link to get a direct file URL. Don't use the artifacts directly from GitHub Actions, as they expire.
5. When submitting/updating on the Godot Asset Library, Change "Repository host" to `Custom` and "Download URL" to the one you copied.