mods:classes
Differences
This shows you the differences between two versions of the page.
| mods:classes [2023/03/10 19:32] – created superuser | mods:classes [2024/01/06 14:58] (current) – [Module] superuser | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Game Classes ====== | ||
| + | ===== Item ===== | ||
| + | Item for inventory. | ||
| + | ^ Parameter ^ Type ^ Description ^ | ||
| + | | name | string | Item name. Must be unique | | ||
| + | | cost | number | price of item | | ||
| + | | descr | string | item description | | ||
| + | | icon | string / [[# | ||
| + | | trade | boolean | whether the item can be traded | | ||
| + | | buy | boolean | can sell/buy item | | ||
| + | | hidden | boolean | if " | ||
| + | | shop | " | ||
| + | | ptr | boolean | If '' | ||
| + | |||
| + | ===== Outfit ===== | ||
| + | Item for the inventory + an item of clothing for the character. | ||
| + | |||
| + | Parameters are the same as [[# | ||
| + | |||
| + | ^ Parameter ^ Type ^ Description ^ | ||
| + | | char | " | ||
| + | | layer | string | the name of the layer on which to place the image of the clothes. It is also the name of the folder where the image is located. | | ||
| + | | val | string | the name of the image without the .webp extension which is in the '' | ||
| + | | lust | number | What level of depravity is required to wear the item | | ||
| + | |||
| + | ===== KTCharInventoryPreview ===== | ||
| + | The icon of the item with the clothing. | ||
| + | |||
| + | ^ Parameter ^ Type ^ Description ^ | ||
| + | | char_name | string | name of the character the item is for | | ||
| + | | layers | (string, string)[] | List of layers that are applied over the character | | ||
| + | | crop | (number, number, number, number) | How to crop an image | | ||
| + | |||
| + | **Example** | ||
| + | <code python> | ||
| + | KTCharInventoryPreview( | ||
| + | char_name=" | ||
| + | layers=[ | ||
| + | (" | ||
| + | (" | ||
| + | (" | ||
| + | (" | ||
| + | ], | ||
| + | crop=(0, 336, 600, 600), | ||
| + | ) | ||
| + | </ | ||
| + | |||
| + | In order to write a complete list of layers for each item, there are pre-made lists that you can use. | ||
| + | |||
| + | <code python> | ||
| + | ino_preview_nude_layers = [ | ||
| + | (' | ||
| + | (' | ||
| + | (' | ||
| + | (' | ||
| + | (' | ||
| + | (' | ||
| + | ] | ||
| + | |||
| + | ino_preview_layers = ino_preview_nude_layers + [ | ||
| + | (' | ||
| + | (' | ||
| + | ] | ||
| + | |||
| + | sakura_preview_layers = [ | ||
| + | (' | ||
| + | (' | ||
| + | (' | ||
| + | (' | ||
| + | (' | ||
| + | (' | ||
| + | ] | ||
| + | |||
| + | hinata_preview_layers = [ | ||
| + | (' | ||
| + | (' | ||
| + | (' | ||
| + | ] | ||
| + | </ | ||
| + | |||
| + | An example of how to use the list. | ||
| + | <code python> | ||
| + | KTCharInventoryPreview( | ||
| + | char_name=" | ||
| + | layers=hinata_preview_layers + [(" | ||
| + | crop=(0, 336, 600, 600), | ||
| + | ) | ||
| + | </ | ||
| + | |||
| + | There are also predefined cropping options for previews. | ||
| + | <code python> | ||
| + | ino_top_inv_preview = (149, 329, 303, 303) | ||
| + | ino_bottom_inv_preview = (149, 668, 303, 303) | ||
| + | ino_costume_inv_preview = (0, 336, 600, 600) | ||
| + | |||
| + | ino_face_inv_preview = (149, 130, 303, 303) | ||
| + | hinata_face_inv_preview = (149, 100, 303, 303) | ||
| + | sakura_face_inv_preview = (180, 170, 303, 303) | ||
| + | |||
| + | sakura_top_inv_preview = (180, 350, 303, 303) | ||
| + | </ | ||
| + | |||
| + | ===== Module ===== | ||
| + | Module for interaction with the game. | ||
| + | |||
| + | ^ Static parameters ^ Type ^ Description ^ | ||
| + | | id | string | module id. Must be unique. | | ||
| + | | subscribe_on_events | string[] | list of events to which the module should subscribe. See [[mods: | ||
| + | |||
| + | ^ Function name ^ Arguments ^ Description ^ | ||
| + | | on_init | | Called once when starting the game (new or loading a save) | | ||
| + | | on_event | event | Called when the event to which the module is subscribed occurs | | ||