Modding:Asset System: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
(47 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__FORCETOC__
Vintage Story loads most of its game content from so called assets. Those can be found inside the <code>assets</code> directory inside your [[Vintagestory folder]]. Things such as blocks, items, world generation, recipes, etc. are all loaded from assets during startup.


= Asset System =
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 [[Basic Modding Examples|examples]] to learn about what you can do with it.
 
Vintage Story loads most of its game content from the assets. Things such as blocks, items, world generation, recipes, etc. are all loaded from the assets during startup. You can find those in your [[VintageStory folder]]. Those are easily modifiable and can be expanded further.


== Categories ==
== Categories ==


Here is an overview of categories:
Here is an overview of categories:
<table id="treeviewtable" class="table table-bordered tt-table" style='table-layout: fixed'>
  <tr style=''>
    <th width='300' align='left'>Name</th>
    <th width='200' align='left'>Affects Gameplay</th>
    <th width='80' align='left'>Side Type</th>
    <th align='left'>Usage</th>
  </tr>
  <tr>
    <td><div class="tt" data-tt-id="root">AssetCategory</div></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_blocktypes" data-tt-parent="root">blocktypes</div></td>
    <td>true</td>
    <td>universal</td>
    <td>Defines all the blocks that are in the game</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_itemtypes" data-tt-parent="root">itemtypes</div></td>
    <td>true</td>
    <td>universal</td>
    <td>Defines all the Items that are in the game</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_lang" data-tt-parent="root">lang</div></td>
    <td>false</td>
    <td>universal</td>
    <td>Translation</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_worldproperties" data-tt-parent="root">worldproperties</div></td>
    <td>true</td>
    <td>universal</td>
    <td>Contains some commonly used lists of properties</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_worldproperties_abstract" data-tt-parent="p_worldproperties">abstract</div></td>
    <td>true</td>
    <td>universal</td>
    <td></td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_worldproperties_block" data-tt-parent="p_worldproperties">block</div></td>
    <td>true</td>
    <td>universal</td>
    <td></td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_sounds" data-tt-parent="root">sounds</div></td>
    <td>false</td>
    <td>universal</td>
    <td>Sounds</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_shapes" data-tt-parent="root">shapes</div></td>
    <td>false</td>
    <td>universal</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_shapes_block" data-tt-parent="p_shapes">block</div></td>
    <td>false</td>
    <td>universal</td>
    <td>Shapes for blocks</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_shapes_entity" data-tt-parent="p_shapes">entity</div></td>
    <td>false</td>
    <td>universal</td>
    <td>Shapes for entities</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_shapes_item" data-tt-parent="p_shapes">item</div></td>
    <td>false</td>
    <td>universal</td>
    <td>Shapes for items</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_recipes" data-tt-parent="root">recipes</div></td>
    <td>true</td>
    <td>server only</td>
    <td>The crafting, knapping, smithing and clay forming recipes</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_recipes_alloy" data-tt-parent="p_recipes">alloy</div></td>
    <td>true</td>
    <td>server only</td>
    <td>How metals can be combined to create alloys</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_recipes_grid" data-tt-parent="p_recipes">grid</div></td>
    <td>true</td>
    <td>server only</td>
    <td>Recipes for 3x3 grid crafting</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_recipes_smithing" data-tt-parent="p_recipes">smithing</div></td>
    <td>true</td>
    <td>server only</td>
    <td>Recipes for smithing on the anvil</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_worldgen" data-tt-parent="root">worldgen</div></td>
    <td>true</td>
    <td>server only</td>
    <td>Contains all the configuration for world generation</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_worldgen_terrain" data-tt-parent="p_worldgen">terrain</div></td>
    <td>true</td>
    <td>server only</td>
    <td>Defines how the terrain should look and with what it should be decorated with</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_worldgen_tree" data-tt-parent="p_worldgen">tree</div></td>
    <td>true</td>
    <td>server only</td>
    <td>Defines the shapes of trees</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_entity" data-tt-parent="root">entity</div></td>
    <td>true</td>
    <td>server only</td>
    <td>Creatures and other entities</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_shaders" data-tt-parent="root">shaders</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Contains GLSL source code, that defines how the game is rendered</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_shaderincludes" data-tt-parent="root">shaderincludes</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Contains GLSL source code, that defines how the game is rendered</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures" data-tt-parent="root">textures</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Contains all the graphics of the game</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures_blocks" data-tt-parent="p_textures">block</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Block textures</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures_items" data-tt-parent="p_textures">item</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Item textures</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures_decal" data-tt-parent="p_textures">decal</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Decaltextures</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures_entities" data-tt-parent="p_textures">entities</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Entities textures</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures_environment" data-tt-parent="p_textures">environment</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Environment textures (Sky, Moon, Sun, etc.)</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures_gui" data-tt-parent="p_textures">gui</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Gui textures</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures_hud" data-tt-parent="p_textures">hud</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Hud textures</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures_particle" data-tt-parent="p_textures">particle</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Particle textures</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_music" data-tt-parent="root">music</div></td>
    <td>false</td>
    <td>client only</td>
    <td>The games music tracks and its configuration</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_dialog" data-tt-parent="root">dialog</div></td>
    <td>false</td>
    <td>client only</td>
    <td>Contains some of the dialog layouts</td>
  </tr>
</table>


= Domains =
= Domains =


== Game Domain ==
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>.


== Other Domains ==
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.


== Where are they used? ==
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>.


= Mods =


== Creating your own domain ==
== Overwriting assets ==


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


= Resourcepacks =
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.


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


== Install a resourcepack ==
{{Navbox/modding|Vintage Story}}
Confirmedusers, Bureaucrats, editor, Administrators
1,778

edits