Modding:Asset System

From Vintage Story Wiki
Revision as of 15:57, 6 October 2018 by Tyron (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Vintage Story loads most of its game content from so called assets. Those can be found inside the assets directory inside your Vintagestory folder. Things such as blocks, items, world generation, recipes, etc. are all loaded from assets during startup.

These assets are easily modifiable and using the integrated mod system you can easily add your own stuff without having to mess with coding. You can also read some examples to learn about what you can do with it.

Categories

Here is an overview of categories:

Name Affects Gameplay Side Type Usage
AssetCategory
blocktypes
true universal Defines all the blocks that are in the game
itemtypes
true universal Defines all the Items that are in the game
lang
false universal Translation
worldproperties
true universal Contains some commonly used lists of properties
abstract
true universal
block
true universal
sounds
false universal Sounds
shapes
false universal Contains the 3d models for all the items, blocks and creatures
block
false universal Shapes for blocks
entity
false universal Shapes for entities
item
false universal Shapes for items
recipes
true server only The crafting, knapping, smithing and clay forming recipes
alloy
true server only How metals can be combined to create alloys
grid
true server only Recipes for 3x3 grid crafting
smithing
true server only Recipes for smithing on the anvil
worldgen
true server only Contains all the configuration for world generation
terrain
true server only Defines how the terrain should look and with what it should be decorated with
tree
true server only Defines the shapes of trees
entity
true server only Creatures and other entities
shaders
false client only Contains GLSL source code, that defines how the game is rendered
shaderincludes
false client only Contains GLSL source code, that defines how the game is rendered
textures
false client only Contains all the graphics of the game
block
false client only Block textures
item
false client only Item textures
decal
false client only Decaltextures
entities
false client only Entities textures
environment
false client only Environment textures (Sky, Moon, Sun, etc.)
gui
false client only Gui textures
hud
false client only Hud textures
particle
false client only Particle textures
music
false client only The games music tracks and its configuration
dialog
false client only Contains some of the dialog layouts


Domains

Domains are used to separate mod added content from the original one. Basically a domain is a prefix for any given code (identifier for item, block, etc.) or path (textures, sounds, etc.). VintageStory itself has its own prefix game.

When packaging a mod you specify a domain by placing a directory inside the mod assets directory with all your mod assets inside. The name of your domain directory will be the "current domain" for all assets inside it. If no domain has been specified in an asset code the game will assume it is in the current domain, meaning you only have to add a domain prefix if you want to refer to something outside the current domain.

For example, if you want to create a new block which uses the original leather texture, you would have to specify the domain (since your block has a different one). Instead of using assets/textures/blocks/leather.png, you would have add the prefix for the domain game:assets/textures/blocks/leather.png.


Overwriting assets

There are no limitations to the system. So you can overwrite assets from Vintagestory itself by using the game domain folder.

To overwrite the bed blocktype you can put your own json flie inside your mod zip archive with the following path: assets/game/blocktypes/bed.json. So Vintagestory will load your json file instead of the original one.

Theme packs can only override assets that do not effect game mechanics, the other mod types can override any asset.

Icon Sign.png

Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.