Modding:Handbook Guide: Difference between revisions

From Vintage Story Wiki
(Created page with "<!--T:1--> ""Handbook guides"" are separate pages in handbook dedicated to explain various game mechanics. === 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. New file should look inside like this:<syntaxhighlight lang="json"> { "pageCode": "morepies:introduction", "title": "morepies:introduction-title", "text": "morepies:introduction-text" }</...")
 
(add categories)
Line 1: Line 1:
<!--T:1-->
<!--T:1-->
""Handbook guides"" are separate pages in handbook dedicated to explain various game mechanics.
'''Handbook guides''' are separate pages in handbook dedicated to explain various game mechanics.


=== 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.
Create new file with unique name, for example, '''101-pies.json''', then put it to "assets/game/config/handbook" folder in your mod.


New file should look inside like this:<syntaxhighlight lang="json">
New file should look inside like this:<syntaxhighlight lang="json">
Line 12: Line 12:
}</syntaxhighlight>
}</syntaxhighlight>


Note that ""pageCode"" should be unique, for example, ""morepies:introduction"".
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:
<syntaxhighlight lang="json">
"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/<mymod>/lang/en.json"):<syntaxhighlight lang="json">
Line 18: Line 22:
     "morepies:introduction-title": "Pies 101",
     "morepies:introduction-title": "Pies 101",
     "morepies:introduction-text": "Pies are a very tasty food.",
     "morepies:introduction-text": "Pies are a very tasty food.",
}</syntaxhighlight>
And another two keys for category (if you added new):<syntaxhighlight lang="json">
{
    "game:handbook-category-morepies": "More Pies",
    "handbook-category-morepies:category": "More Pies",
}</syntaxhighlight>
}</syntaxhighlight>


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

Revision as of 18:26, 7 August 2024

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

Adding new guide

Create new file with unique name, for example, 101-pies.json, then put it to "assets/game/config/handbook" folder in your mod.

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/<mymod>/lang/en.json"):

{
    "morepies: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