Confirmedusers, Bureaucrats, editor, Administrators
1,779
edits
(Added info about loading bare DLLs) |
No edit summary |
||
(14 intermediate revisions by 4 users not shown) | |||
Line 3: | Line 3: | ||
To make your mod easy to install and use, it should be packed into a [https://en.wikipedia.org/wiki/Zip_(file_format) zip file]. Any assets (images, .json files, etc) go in a "assets" directory in the root of the zip, any C# DLLs (and optionally, PDB files) go directly into the zip file root as well. | To make your mod easy to install and use, it should be packed into a [https://en.wikipedia.org/wiki/Zip_(file_format) zip file]. Any assets (images, .json files, etc) go in a "assets" directory in the root of the zip, any C# DLLs (and optionally, PDB files) go directly into the zip file root as well. | ||
Please note that if you have a code mod that has no assets (AKA, your mod is a single C# DLL), it is possible to ship the bare DLL without packing it into a zip. This is not really a good idea though, as when distributed this way it is hard to include a PDB file and downloading DLLs directly in Windows can lead to issues with | Please note that if you have a code mod that has no assets (AKA, your mod is a single C# DLL), it is possible to ship the bare DLL without packing it into a zip. This is not really a good idea though, as when distributed this way it is hard to include a PDB file and downloading DLLs directly in Windows can lead to issues with your mod failing to load due to security policies applied to files downloaded from the internet. | ||
<table id="treeviewtable" class="table table-bordered tt-table" style='table-layout: fixed'> | |||
<tr style='background-color: rgba(180, 160, 128, 0.15);'> | |||
<th width='500px' align='left'>Zip File Structure</th> | |||
</tr> | |||
<tr> | |||
<td><div class="tt" data-tt-id="root">.zip</div></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="assets" data-tt-parent="root" data-hide="false">assets</div></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="your-domain" data-tt-parent="assets" data-hide="false">domain</div></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="stuff" data-tt-parent="your-domain">asset files ([[The Asset System|tree overview]])</div></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="modinfo.json" data-tt-parent="root">modinfo.json</div></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="modicon.png" data-tt-parent="root">modicon.png</div></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="dll" data-tt-parent="root">code files (*.dll, *.pdb and *.cs)</div></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="src" data-tt-parent="root" data-hide="false">src</div></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="src-dll" data-tt-parent="src">code files - folders allowed (*.dll, *.pdb and *.css)</div></td> | |||
</tr> | |||
</table> | |||
== Info file == | == Info file == | ||
Line 15: | Line 48: | ||
"name": "My Example Content Mod", | "name": "My Example Content Mod", | ||
"description" : "This is an example mod, which does nothing", | "description" : "This is an example mod, which does nothing", | ||
" | "authors": ["CreativeMD"], | ||
"version": "1.0", | "version": "1.0", | ||
" | "dependencies": { | ||
"game": "", | |||
"survival": "" | |||
}, | |||
"website": "http://example.com" | "website": "http://example.com" | ||
} | } | ||
Line 30: | Line 66: | ||
Besides <code>"type": "content"</code>, there is also <code>"type": "theme"</code> and <code>"type": "code"</code>. | Besides <code>"type": "content"</code>, there is also <code>"type": "theme"</code> and <code>"type": "code"</code>. | ||
* <code>"type": "content"</code>: Defines this mod as being a ''' | * <code>"type": "content"</code>: Defines this mod as being a '''Content Mod'''. Content Mods cannot contain any C# code (if it does they will be ignored). | ||
* <code>"type": "theme"</code>: Defines this mod as being a ''' | * <code>"type": "theme"</code>: Defines this mod as being a '''Theme Pack'''. Theme Packs cannot override gameplay affecting assets categories (such as blocktypes, itemtypes and so on) and no C# code will be loaded. | ||
* <code>"type": "code"</code>: Defines this mod as being a ''' | * <code>"type": "code"</code>: Defines this mod as being a '''Code Mod'''. Code Mods are the same as a Content Mods, except they can also load C# code to do things that are not possible with JSON. | ||
<syntaxhighlight lang=json> | <syntaxhighlight lang=json> | ||
" | "dependencies": { | ||
"game": "1.5.3" | |||
}, | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Means it requires at least VintageStory v1.5 | Means it requires at least VintageStory v1.5.3 or a newer version. | ||
== Icon == | == Icon == | ||
Line 46: | Line 84: | ||
[[File:Example Mod.png]] | [[File:Example Mod.png]] | ||
Feel free to share your creation in our [https://www.vintagestory.at/forums/forum/17-modifications/ forums]. We would love to see what you come up with | == Distribution and Installation == | ||
To install a mod simply place the zip file in the <code>Mods</code> directory in your [[Vintagestory folder|Vintagestory directory]]. | |||
Feel free to share your creation in our [https://www.vintagestory.at/forums/forum/17-modifications/ forums]. We would love to see what you come up with! | |||
{{Navbox/modding|Vintage Story}} |