Difference between revisions of "Modding"

From Old World Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
'''So you enjoy OW and would like to mod it ?'''
'''So you enjoy OW and would like to mod it ?'''
<div align=right>__TOC__</div>
<div align=right>__TOC__</div>
 
<br>
<div class="middle2">
<div class="middle2">
{{SectionTemplate
{{SectionTemplate

Revision as of 00:57, 31 July 2021

So you enjoy OW and would like to mod it ?


First Step : Read

  • A must read is Dale's excellent tutorials at http://dales.world/
  • Some of the discussions in #modding channel in Old World Discord which will be from now on your favourite channel !


Second Step : Create a first mod

  • First, understand the following : Old World does NOT read asset from files on your hard disk (except the files in the mods). All assets and XML files used by the main game are taken from ASSET BUNDLES and loaded at start. Modifying the (...)Epic Games/Old World/Reference/XML/ files will have NO EFFECT (They are just ... well, reference).
  • So the only way to mod is through a (...)/Mods/Your_Mod folder. Now create it in Your_game_working_dir/Mods/. Create an Infos subfolder inside it. And use the game interface to register your mod in mod.io (no need to upload it yet). This will create a ModInfo.xml file in your mod folder and will allow you to toggle your mod on.

Third Step : Start hacking XML

IMPORTANT : install a TEST build (install from Epic) and toggle DEBUG MODE activated in options.

General workflow is to copy a file(s) from (...)Epic Games/Old World (Version)/Reference/XML/original_name.xml, paste it in Infos/ and rename it to original_name-suffix.xml, then edit it, save it and test for errors.

suffix can be :

  • -add to add a new feature not present in game files (more common like nation-add.xml to add a faction)
  • -append to add features into already present assets in game files (like in assetGroup-append.xml to add images in portraits, crests, etc...)
  • -change to modify some existing features present in game files


Best practise is to start by downloading a working mod doing something similar to what you want your mod to do, then use it as a reference to copy/edit the same files in your mod.

All text info is usually contained in a text-original_name-suffix.xml into <Language>your text here</Language> tags

THEN starts the fun : Debugging !

Start OW, then go in Mods, and activate your mod. Return to start screen.

Open Your_game_working_dir/Logs/output.txt and check for errors...

Solve them one by one...Debugging your mod


Fourth Step : start playing with Unity to add Sprites (Images)

As of today, OW is built with Unity 2020 3 1f1 so this is the one you want to have

You will need also some image editor. Use your favourite and if you have none use Gimp ;-) All images should be in PNG format, if possible sized to multiples of 4 pixels.

You may also need the excellent AssetStudio freeware program that allows you to scavenge the game bundles from (...)Epic Games/Old World (Version)/OldWorld_Data/ directory

Once you have the correct version of Unity installed and working in your computer, launch the game and install "OW Assets Template" mod from within the game. This is NOT a mod, but a unity template directory created by Dale.

Create a new Unity project named YOUR_MOD. Best practise is to have a different project for every mod you do. Then close Unity, delete your YOUR_MOD/ folder contents and paste/extract the OW Assets Template into it (following Dale's instructions). Restart Unityhub, add the YOUR_MOD project and start it.

First you will need to install the last version of Unity's TextMeshPro (TMP) package. If you never used unity before, read some tutorials about how to do that. Once TMP installed, use menu to install the TMP basic components also.

Now you should have your system ready to follow Dale's instructions in http://dales.world/CustomAssets.html

Best Practise is to start adding a single image first, check for errors Debugging your mod, and have it loaded into the game. Then repeat the same process for the other images.