Modding:Content Tutorial Basics: Difference between revisions

From Vintage Story Wiki
Marked this version for translation
m (Correction of some details.)
(Marked this version for translation)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<!--T:1-->
{{GameVersion|1.19.4}}
{{GameVersion|1.19.4}}
__FORCETOC__
__FORCETOC__


<!--T:2-->
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 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.


== Shape Files ==
== Shape Files == <!--T:3-->
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.
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.


<!--T:4-->
When referencing a shape in a json file, you can use the following example property:<syntaxhighlight lang="json">
When referencing a shape in a json file, you can use the following example property:<syntaxhighlight lang="json">
"shape": {
"shape": {
Line 15: Line 18:
</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.
</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.


== Texture Files ==
== Texture Files == <!--T:5-->
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.
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.


<!--T:6-->
Textures are assigned on both shape files, and the block, item or entity file that is using them (''see Modifying Textures below)''.
Textures are assigned on both shape files, and the block, item or entity file that is using them (''see Modifying Textures below)''.


<!--T:7-->
The following property exists in our shape file:<syntaxhighlight lang="json">
The following property exists in our shape file:<syntaxhighlight lang="json">
"textures": {
"textures": {
Line 31: Line 36:
</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.
</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 ===
=== Modifying Textures === <!--T:8-->
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.
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.


<!--T:9-->
If our shape only has a single texture, we can use the following property within our block/item/entity:<syntaxhighlight lang="json">
If our shape only has a single texture, we can use the following property within our block/item/entity:<syntaxhighlight lang="json">
"texture": {
"texture": {
Line 45: Line 51:
</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.
</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.


<!--T:10-->
Remember that since we are not specifying a domain, the game will search for these textures within the mod's assets.
Remember that since we are not specifying a domain, the game will search for these textures within the mod's assets.


== Lang(uage) File ==
== Lang(uage) File == <!--T:11-->
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.  
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.  


<!--T:12-->
An example ''<nowiki/>'en.json''' lang file may look like this:<syntaxhighlight lang="json">
An example ''<nowiki/>'en.json''' lang file may look like this:<syntaxhighlight lang="json">
{
{
Line 57: Line 65:
</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''.''
</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? ==
== What's Next? == <!--T:13-->
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. {{Navbox/contentmodding}}
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}}
</translate>
Confirmedusers
613

edits