Skip to content

Add support for loading unpacked ZIPs #10

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

Merged
merged 4 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 43 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,34 @@ For detailed info, see the [docs for Delta-V Modding](https://gitlab.com/Delta-V

## Mod Setup

### Structure

Mod ZIPs should have the structure shown below. The name of the ZIP is arbitrary.

```
yourmod.zip
├───.import
└───mods-unpacked
└───Author-ModName
├───ModMain.gd
└───_meta.json
```

#### Notes on .import

Adding the .import directory is only needed when your mod adds content such as PNGs and sound files. In these cases, your mod's .import folder should **only** included your custom assets, and should not include any vanilla files.

You can copy your custom assets from your project's .import directory. They can be easily identified by sorting by date. To clean up unused files, it's helpful to delete everything in .import that's not vanilla, then run the game again, which will re-create only the files that are actually used.


### Required Files

Mods you create must have the following 2 files:

- **ModMain.gd** - The init file for your mod.
- **_meta.json** - Meta data for your mod (see below).

### Example _meta.json
#### Example _meta.json

```json
{
Expand All @@ -31,9 +53,9 @@ Mods you create must have the following 2 files:
}
```

#### Notes
#### Notes on meta.json

Some properties in the JSON are not checke din the code (ATOW), and are only used for reference by yourself and your mod's users. These are:
Some properties in the JSON are not checked in the code, and are only used for reference by yourself and your mod's users. These are:

- `version`
- `compatible_game_version`
Expand All @@ -54,7 +76,24 @@ Add a script that extends a vanilla script. `childScriptPath` is the path to you

Inside that extender script, it should include `extends {target}`, where {target} is the vanilla path, eg: `extends "res://singletons/utils.gd"`.

Note that your extender script doesn't have to follow the same directory path as the vanilla file, but it's good practice to do so.
Your extender scripts don't have to follow the same directory path as the vanilla file, but it's good practice to do so.

One approach to organising your extender scripts is to put them in a dedicated folder named "extensions", eg:

```
yourmod.zip
├───.import
└───mods-unpacked
└───Author-ModName
├───ModMain.gd
├───_meta.json
└───extensions
└───Any files that extend vanilla code can go here, eg:
├───main.gd
└───singletons
├───item_service.gd
└───debug_service.gd
```

### addTranslationFromResource

Expand Down
Loading