Modding:Asset System/en: Difference between revisions

From Vintage Story Wiki
Updating to match new version of source page
(Updating to match new version of source page)
 
(Updating to match new version of source page)
Line 1: Line 1:
{{GameVersion|1.12}}
<languages/>
{{GameVersion|1.15}}
__FORCETOC__
__FORCETOC__


Line 78: Line 79:
     <td>universal</td>
     <td>universal</td>
     <td>Contains the 3d models for all the items, blocks and creatures</td>
     <td>Contains the 3d models for all the items, blocks and creatures</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_dialog" data-tt-parent="root">config</div></td>
    <td>true</td>
    <td>universal</td>
    <td>Used for generic data that does not fit into the other categories.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 102: Line 97:
     <td>universal</td>
     <td>universal</td>
     <td>Shapes for items</td>
     <td>Shapes for items</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_dialog" data-tt-parent="root">config</div></td>
    <td>true</td>
    <td>universal</td>
    <td>Used for generic data that does not fit into the other categories.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 234: Line 235:
= Domains =
= 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 <code>game</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> for all its assets (game, survival and creative folders).


When [[Mod Packaging|packaging a mod]] you specify a domain by placing a directory inside the mod <code>assets</code> 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.
When [[Mod Packaging|packaging a mod]] you specify a domain by placing a directory inside the mod <code>assets</code> 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  <code>assets/textures/blocks/leather.png</code>, you would have add the prefix for the domain <code>game:assets/textures/blocks/leather.png</code>.
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  <code>block/leather</code> for <code>assets/survival/textures/block/leather.png</code>, you would have add the prefix for the domain <code>game:block/leather</code>.




Line 245: Line 246:
There are no limitations to the system. So you can overwrite assets from Vintagestory itself by using the <code>game</code> domain folder.
There are no limitations to the system. So you can overwrite assets from Vintagestory itself by using the <code>game</code> domain folder.


To overwrite the bed blocktype you can put your own json flie inside your mod zip archive with the following path: <code>assets/game/blocktypes/bed.json</code>. So Vintagestory will load your json file instead of the original one.
To overwrite the bed blocktype you can put your own json flie inside your mod zip archive with the following path: <code>assets/game/blocktypes/wood/bed.json</code>. 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.
Theme packs can only override assets that do not affect game mechanics, the other mod types can override any asset.


== Accessing assets in code ==  
== Accessing assets in code ==  
43,146

edits