Modding:Basic Content Tutorials: Difference between revisions

From Vintage Story Wiki
(Created page - In Progress)
 
(Creation of page.)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
{{GameVersion|1.19.5}}
__FORCETOC__
__FORCETOC__


This page should give you a basic understanding of topics that may be used within the content tutorials. If there is ever a phrase or topic you are unsure about, it is recommended to check here first to see if it has an explanation.
This is the landing page for the basic content tutorials. These will cover the basic introduction of modding, including the definitions of shapes, textures, lang files, blocks, items, and recipes.


== Shape Files ==
== Basic Tutorials ==
A shape file is a '''3d model''' of a block, item, or entity. They are usually stored within the shapes folder in your mod's assets folder.


When referencing a shape in a json file, you can use the following example property:<syntaxhighlight lang="json">
# [[Modding:Content Tutorial Basics|Content Essentials]] - This gives an understand of various topics used throughout the basic content mods.
"shape": {
# [[Modding:Content Tutorial Simple Item|Simple Item Tutorial]] - Here you will create an item. This will introduce you to using shape, texture, and lang files.
    "base": "item/simplewand"
# [[Modding:Content Tutorial Simple Block|Simple Block Tutorial]] - Here you will create a block with different properties. You will also use texture and lang files here.
  },
# [[Modding:Content Tutorial Simple Recipe|Simple Recipes Tutorial]] - Here you will create new recipes for the above item and block.
</syntaxhighlight>Note that the value automatically looks in your mod folder, unless a domain is provided. In this case for the example mod, the path to the shape is "''assets/examplecontentmod/shapes/item/simplewand.json''". You do not need to provide the full path, nor do you need to provide the file type.
</translate>{{Navbox/contentmodding}}
 
== Texture Files ==
A texture file is a '''2d image''' for a block, item, or entity. Textures are [https://www.youtube.com/watch?v=Yx2JNbv8Kpg ''mapped'' onto shape files using UVs], allowing us to use different textures without having to create new shape files.
 
Textures are assigned on both shape files, and the block, item or entity file that is using them (''see Modifying Textures below)''.
 
The following property exists in our shape file:<syntaxhighlight lang="json">
"textures": {
"base": "item/simplewand"
}
</syntaxhighlight>Note that we can use multiple textures in a single shape file:<syntaxhighlight lang="json">
"textures": {
"head": "item/wand-blue",
"handle": "item/wand-handle"
}
</syntaxhighlight>In the '<nowiki/>''textures''<nowiki/>' block, we have a list of keys and values. The key refers to the name of the texture inside the shape file, and the value refers to the file path of the texture. In the first instance, similar to when we reference our shape file, the game will search in our mod's texture folder as no domain was given. In this case for the example mod, the path is "''assets/examplecontentmod/textures/item/simplewand.png''". Note again that you do not need to provide the full path or provide the file type.
 
=== Modifying Textures ===
Textures can not only be set within a shape file, but can also be set within the block, item or entity using the shape file.
 
If our shape only has a single texture, we can use the following property within our block/item/entity:<syntaxhighlight lang="json">
"texture": {
    "base": "item/simplewand"
}
</syntaxhighlight>Note that the above is '''texture''', not '''textures'''. Also note that when using a single texture, the key is always "base", regardless of the texture name in the shape file. To change multiple textures in a block/item/entity, use the following:<syntaxhighlight lang="json">
"textures": {
    "head": { "base": "item/wand-blue" },
    "handle": { "base": "item/wand-handle" }
},
</syntaxhighlight>Note that as we are changing multiple textures, we use '''textures'''. Also note that "''head''" and ''"handle''" match with the textures we are changing in the shape file.
 
Remember that since we are not specifying a domain, the game will search for these textures within the mod's assets.
 
== Lang(uage) File ==
A lang file is a '''list of translations''' for a mod. To ensure that mods can be easily translated, the game automatically creates one or more translation keys for each asset. These keys are based on the asset code and type.  
 
An example ''<nowiki/>'en.json''' lang file may look like this:<syntaxhighlight lang="json">
{
"block-simplyshinyblock": "(Example Mod) Simple Gold Block",
"item-simplewand": "(Example Mod) Simple Wand"
}
</syntaxhighlight>Each 'key' matches to a string that affects how the item or block is named in game. Note that there are many available languages in Vintage Story, and these can be found in the base''"assets/game/lang/languages.json"'' file''.''
 
== What's Next? ==
Now you have an understanding of these topics, it is a good idea to move onto the [[Modding:Content Tutorial Simple Item|first tutorial]], where you will create your first item. </translate>{{Navbox/contentmodding}}

Revision as of 22:29, 24 March 2024

Other languages:
  • English


This is the landing page for the basic content tutorials. These will cover the basic introduction of modding, including the definitions of shapes, textures, lang files, blocks, items, and recipes.

Basic Tutorials

  1. Content Essentials - This gives an understand of various topics used throughout the basic content mods.
  2. Simple Item Tutorial - Here you will create an item. This will introduce you to using shape, texture, and lang files.
  3. Simple Block Tutorial - Here you will create a block with different properties. You will also use texture and lang files here.
  4. Simple Recipes Tutorial - Here you will create new recipes for the above item and block.
Content Modding
Basics Content Mods Developing a Content Mod
Tutorials
Concepts Modding Concepts Variants Domains Patching Remapping World Properties
Uncategorized
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.

Modding
Modding Introduction Getting Started Theme Pack
Content Modding Content Mods Developing a Content Mod Basic Tutorials Intermediate Tutorials Advanced Tutorials Content Mod Concepts
Code Modding Code Mods Setting up your Development Environment
Property Overview ItemEntityBlockBlock BehaviorsBlock ClassesBlock EntitiesBlock Entity BehaviorsWorld properties
Workflows & Infrastructure Modding Efficiency TipsMod-engine compatibilityMod ExtensibilityVS Engine
Additional Resources Community Resources Modding API Updates Programming Languages List of server commandsList of client commandsClient startup parametersServer startup parameters
Example ModsAPI DocsGitHub Repository