Skip to content

Commit ed0f5ff

Browse files
authored
Add new section about editing library files (#538)
* add new section about editing library files * remove linebreaks * remove one more new line
1 parent 131a6bd commit ed0f5ff

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/en/manuals/libraries.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ https://gitlab.com/defold/private/-/archive/main/test-main.zip?private_token=per
7171

7272
### Advanced access authentication
7373

74-
When using the basic access authentication a user's access token and username will be shared on any repository used for the project. With a greater than 1 man team this can be an issue. To solve this issue a "read only" user needs to be used for library access to the repository, on GitHub this requires an organization, a team and a user who doesn't need to edit the repo (hence read only).
74+
When using the basic access authentication a user's access token and username will be shared on any repository used for the project. With a greater than 1 man team this can be an issue. To solve this issue a "read only" user needs to be used for library access to the repository, on GitHub this requires an organization, a team and a user who doesn't need to edit the repo (hence read only).
7575

7676
GitHub Steps:
7777
* [Create an organisation](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/creating-a-new-organization-from-scratch)
@@ -81,7 +81,7 @@ GitHub Steps:
8181
* [Create or select a user to be part of this team](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/organizing-members-into-teams)
8282
* Use the "basic access authentication" above to create a personal access token for this user
8383

84-
At this point the new user's authentication details can be committed and pushed to the repository. This will allow anyone working with your private repository to fetch it as a library without having edit permissions to the library itself.
84+
At this point the new user's authentication details can be committed and pushed to the repository. This will allow anyone working with your private repository to fetch it as a library without having edit permissions to the library itself.
8585

8686
::: important
8787
The read only user's token is fully accessible to anyone who can access the game repositories that are using the library.
@@ -103,6 +103,16 @@ Now the folders that you shared appear in the *Assets pane* and you can use ever
103103

104104
![Library setup done](images/libraries/libraries_done.png)
105105

106+
## Editing Files in Library Dependencies
107+
108+
Files in libraries cannot be saved. You can make changes, and the editor will be able to build with those changes, which is useful for testing. However, the file itself remains unchanged, and all modifications will be discarded when the file is closed.
109+
110+
If you want to make changes to library files, make sure to create your own fork of the library and make changes there. Another option is to copy/paste the entire library folder into your project directory and use the local copy. In this case, your local folder will shadow the original dependency, and the dependency link should be removed from `game.project` (don’t forget to choose <kbd>Project ▸ Fetch Libraries</kbd> afterward).
111+
112+
`builtins` is also a library provided by the engine. If you want to edit files there, make sure to copy them into your project and use those instead of the original `builtins` files. For example, to modify `default.render_script`, copy both `/builtins/render/default.render` and `/builtins/render/default.render_script` into your project folder as `my_custom.render` and `my_custom.render_script`. Then, update your local `my_custom.render` to reference the `my_custom.render_script` instead of the built-in one, and set your custom `my_custom.render` in `game.project` under the Render setting.
113+
114+
If you copy-paste a material and want to use it across all components of a certain type, it might be useful to use [per-project templates](/manuals/editor/#creating-new-project-files).
115+
106116
## Broken references
107117

108118
Library sharing only includes files that are located under the shared folder(s). If you create something that references assets that are located outside of the shared hierarchy, the reference paths will be broken.

0 commit comments

Comments
 (0)