Cultist Simulator

Cultist Simulator

Shelves
 This topic has been pinned, so it's probably important
[FR] Genroa  [developer] 30 Aug, 2023 @ 1:09am
How To Make custom Shelves
This section is mainly for modders, so I will assume you know how to make an empty new mod. If you don't, there is documentation to do that on the cultist simulator community server (but it's quite simple, no knowledge required). If you want to create your own shelves for personal use, just create a local mod for you. This section is also how modders of other mods can make shelves, if they think a custom one could be useful based on the new cards and mechanics their work introduces.

You can now define a new type of file, "shelves". Create one, and in it, for each new shelf you want to define, write a new object following this structure:
{ "id": "tools", "name": "Tools", "category": "tools", "rows": 1, "columns": 8, "expression": "tool", "rootCache": [ {"maxtoolheartamount": "[~/tabletop:tool:max/heart]"} ], "priority": 2, "background": "toolsshelf_bg", "style": "aligncenter", "areas": [ { "columns": 8, "expression": "[tool] && [root/maxtoolheartamount]" ... } ] }
  • id: unique id for your shelf
  • name: readable name, will be displayed in the settings (keep it very short)
  • category: optional. A value in the given list: tools, abilities, lore, influences, texts, vaults, followers, rites, influences, jobs, ways, reputation, ingredients, apostles, dancer, exile, ghoul, priest. If no category is provided or it isn't in this list, the shelf will be displayed in the "other" category.
  • rows: how many rows for the entire shelf. Optional, default value = 1
  • columns: how many columns for the entire shelf. Optional, default value = 1
  • expression: Optional. An expression describing what to move in the shelf. More on that below
  • rootCache: Optional. A list of objects, each declaring values to pre-compute before activating the areas of each shelf. Can be used to ask the game to pre-compute costly values used in several shelves. Objects in the list can define computed values relying on values computed in previous objects of the list. Shelves and area expressions can use these computed values by accessing them via root/computedvaluename. They are recomputed with each new stack action and are cleared before each new shelf activation. This feature was introduced to enable more complex shelves to be written without introducing too much of a performance hit by recomputing the same value several times. Computed values cannot store expressions to use as "sub-expressions", only integers.
  • priority: Optional, default value is 2. Ranges from 0 (lowest) to 4 (highest), higher priority shelves are called first to grab cards.
  • background: Optional. An image to display as a background
  • style: Optional. Default value = "aligncenter". Can be "stretch", "aligncenter", or "repeat"
  • areas: a list of areas for your shelf. It is an array of objects, each with the properties rows (=1 by default), columns (=1 by default), x (horizontal position, 1 by default), y (vertical position, 1 by default), background (optional), style ("aligncenter" by default), and expression.

For more informations about it, check the Roost Machine's documentation on its workshop page or on the fan community discord server (channel #modding).

Note: you can't define "half rows" or any kind of overlap yet. I'm working on that, no promises yet though.
Last edited by [FR] Genroa; 30 Aug, 2023 @ 1:09am