Modding:Handbook Guide: Difference between revisions

From Vintage Story Wiki
(added contents, translation and modding navbox)
(put to mod domain folder instead game folder)
Line 7: Line 7:


=== Adding new guide === <!--T:2-->
=== Adding new guide === <!--T:2-->
Create new file with unique name, for example, '''101-pies.json''', then put it to "assets/game/config/handbook" folder in your mod.
In this case we will use '''morepies''' as mod domain and modid.
 
We create new file named '''101-pies.json''' and then put it to "assets/morepies/config/handbook" folder.


New file should look inside like this:<syntaxhighlight lang="json">
New file should look inside like this:<syntaxhighlight lang="json">
Line 22: Line 24:
"categoryCode": "morepies:category"</syntaxhighlight>
"categoryCode": "morepies:category"</syntaxhighlight>


Add two keys to localization file (for example, in "assets/<mymod>/lang/en.json"):<syntaxhighlight lang="json">
Add two keys to localization file (for example, in "assets/morepies/lang/en.json"):<syntaxhighlight lang="json">
{
{
     "morepies:introduction-title": "Pies 101",
     ":introduction-title": "Pies 101",
     "morepies:introduction-text": "Pies are a very tasty food.",
     "morepies:introduction-text": "Pies are a very tasty food.",
}</syntaxhighlight>
}</syntaxhighlight>

Revision as of 09:53, 9 August 2024

Handbook guides are separate pages in handbook dedicated to explain various game mechanics.

Adding new guide

In this case we will use morepies as mod domain and modid.

We create new file named 101-pies.json and then put it to "assets/morepies/config/handbook" folder.

New file should look inside like this:

{
    "pageCode": "morepies:introduction",
    "title": "morepies:introduction-title",
    "text": "morepies:introduction-text"
}

Note that pageCode should be unique, for example, morepies:introduction.

If you want your guide in specific category, then add following in the same file:

"categoryCode": "morepies:category"

Add two keys to localization file (for example, in "assets/morepies/lang/en.json"):

{
    ":introduction-title": "Pies 101",
    "morepies:introduction-text": "Pies are a very tasty food.",
}

And another two keys for category (if you added new):

{
    "game:handbook-category-morepies": "More Pies",
    "handbook-category-morepies:category": "More Pies",
}

Now reload your world and you can find new guide in handbook

Content Modding
Basics Content Mods Developing a Content Mod Packaging & Release
Tutorials
Concepts Modding Concepts Modinfo Variants Domains Patching Remapping World Properties
Moddable Assets
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