From e936e1ffb078647c5c50beeb90fa075e425bb7e0 Mon Sep 17 00:00:00 2001 From: CuriousTorvald Date: Tue, 13 Sep 2022 23:08:41 +0900 Subject: [PATCH] Updated Modules:Setup (markdown) --- Modules:Setup.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Modules:Setup.md b/Modules:Setup.md index 4917606..8be255e 100644 --- a/Modules:Setup.md +++ b/Modules:Setup.md @@ -4,7 +4,7 @@ Every module must be able to introduce themselves through the `metadata.properti The metadata file is a standard-issue Java properties file with some required keys. ### metadata.properties -A metadata must have following keys: +A metadata must have the following keys: - **propername** — the displayed name of the module - **description** — a short text describing the module @@ -19,12 +19,12 @@ A metadata must have following keys: ### Dependency Format -The dependency string has following syntax: +The dependency string has the following syntax: - `module_name version` - `module1 version;module2 version` - `module1 version;module2 version;module3 version; ...` -The version string has following syntax: +The version string has the following syntax: - `a.b.c` — the exact version a.b.c - `a.b.c+` — Any version between a.b.c and a.b.65535 - `a.b.*` — Any version between a.b.0 and a.b.65535 @@ -35,7 +35,7 @@ The version string has following syntax: For example, if your module requires `basegame` 0.3 or higher, the dependency string will be `basegame 0.3+`. - Why can't I specify the `+` sign on the major version number? - - The change on the major version number denotes incompatible API changes and therefore you're expected to investigate the changes, test if your module still works, and then manually update your module to ensure the end user that your module is still operational with the new version of the dependency. + - The change on the major version number denotes incompatible API changes, and therefore you're expected to investigate the changes, test if your module still works, and then manually update your module to ensure the end user that your module is still operational with the new version of the dependency. ### icon.png A module can have an icon about themselves. The image must be sized 48x48 and in 32-bit colour PNG format. @@ -47,19 +47,19 @@ A module may have one Jar file. Two or more Jars are not allowed: if your module Except for the [[retextures|Modules:Retextures]], there are *technically* no strict directory structure required, certain ingame elements loaded by the engine expects certain paths. ### Entry Point -If your module has a Jar file, it must have a single class that extends `net.torvald.terrarum.ModuleEntryPoint`: such class is called a Entry Point. The Entry Point initialises and installs your module to the game. What the Entry Point does to load your module depends up to you, but the engine provides the **Modmgr** for installing ingame elements to the game. +If your module has a Jar file, it must have a single class that extends `net.torvald.terrarum.ModuleEntryPoint`: such class is called an Entry Point. The Entry Point initialises and installs your module to the game. What the Entry Point does to load your module depends on you, but the engine provides the **Modmgr** for installing ingame elements to the game. ### The Modmgr The Modmgr provides the functions to load the following ingame elements: - ModMgr.**GameBlockLoader** — loads the blocks and wires - ModMgr.**GameItemLoader** — loads the items -- ModMgr.**GameMaterialLoader** — loads the materials that accompany with the blocks and items +- ModMgr.**GameMaterialLoader** — loads the materials that come with the blocks and items - ModMgr.**GameLanguageLoader** — loads the text translations - ModMgr.**GameRetextureLoader** — loads the retextures - ModMgr.**GameCraftingRecipeLoader** — loads the crafting recipes -The Modmgr will load the blocks/items, assign them the Itme IDs, and register them to their respective *Codex*. +The Modmgr will load the blocks/items, assign them the Item IDs, and register them to their respective *Codex*. #### GameBlockLoader @@ -91,7 +91,7 @@ Every block's property is defined on the csv file with following columns: - solid: Whether the file has full collision (0/1) - plat: Whether the block should behave like a platform (0/1) - wall: Whether the block can be used as a wall (0/1) -- grav: Whether the block should fall through the empty space. N/A to not make it fall; 0 to fall immediately (e.g. Sand), nonzero to indicate that number of floating blocks can be supported (e.g. Scaffolding) +- grav: Whether the block should fall through the empty space. N/A to not make it fall; 0 to fall immediately (e.g. Sand), non-zero to indicate that number of floating blocks can be supported (e.g. Scaffolding) - dlfn: Dynamic Light Function. 0=Static. Please see notes - fv: Vertical friction when player slide on the cliff. 0 means not slide-able - fr: Horizontal friction. <16:slippery; 16:regular; >16:sticky @@ -109,20 +109,20 @@ Notes on `dlfn`: Block spritesheet must be one of following sizes (assuming global TILE_SIZE of 16): 16x16, 64x16, 128x16, 112x112, 224x224. Different sheet size denotes different format of the sheet. -- 16x16: Just a single tile. No autotiling and other tiles won't connect to it. -- 64x16: A "wall sticker". Used by torches. Indices: free-floating, stuck-on-left, stuck-on-right, stuck-on-bottom -- 128x16: A "platforms". Used by platforms. Indices: middle, right-end, left-end, stuck-on-left-middle, stuck-on-left-end, stuck-on-right-middle, stuck-on-right-end, single-piece +- 16x16: Just a single tile. No autotiling will be performed, and the other tiles won't connect to it. +- 64x16: A "wall sticker". Used by torches. Indices: free-floating, planted-on-left, planted-on-right, planted-on-bottom +- 128x16: A "platforms". Used by platforms. Indices: middle, right-end, left-end, planted-on-left-middle, planted-on-left-end, planted-on-right-middle, planted-on-right-end, single-piece - 112x112: The full autotiling. -![If this image does not load, please look at the ingame asset located on assets/mods/basegame/blocks/33.tga](autotiling1.png) +![(if this image does not load, please look at the ingame asset located on assets/mods/basegame/blocks/33.tga)](autotiling1.png) - The "empty" tile at the (6,5) work as a "barcode" to assign properties. Each row on the square encodes a number in binary: pixel plotted = 1 - Topmost row: the connection type - …0000—connect mutually (every tile tagged as 0 will connect to each other); …0001—connect to self - Second row: the mask type - …0010—use the autotiling (this row is reserved for future expansion; for now just mark it accordingly) -- 224x224: Same as 112x112 but has seasonal variations. On render, colours from the current and the next seasons will be blended according to the ingame calender time. - - Top-left—spring; Top-right—summer; Bottom-right—autumn; Bottom-left—winter +- 224x224: Same as 112x112, but has seasonal variations. On render, colours from the current and the next seasons will be blended according to the ingame calendar time. + - Top left—summer; Top right—autumn; Bottom right—winter; Bottom left—spring #### GameItemLoader