-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docs] Added info how to create a mod tilesheet using existing tools. (…
…#2272) * updated doc/summary - MD lint applied (tab size reduced) - Links to summary and general info for MSX and HM changed (see next commits) * updated doc/style/summary.md MD lint applied (tab size reduced) * HM readme file renamed - changed name for 'readme.md' file as its rendered version renamed to 'index.hmtl' which is inconsistent for links * MSX readme.md file renamed - changed name for 'readme.md' file as its rendered version renamed to 'index.html' which is inconsistent for links * changed letters case for summary files - now all files in lowercase * Create mod_tilesheet.md * Update mod_tilesheet.md * Added how-to create a mod tilesheet documentation and link to it
- Loading branch information
Showing
7 changed files
with
208 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
# Creating mod tilesheet using existing tools | ||
|
||
If you want to create a quite extended mod for CDDA and it'll be shipped separately from the main game you need a composed tilesheet. | ||
|
||
It is not a problem for mods with a couple of sprites, but if you have a lot of sprites better to use existing tools. | ||
|
||
## Creating a dummy tileset | ||
|
||
First of all you need to create a dummy tileset in the tileset repository and receiving folder in your game. | ||
|
||
- Create a `my_mod` folder under `CDDA-Tilesets\gfx` (tilesets repository) | ||
- Create a `my_mod` folder under `Cataclysm\gfx` (your game folder) | ||
|
||
Now you need to create some files in repository. | ||
Go to `CDDA-Tilesets\gfx\my_mod\` and create `tileset.txt` and add the following content: | ||
|
||
```txt | ||
#my_mod | ||
NAME: my_mod_name | ||
VIEW: my_mod_view | ||
JSON: tile_config.json | ||
TILESET: tiles.png | ||
``` | ||
|
||
As you can see name and view should be somehow related to your mod name, but actually they can be abything but existing tilesets names. | ||
|
||
Copy `fallback.png` from any other existing tileset into your `CDDA-Tilesets\gfx\my_mod\` folder. It is needed only to be checked once and you will delete it later. | ||
|
||
Lets assume that you have a number of sprites and sprites size are: x=32 and y=48. Put all of them into the folder and name this folder: `pngs_my_mod_sprites_32x48`. | ||
|
||
Now you need to create the final file: `tile_info.json` with following content: | ||
|
||
```json | ||
[ | ||
{ | ||
"pixelscale": 1, | ||
"width": 1, | ||
"height": 1 | ||
}, | ||
{ | ||
"my_mod_sprites.png": { "sprite_width": 32, "sprite_height": 48 } | ||
} | ||
] | ||
``` | ||
|
||
## Composing the "tileset" | ||
|
||
Use `updtset.cmd` tool as usual (you may refer to this [doc](../tools/windows_wrappers.md#composer)). Your new dummy tileset will appear in the list of source tilesets available for composing. | ||
|
||
If you did everything right you will get the composed tileset in your game directory `Cataclysm\gfx\my_mod`. | ||
|
||
You will get: | ||
| file | purpose | | ||
|--|--| | ||
| :bar_chart:fallback.png | to be deleted | | ||
| :bar_chart:my_mod_sprites.png | your composed tilesheet | | ||
| :memo:tile_config.json | you need to fix it a bit | | ||
| :memo:tileset.txt | to be deleted | | ||
|
||
Check my_mod_sprites.png - this file should contain all your sprites. | ||
|
||
## Fixing the json | ||
|
||
Resulting `tile_config.json` supposed to be for a full tileset, so you need to fix it first. Open it in any text editor, copy all content and past it here: [CDDA json linter](https://dev.narc.ro/cataclysm/format.html) and press "LINT" button below. | ||
|
||
Now this file content can be easily readable. You will get something like this: | ||
|
||
```json | ||
{ | ||
"tile_info": [ | ||
... | ||
], | ||
"tiles-new": [ | ||
{ | ||
"file": "my_mod_sprites.png", | ||
"//": "range from 1 to X", | ||
"sprite_width": 32, | ||
"sprite_height": 48, | ||
"sprite_offset_x": 0, | ||
"sprite_offset_y": 0, | ||
"tiles": [ | ||
... | ||
] | ||
}, | ||
{ | ||
"file": "fallback.png", | ||
"tiles": [], | ||
"ascii": [ | ||
... | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
You need to do the following: | ||
|
||
1) Remove `tile_info` section. | ||
2) Instead add the following content before `tiles-new` section: | ||
|
||
```json | ||
"type": "mod_tileset", | ||
"compatibility": [ | ||
"Chibi_Ultica", | ||
"MShockXottoPlus" | ||
], | ||
``` | ||
|
||
3) Remove comma between `my_mod_sprites` and `fallback` sections. | ||
4) Remove `fallback` section. Tileset will handle fallbacks. | ||
5) Wrap all text into square brackets `[ ]`. | ||
6) Fix offset values. In our demostration case `sprite_offset_y` will be `-16`. | ||
7) Be sure to include right tileset names into `compatibility`. | ||
|
||
You will get something like this: | ||
|
||
```json | ||
[ | ||
{ | ||
"type": "mod_tileset", | ||
"compatibility": [ | ||
"Chibi_Ultica", | ||
"MShockXottoPlus" | ||
], | ||
"tiles-new": [ | ||
{ | ||
"file": "my_mod_sprites.png", | ||
"//": "range from 1 to X", | ||
"sprite_width": 32, | ||
"sprite_height": 48, | ||
"sprite_offset_x": 0, | ||
"sprite_offset_y": -16, | ||
"tiles": [ | ||
... | ||
] | ||
} | ||
] | ||
} | ||
] | ||
``` | ||
|
||
Now you can use your mod tilesheet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
# HollowMoon style guide | ||
|
||
There are some guides: | ||
- [Summary guide](./readme.md) | ||
- Detailed guides | ||
- [Terrain](./terrain.md) | ||
- [Walls](./walls.md) | ||
- [Overlays](./overlay.md) | ||
|
||
- [Summary guide](./general.md) | ||
- Detailed guides | ||
- [Terrain](./terrain.md) | ||
- [Walls](./walls.md) | ||
- [Overlays](./overlay.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters