Modding:Developing a Content Mod: Difference between revisions

From Vintage Story Wiki
Marked this version for translation
m (Updated navbox to new content navbox.)
(Marked this version for translation)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<languages/><translate>
<languages/>
<!--T:1-->
{{GameVersion|1.19.4}}
{{GameVersion|1.19.4}}
__TOC__
__TOC__


<translate>
<!--T:2-->
<!--T:2-->
Developing a content mod can be simple, but certain files and folders need to be setup correctly. For more information on what can be achieved with a content mod, see [[Modding:Content Mods|Content Mods]].
Developing a content mod can be simple, but certain files and folders need to be setup correctly. For more information on what can be achieved with a content mod, see [[Modding:Content Mods|Content Mods]].


== Selecting an IDE == <!--T:3-->
== Selecting an IDE == <!--T:3-->
<!--T:30-->
When creating a content mod, you will likely be using a lot of JSON files. Although JSON is a human-readable format, it can still be beneficial to equip yourself with an '''Integrated Development Environment''' (IDE). Simply put, for the purpose of modifying JSON files, an IDE works as a fancy text editor that helps with formatting.
When creating a content mod, you will likely be using a lot of JSON files. Although JSON is a human-readable format, it can still be beneficial to equip yourself with an '''Integrated Development Environment''' (IDE). Simply put, for the purpose of modifying JSON files, an IDE works as a fancy text editor that helps with formatting.


<!--T:4-->
<!--T:4-->
It is recommended to select from one of the IDEs below.
It is recommended to select from one of the IDEs below.
<!--T:31-->
{| class="wikitable sortable"
{| class="wikitable sortable"
!Name
!Name
Line 39: Line 43:
|}
|}


== Template/Example Mod Setup ==<!--T:6-->
== Template/Example Mod Setup == <!--T:6-->
 
<!--T:32-->
If you want to get into modding and do not wish to manually setup your folders, there are two options. The ''template'' file contains a modinfo, modicon, and folder structure for your mod. The ''example'' file is identical, however contains a number of existing assets which are used within the wiki's tutorials. Both files can be found and downloaded [https://github.com/Nateonus/vsmodexamples/releases/latest from GitHub]. Simply unzip them into your game's mod folder.  
If you want to get into modding and do not wish to manually setup your folders, there are two options. The ''template'' file contains a modinfo, modicon, and folder structure for your mod. The ''example'' file is identical, however contains a number of existing assets which are used within the wiki's tutorials. Both files can be found and downloaded [https://github.com/Nateonus/vsmodexamples/releases/latest from GitHub]. Simply unzip them into your game's mod folder.  


== Manual Mod Setup ==<!--T:7-->
== Manual Mod Setup == <!--T:7-->
 
<!--T:33-->
If you wish to setup a content mod on your own, or want more understanding of the files, follow the instructions below.  
If you wish to setup a content mod on your own, or want more understanding of the files, follow the instructions below.  


=== Mod Workspace ===<!--T:8-->
=== Mod Workspace === <!--T:8-->
 
<!--T:34-->
To start setting up your mod, navigate to your Vintage Story install location, and enter the mods folder. Create a new folder with your mod's name - This will be where all mod-related files will be placed. It is recommended to open this folder in your selected IDE.
To start setting up your mod, navigate to your Vintage Story install location, and enter the mods folder. Create a new folder with your mod's name - This will be where all mod-related files will be placed. It is recommended to open this folder in your selected IDE.


Line 51: Line 61:
'''Note that creating JSON files may require changing file extensions. If you do not know how to do this, [https://www.indeed.com/career-advice/career-development/how-to-change-file-type follow these instructions].'''
'''Note that creating JSON files may require changing file extensions. If you do not know how to do this, [https://www.indeed.com/career-advice/career-development/how-to-change-file-type follow these instructions].'''


=== ModInfo.json ===<!--T:10-->
=== ModInfo.json === <!--T:10-->
For your mod to successfully load, you have to tell Vintage Story that our mod exists, as well as some details about it. To do this, create a new file called '<nowiki/>''modinfo.json''' inside your mod workspace folder, either using your IDE or through Windows. Note that this cannot be created in a subfolder - It must be inside the root mod workspace folder. Open the file, and paste the following json code:<syntaxhighlight lang="json">
 
<!--T:35-->
For your mod to successfully load, you have to tell Vintage Story that our mod exists, as well as some details about it. To do this, create a new file called '<nowiki/>''modinfo.json''' inside your mod workspace folder, either using your IDE or through Windows. Note that this cannot be created in a subfolder - It must be inside the root mod workspace folder. Open the file, and paste the following json code:
 
<!--T:36-->
<syntaxhighlight lang="json">
{
{
   "type": "content",
   "type": "content",
Line 63: Line 78:
   "version": "1.0.0"
   "version": "1.0.0"
}
}
</syntaxhighlight>This file is a very good example of how a json file is formatted, and you will notice that nearly every asset uses this file format. Json files list a set of "key": "value" entries, allowing you to change those values to fit what is desired. In this case, the following keys represent:
</syntaxhighlight>
 
<!--T:37-->
This file is a very good example of how a json file is formatted, and you will notice that nearly every asset uses this file format. Json files list a set of "key": "value" entries, allowing you to change those values to fit what is desired. In this case, the following keys represent:


<!--T:11-->
<!--T:11-->
Line 82: Line 100:
This is just a basic modinfo file. For more information, and a more comprehensive list of available properties, visit the [[Modinfo]] page.
This is just a basic modinfo file. For more information, and a more comprehensive list of available properties, visit the [[Modinfo]] page.


=== Modicon.png ===<!--T:15-->
=== Modicon.png === <!--T:15-->
 
<!--T:38-->
If desired, an image file called '<nowiki/>''modicon.png''' can be placed or created inside the root folder of your mod workspace. This will automatically be loaded into Vintage Story, and be displayed next to your mod on the mod manager menu.
If desired, an image file called '<nowiki/>''modicon.png''' can be placed or created inside the root folder of your mod workspace. This will automatically be loaded into Vintage Story, and be displayed next to your mod on the mod manager menu.


=== Assets Folder ===<!--T:16-->
=== Assets Folder === <!--T:16-->
 
<!--T:39-->
To actually create and modify game assets, Vintage Story searches for specific filepaths. Inside your mod workspace, create a folder called '''assets''<nowiki/>'.
To actually create and modify game assets, Vintage Story searches for specific filepaths. Inside your mod workspace, create a folder called '''assets''<nowiki/>'.


Line 95: Line 117:


== Mod Domains == <!--T:19-->
== Mod Domains == <!--T:19-->
<!--T:40-->
Each subfolder inside your mod's root assets folder dictates a mod ''domain.'' A domain works as an identifier to seperate assets from multiple mods, and must be made up of lowercase letters and numbers.
Each subfolder inside your mod's root assets folder dictates a mod ''domain.'' A domain works as an identifier to seperate assets from multiple mods, and must be made up of lowercase letters and numbers.


Line 110: Line 134:


== Publishing a Content Mod == <!--T:24-->
== Publishing a Content Mod == <!--T:24-->
<!--T:41-->
If you want to distribute your mod for others to play, it is a good idea to pack your mod into a zip file. Most operating systems include functionality to zip a set of files, but the [https://www.7-zip.org/download.html 7-zip program] is a good alternative to this.
If you want to distribute your mod for others to play, it is a good idea to pack your mod into a zip file. Most operating systems include functionality to zip a set of files, but the [https://www.7-zip.org/download.html 7-zip program] is a good alternative to this.


Line 115: Line 141:
To pack your mod on Windows, select your modinfo, modicon, and assets folder, and right click on one of the files. In the context window, hover over "Send to", and then select "''Compressed (zipped) folder''". When entering a name for your zip file, most mods follow the format of "''modid-version".'' This allows users of your mod to easily differentiate between versions of your created mod.
To pack your mod on Windows, select your modinfo, modicon, and assets folder, and right click on one of the files. In the context window, hover over "Send to", and then select "''Compressed (zipped) folder''". When entering a name for your zip file, most mods follow the format of "''modid-version".'' This allows users of your mod to easily differentiate between versions of your created mod.


<!--T:42-->
[https://copyrightservice.co.uk/reg/creating-zip-files This article] gives information on how to zip a set of files on other operating systems.
[https://copyrightservice.co.uk/reg/creating-zip-files This article] gives information on how to zip a set of files on other operating systems.


Line 124: Line 151:


== Updating a Content Mod to a new Game Version == <!--T:28-->
== Updating a Content Mod to a new Game Version == <!--T:28-->
<!--T:43-->
When Vintage Story updates, it is highly unlikely that your content mod will need modifying. When a new major version is released, there may be rare instances where some formatting changes can cause side-effects, however these are very rare and would mainly happen when using more complex functionality.
When Vintage Story updates, it is highly unlikely that your content mod will need modifying. When a new major version is released, there may be rare instances where some formatting changes can cause side-effects, however these are very rare and would mainly happen when using more complex functionality.


== What's Next? == <!--T:29-->
== What's Next? == <!--T:29-->
<!--T:44-->
Now your content mod has been setup, see what's next on the [[Modding:Content Mods#Following the Wiki Tutorials|Content Mod]] page.
Now your content mod has been setup, see what's next on the [[Modding:Content Mods#Following the Wiki Tutorials|Content Mod]] page.
</translate>
{{Navbox/contentmodding}}
{{Navbox/contentmodding}}
</translate>
Confirmedusers
1,783

edits