49. External files, libraries and packaging
GDScript does not use C-style headers or textual #include. Use extends for inheritance, preload/load for actual Godot files, and PCA’s script router for authored records. These are distinct forms of reuse.
| You have… | Use… |
|---|---|
| A PCA native/PCA/Lua/BASIC/visual record | CallScript or IncludeScript with its ID |
| A .gd file already in the Godot project | preload/load, then new() |
| A .tscn/.scn PackedScene | load, type-check, instantiate, add_child |
| A custom Resource | load/ResourceLoader or ResourceSaver with a supported path |
| An extra addon/native extension | Install/configure in the editable Godot project and export for the target |
The normal desktop runner is precompiled. Its game pack includes the documented game data and asset tree; it is not a promise to collect arbitrary res://custom files mentioned in source. For new loose scripts, scenes, addons or native extensions, export an editable Godot project, add the files there, and build through Godot.
Keep extensions in a separate custom folder. Exporting a fresh PCA source project later does not automatically merge your previous custom Godot edits. Copy/reapply them deliberately, and test the exported game on a clean location.
Figure 16. Build Game offers Export Editable Godot Project for work that needs additional Godot files or project configuration.
