Master of Magic

Master of Magic

Not enough ratings
Custom Hero Modding Guide
By Xeth Nyrrow
This guide will help you create your own custom hero to add to the game and optionally allow you to start a game with the hero. XML code is provided that can be copy and pasted in to your files then altered to match the data you want.
2
   
Award
Favorite
Favorited
Unfavorite
Intro
Custom Hero Modding Guide for Master of Magic (MuHa/Slitherine - 2022)

Rev. 1.2.0: 2023-09-01: Updated info for new modding procedures.
----------------------------------------------------------------
This guide will help you create your own custom hero to add to the game and optionally allow you to begin a new game using that hero at the start. XML code is provided that can be copy and pasted in to your files then altered to match the data you want. We will be creating a hero named, "Noob the New" as an example. You can use the default Notepad in Windows to make/alter the files but I recommend a free XML editor such as Notepad++ to make editing easier. XML files can be made by creating a new text document and renaming the .txt extension to .xml.

First a folder needs to be made inside the Mods folder located by default in C:\Users\%userprofile%\AppData\LocalLow\MuHa Games\MoM\Mods. Use a unique name to set it apart from other mods but it doesn't have to be the full name of your mod. We'll use, "Noob the New". Two other files need to go here as well: settings.xml and a PNG graphic for the mod that is no bigger than 256 x 256 pixels in size. The name of the PNG file is referenced in the settings.xml in the <icon></icon> tag area. Another folder named, "Database" also needs to be made inside this folder to place the various files in to. If using custom graphics for your hero, a second folder named, "Images" also needs to be made here.
settings.xml
----------------
* settings.xml *
----------------
Inside the folder with the mod's name (Noob the New), a file named, "settings.xml" must be added that has basic info every mod needs for it to work with the in game mod manager as well as allow uploading to the Steam Workshop. An example file has been included with comments inside describing the various fields. There are several fields that start with <> and end with </> we want to modify, they are the indented ones below. The others are needed but just copy them exactly. Note that for the <icon> part, that text before the colon (:) needs to be the same as is entered in to the <prefix> which is, "noobthenew" here:

<?xml version="1.0"?>
<ModSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<prefix>noobthenew</prefix>
<name>Noob the New</name>
<title>Noob the New</title>
<description>Adds a new hero to the game: Noob the New!</description>
<author>Your Name Here</author>
<version>1.0</version>
<icon>noobthenew:noobmod.png</icon>
</ModSettings>
Database folder
-------------------
* Database folder *
-------------------
The Database folder is where all the files go that we'll need for this mod except for the optional character art. The easiest way to make a mod is to use existing code that is already functional. In the case of this guide, you can use the files provided. Normally we would copy files from the base game located by default in C:\Program Files (x86)\Steam\steamapps\common\MuHa Master of Magic\ExternalAssets\Database. You may wish to do this anyway to see what other skills are called in order to copy/paste them to your hero. These are the files we use, with the optional files being to enable the hero as a choice when starting a new game:

- DB_GROUP.xml
- DB_LOCALIZATION_DES.xml
- DB_SOUND.xml
- DB_SPELL.xml
- DB_SUBRACE.xml
- DB_TAG_QUEST.xml
- (Optional) DB_DIFFICULTY.xml
- (Optional) DB_LOCALIZATION_UI.xml
DB_GROUP.xml
----------------
* DB_GROUP.xml *
----------------
This file tells the game if the hero is a regular hero or a champion. The file must start with <DB_GROUP> and end with </DB_GROUP>. To add Noob as a regular hero:

<DB_GROUP>
<GROUP-HERO_NOOB>
<Heroes VALUE="HERO-NOOB"/>
<CreationScript VALUE="EventGroup"/>
</GROUP-HERO_NOOB>
</DB_GROUP>


To make him a champion instead, it's slightly different and yes, <Heroes VALUE="HERO-NOOB"/> is correct here too:

<DB_GROUP>
<GROUP-CHAMPION_NOOB>
<Heroes VALUE="HERO-NOOB"/>
<CreationScript VALUE="EventGroup"/>
</GROUP-CHAMPION_NOOB>
</DB_GROUP>
DB_LOCALIZATION_DES.xml
---------------------------
* DB_LOCALIZATION_DES.xml *
---------------------------
This file contains readable text in game and defines the names for the AI versions of the hero as well as the hero's bio. Also this file is a little tricky as the second header has to be different than the base game file name. Here we use _NOOB_THE_NEW in the second header to make it work. Using {0} inside the quotes of <Loc Key="DES_NOOB_DES" Value=" "/> tells the game to use the hero's full name and title and would read, "Noob the New" not {0}:

<DB_LOCALIZATION>
<LOCALIZATION-DES_EN_NOOB_THE_NEW Language="English">
<Loc Key="DES_NOOB" Value="Noob the New" />
<Loc Key="DES_NOOB1" Value="Nooba the New" />
<Loc Key="DES_NOOB2" Value="Noobe the New" />
<Loc Key="DES_NOOB3" Value="Noobi the New" />
<Loc Key="DES_NOOB4" Value="Noobo the New" />
<Loc Key="DES_NOOB_DES" Value="{0} is new to the game. He hopes you let him stay in your army until the end of the campaign instead of killing him off via a Sky Drake suicide run because you'd rather have Warrax. " />
</LOCALIZATION-DES_EN_NOOB_THE_NEW>
</DB_LOCALIZATION>
DB_SOUND.xml
----------------
* DB_SOUND.xml *
----------------
This file tells the game what sound files to use when certain actions involving the hero are triggered. Note the extra Sfx="true" in the header needs to be added. Here we use _NOOB_THE_NEW again in the second header to make it work. You can use existing sound effects found in the default C:\Program Files (x86)\Steam\steamapps\common\MuHa Master of Magic\ExternalAssets\Sound\SFX\ folder or add your own. Here we use Zaldron's sound files by first referencing the folder before the \ then the actual .wav file right afterwards. Exclude the entire, "NoobAttackRanged" and "NoobRangedHit" lines for heroes without ranged attacks.:

<DB_SOUND>
<SOUND_LIST-SFX_NOOB_THE_NEW Sfx="true">
<Sound Name="NoobAttackMelee" File="Zaldron\ZaldronAttackMelee.wav"/>
<Sound Name="NoobAttackRanged" File="Zaldron\ZaldronAttackRanged.wav"/>
<Sound Name="NoobAttackRangedHit" File="Zaldron\ZaldronAttackRangedHit.wav"/>
<Sound Name="NoobGetHit" File="Zaldron\ZaldronGetHit.wav"/>
<Sound Name="NoobDie" File="Zaldron\ZaldronDie.wav"/>
<Sound Name="NoobMove" File="HorseMove.wav"/>
</SOUND_LIST-SFX_NOOB_THE_NEW>
</DB_SOUND>


If adding custom sound files, create a folder and add files with matching names referencing the hero such as, "Noob" in this case:

<DB_SOUND>
<SOUND_LIST-SFX>
<Sound Name="NoobAttackMelee" File="Noob\NoobAttackMelee.wav"/>
<Sound Name="NoobAttackRanged" File="Noob\NoobAttackRanged.wav"/>
<Sound Name="NoobAttackRangedHit" File="Noob\NoobAttackRangedHit.wav"/>
<Sound Name="NoobGetHit" File="Noob\NoobGetHit.wav"/>
<Sound Name="NoobDie" File="Noob\NoobDie.wav"/>
<Sound Name="NoobMove" File="Noob\NoobMove.wav"/>
</SOUND_LIST-SFX>
</DB_SOUND>

Note: There is some difference with the declaration of the move sound. The default location for the move sounds are in the main SFX folder and are called HorseMove.wav and HorseHeavyMove.wav. It's also not necessary to declare them here to use them later but is shown for consistency and recommended as a good practice.
DB_SPELL.xml
----------------
* DB_SPELL.xml *
----------------
This file gives heroes their own extra spells in their spell books to use in battle. If the hero is not a caster, then you can skip this step (and file) completely. It's easiest to reference then copy/paste what spell(s) you want from the base game's DB_SPELL.xml file:

<DB_SPELL>
<SPELL_PACK-NOOB>
<Spell VALUE="SPELL-HEALING"/>
<Spell VALUE="SPELL-HOLY_ARMOR"/>
<Spell VALUE="SPELL-LIONHEART"/>
</SPELL_PACK-NOOB>
</DB_SPELL>
DB_SUBRACE.xml
------------------
* DB_SUBRACE.xml *
------------------
This is where the bulk of the hero info goes such as stats and skills plus references to the audio and graphics used. For graphics <DescriptionInfo Name="DES_NOOB" Description="DES_NOOB_DES" Graphic="#####" /> needs to have ##### match the name of an existing unit to use for the hero (but it doesn't have to be a hero unit). Reference the DB_SUBRACE.xml file then copy/paste in what you like such as, "Malleus", "Tumu", or even "Unicorn". Optionally you can add your own 2D art for a portrait and icon. If you add your own 2D art, you must also reference an existing 3D model as custom 3D models cannot be added. This is done by adding an additional line <OptionalModel3dName VALUE="####"/> where #### is the name of an existing unit. Here we make Noob's 3D model look like Zaldron in game with <OptionalModel3dName VALUE="Zaldron"/>. If you are not planning to use your own 2D art then delete/do not use this line and the game will use both the 2D and the 3D art of whatever unit you put in the Graphic="#####" section.

To add your own 2D art to the game, 2 files must be placed in the, "Images" folder which in this case is located at C:\Users\%userprofile%\AppData\LocalLow\MuHa Games\MoM\Mods\Noob the New\Images. The main portrait must be a PNG file measuring 1024 by 1024 pixels with the file named ####_FULL.png where #### is all lowercase (and _FULL has to be capitals) matching the name of your hero. In the Graphic="#####" portion only the lower case part is added in this case <DescriptionInfo Name="DES_NOOB" Description="DES_NOOB_DES" Graphic="noob" />. Second, for the unit icon another PNG file is needed measuring 256 by 256 pixels named ####.png where #### is the hero's name in all lower case. For heroes, this is usually a cropped version of the _FULL file focused on the face.

To add skills, it's easiest to reference then copy/paste what you want from the game's DB_SUBRACE.xml file. For randomized skill picks, add one <SkillPacks VALUE="SKILL_PACK-#####_SKILLS"/> line PER PICK where ##### is ANY, FIGHTER, MAGE, or ANY_SKILLS_NO_ARCANE_POWER (only Torin and Alorra use this last one). Noob here has the skills of a magical ranged attack from the Nature realm, the caster 10 (mana) skill plus two, "ANY" class random skills and his own spell book. All heroes start with <Skills VALUE="SKILL-ENCHANTED_WEAPON1"/> so we have there here too. The rest of the numbers should be fairly self explanatory but you can always reference the DB_SUBRACE.xml file for research. Any lines referencing range or ammo can be omitted if the hero doesn't have ranged capabilities. For sounds, reference the same sound files used in the DB_SOUND_NOOB_THE_NEW.xml file.

Note for a champion, use <Tags Amount="1" Tag="TAG-CHAMPION_CLASS"/> instead of <Tags Amount="1" Tag="TAG-HERO_CLASS"/> and <Marker VALUE="IconChampion"/> instead of <Marker VALUE="IconHero"/>. Also <Champion VALUE="TRUE"/> needs to be added ideally under the last <AlterName VALUE=""/> to mark it as a champion for the Summon Champion spell:

<DB_SUBRACE>
<HERO-NOOB>
<DescriptionInfo Name="DES_NOOB" Description="DES_NOOB_DES" Graphic="noob" />
<OptionalModel3dName VALUE="Zaldron"/>
<AlterName VALUE="DES_NOOB1"/>
<AlterName VALUE="DES_NOOB2"/>
<AlterName VALUE="DES_NOOB3"/>
<AlterName VALUE="DES_NOOB4"/>
<Race VALUE="RACE-HERO"/>
<Marker VALUE="IconHero"/>

<Tags Amount="4" Tag="TAG-MOVEMENT_POINTS"/>
<Tags Amount="1" Tag="TAG-CAN_WALK"/>

<Tags Amount="2" Tag="TAG-UPKEEP_GOLD"/>
<RecruitmentCost VALUE="100"/>
<RecruitmentMinFame VALUE="0"/>
<NaturalHealing VALUE="TRUE"/>
<GainsXP VALUE="TRUE"/>

<Tags Amount="5" Tag="TAG-MELEE_ATTACK"/>
<Tags Amount="5" Tag="TAG-RANGE_ATTACK"/>
<Tags Amount="5" Tag="TAG-AMMUNITION"/>
<Tags Amount="4" Tag="TAG-DEFENCE"/>
<Tags Amount="10" Tag="TAG-RESIST"/>
<Tags Amount="8" Tag="TAG-HIT_POINTS"/>
<Tags Amount="0.3" Tag="TAG-MELEE_ATTACK_CHANCE"/>
<Tags Amount="0.3" Tag="TAG-RANGE_ATTACK_CHANCE"/>
<Tags Amount="0.3" Tag="TAG-DEFENCE_CHANCE"/>
<Tags Amount="1" Tag="TAG-HERO_CLASS"/>

<Skills VALUE="SKILL-HERO_LEVEL"/>
<Skills VALUE="SKILL-MELEE_ATTACK"/>
<Skills VALUE="SKILL-ENCHANTED_WEAPON1"/>
<Skills VALUE="SKILL-MAGIC_NATURE_RANGE_ATTACK"/>
<Skills VALUE="SKILL-CASTER_10"/>

<SkillPacks VALUE="SKILL_PACK-ANY_SKILLS"/>
<SkillPacks VALUE="SKILL_PACK-ANY_SKILLS"/>
<SpellPack VALUE="SPELL_PACK-NOOB"/>

<EquipmentSlot VALUE="ARTEFACT_SLOT-MELEE_SPELLCASTER"/>
<EquipmentSlot VALUE="ARTEFACT_SLOT-ARMOUR"/>
<EquipmentSlot VALUE="ARTEFACT_SLOT-MISC"/>
<Tags Amount="1" Tag="TAG-MALE"/>
<Audio Move="NoobMove" AttackMelee="NoobAttackMelee" AttackRanged="NoobAttackRanged" AttackRangedHit="NoobAttackRangedHit" GetHit="NoobGetHit" Die="NoobDie"/>
</HERO-NOOB>
</DB_SUBRACE>
DB_TAG_QUEST.xml
--------------------
* DB_TAG_QUEST.xml *
--------------------
I am not sure what this file does honestly, I think it's supposed to relate to possible special events/quests involving heroes. We need 2 entries, NOOB1 and NOOB2 and the rest is the same:

<DB_TAG_QUEST>
<TAG-QUEST_NOOB1>
<DescriptionInfo Name="DES_TAG_MY_TAG" Description="DES_TAG_MY_TAG_DES" Graphic="IconPlaceholder"/>
</TAG-QUEST_NOOB1>
<TAG-QUEST_NOOB2>
<DescriptionInfo Name="DES_TAG_MY_TAG" Description="DES_TAG_MY_TAG_DES" Graphic="IconPlaceholder"/>
</TAG-QUEST_NOOB2>
</DB_TAG_QUEST>
(Optional) DB_DIFFICULTY.xml
--------------------------------
* (Optional) DB_DIFFICULTY.xml *
--------------------------------
This adds the hero to the list of starting heroes you can use when beginning a new game. You can keep B'Shan as an option or even add other heroes here too. Make sure only one hero has the QuickStart="TRUE" tag and this is needed for that start option. Here we add Noob while keeping B'Shan as the quick start option:

<DB_DIFFICULTY>
<DIFFICULTY-ADD_HERO Name="UI_ADD_HERO" FullValue="20">
<TooltipName VALUE="UI_ADD_HERO"/>
<TooltipDescription VALUE="UI_ADD_HERO_DES"/>
<Setting Title="UI_BSHAN" Value="HERO-BSHAN" Difficulty="0" Collection="0" QuickStart="TRUE"/>
<Setting Title="UI_NOOB" Value="HERO-NOOB" Difficulty="0" Collection="0"/>
<Setting Title="UI_NONE" Value="0" Difficulty="20" Collection="1"/>
</DIFFICULTY-ADD_HERO>
</DB_DIFFICULTY>
(Optional) DB_LOCALIZATION_UI.xml
-------------------------------------
* (Optional) DB_LOCALIZATION_UI.xml *
-------------------------------------
This is a separate text localization file specifically for the UI to display the hero's name in the list of starting heroes. Space is limited, so putting just the hero's name without its title is sufficient:

<DB_LOCALIZATION>
<LOCALIZATION-UI_EN_NOOB_THE_NEW Language="English">
<Loc Key="UI_NOOB" Value = "Noob"/>
</LOCALIZATION-UI_EN_NOOB_THE_NEW>
</DB_LOCALIZATION>
Final step
--------------
* Final step *
--------------
When starting the game, click the, "Mods" button at the bottom right of the title screen. Check the box next to your mod and it will turn green, indicating that it's been activated. The game will prompt you to restart it to complete the process. When you restart the game, it will build 3 cache files with the mod's name for evaluation purposes in the mod's main folder. These files now become part of your mod, in our case they will be the following:

Noob the New.bin
Noob the New.txt
Noob the New_Short.txt

At this point the new hero can be recruited, rescued from a lair, summoned with the appropriate summoning spell and possibly started with if you added the optional files. You can also upload the mod to the Steam Workshop at this point if you wish. If you have any questions or feedback please let me know.

~ Xeth Nyrrow ~
Discord: Xeth Nyrrow#4312
Email: xethnyrrow@hotmail.com
----------------------------------------------------------------
Rev. 1.2.0: 2023-09-01: Updated info for new modding procedures.
Rev. 1.1.0: 2023-02-03: Adding custom 2D artwork.
Rev. 1.0.0: 2023-01-15: Initial Public Release.
7 Comments
Dominus 3 Feb @ 3:33pm 
@sevantis I'm having the same problem. I thought he said 1080x1080, but then I saw it was 1024x1024 pixels. His file in the video is NOOB.png.png so I tried that and it still can't find it. I'm also getting "Failed to communicate with Epic platform. MARKER ID 39687886 Missing TAG-DOONANNOWN in database when trying to reference it. "
sevantis 2 Oct, 2023 @ 8:44pm 
i have a problem with the png file, get asset not found.
Xeth Nyrrow  [author] 8 Sep, 2023 @ 3:34am 
@BrainStarLoser Appreciate the heads up, fixed. Thank you!
BrainStarLoser 8 Sep, 2023 @ 3:13am 
In the second paragraph of db_subrace you note the path as C:\Users\%userprofile%\AppData\LocalLow\MuHa Games\MoM\Mods\Images in this case I believe the path should be C:\Users\%userprofile%\AppData\LocalLow\MuHa Games\MoM\Mods\Noob the New\Images or what ever name you gave your mod. That is how I got it to work.

It is also worth noting that in the folder C:\Users\%userprofile%\AppData\LocalLow\MuHa Games\MoM there are two log files. GameLog.txt and Player.log that are useful for trouble shooting issues.

Thanks for the guide it was very helpful
XenoReaver 16 Jan, 2023 @ 3:41pm 
I've made three heroes so far based off of summons. A sprite hero, a fire giant hero and a naga hero. Really enjoying it.
AK-OKC 15 Jan, 2023 @ 10:29pm 
Does it work on the Beta release? I am having trouble.
XenoReaver 15 Jan, 2023 @ 7:05am 
Awesome work, cheers for this Xeth.