Modding:Asset System: Difference between revisions

From Vintage Story Wiki
Line 213: Line 213:
= Domains =
= Domains =


In order to tell whether a block (can also be an item or entity) is added bythe game or a mod, VintageStory uses Domains. Those are prefixes for any path. For example any assets added by VintageStory it will have the prefix <code>game</code>. Meaning the textures inside <code>assets/textures/blocks/randomtexture.png</code> will have an AssetLocation (domain and path combined) of <code>game:assets/textures/blocks/randomtexture.png</code>.
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 <code>game</code>.
 
So if you want to create a new block to game, which uses the original leather texture, you would have to specify the domain (since your block has a different one). So instead of using  <code>assets/textures/blocks/leather.png</code>, you would have add the prefix for the domain <code>game:assets/textures/blocks/leather.png</code>.
 
If no domain has been specified it will refer to the current domain. Meaning you only have to add a domain prefix if you want to refer to something outside the current domain.


= Mods =
= Mods =
Confirmedusers, editor, Administrators
886

edits