Realms of Magic

Realms of Magic

Not enough ratings
Basic modding
By IVIemories
A very basic guide for adding new items into the game
   
Award
Favorite
Favorited
Unfavorite
Introduction
This is just a quick guide to adding new items into the game using pre-existing assets. I'll try to answer any questions in the comments as best as I can, but keep in mind that I'm also still figuring things out myself.

The reason I made this guide is simply because there is no documentation (that I could find) that tells you how to make a mod, despite certain elements of the game being extremely easy to modify.
Getting started
Although technically the only thing you'll need is notepad, I strongly suggest you get a more advanced text editor such as notepad++[notepad-plus-plus.org].

Once you have your text editor read, you'll need to find the XML files that contain the game data you need to modify. To do that, you'll need to go to Steam\steamapps\common\Realms of Magic\Windows64\RealmsofMagic\Data (this folder varies depending on what drive and folder steam is installed in).


If you cannot find where realms of magic is installed, you can find the steam install folder automatically by using steam's "browse local files" button.


Adding the item (item.xml)
Open items.xml and recipes.xml with your text editor. Items.xml contains data on all items in the game, whilst recipes.xml contains data on (you guessed it) all recipes in the game.

For this guide, I'm going to add a very simple weapon to the game, The Epic Sword of Mod Testing. The easiest way to add an item is to find a similar item and just copy paste everything to the end of the xml file. In our case, we're going to copy and paste all the data for a Copper Sword to the end of the XML file.


Make sure your new item falls in between the <items> tag at the start of the XML file and the </items> tag at the end of the XML file.

The first thing we want to change here is the ID, which really shouldn't conflict with any other ID in the document. A safe ID to change to is the one after the last item (in this case, Fertile Soil with Titanium Ore) so change the ID of our item to 58722.

The next thing we want to change is the name of the item from it's original name, so go ahead and change that to whatever you fancy (in my case, The Epic Sword of Mod Testing).

To make our sword truly epic, we want to increase the damage from it's current values to something that is more befitting of an epic sword. The values we want to change here are the third and fourth Stat values which represent the maximum and minimum damage of the weapon.


Finally, if you are concerned that your new Epic sword is too cheap, you can change the "Value" stat to whatever you like, the value is the number of copper coins an item costs.

Once all that is done, save the XML file and open up recipes.xml

(In case you are wondering, the <Icon col="91" row="4"/> line represents the location of the icon the item uses in the Icons.uasset file. I'm not entirely sure I'm allowed to upload that due to copyright, so you'll have to unpack the .pak file yourself to get it)
Adding the item (recipes.xml)
Your item has now been added into the game, but it's not very useful unless there is a way to obtain the item via crafting, so we need to add a crafting recipe into the game as well.

Open up recipes.xml and find the recipe for the template item you used to create your new item (in my case, the Copper Sword) and copy paste that to the bottom of recipes.xml (same rules apply from last time).



Once that is done, we want to change the ID to an unused ID (using the same method from items.xml), change the "Recipe name" to the same as the item you added, and under "items" you want to change the item ID to the ID of the new item you just added (in my case, 58722).

In order to make it more obtainable, we also want to change the "group" to Handcrafting, change the ingredients such that it only requires one stick and reduce the level requirement down to 1.

You should have something similar to this at the end:


Now save the file and open the game. If everything is correct, you should be able to craft your brand new item from the handcrafting menu and equip it.



Please note that the item is still using the texture for the Copper Sword, this is because we have not changed the <Icon col="91" row="4"/> line from items.xml. I believe that using the Icons.uasset file (which you need to unpack from the .pak file) it's possible to assign any texture to an item and possibly even add new textures to the game. But I have not yet tested the former, and the latter is currently beyond my capabilities as it would involve unpacking, modifying the textures and then repacking it.
11 Comments
Jack Maker 29 Nov, 2023 @ 1:13pm 
Has one of your items turned with no toltips? One I made works fine, but when I hover with the cursos above it, it doesn't show the item tooltip.
glamourcat 5 Aug, 2022 @ 6:39am 
Hopefully, this is my last stupid question. I cannot get my game to start when I make the mod changes to the copper sword, per your tutorial. Do I need to change the sorting number on the recipe as well? I made all the other adjustments but wasn't sure about that one. I am not the most gifted at modding by code.
Aphelion 4 Aug, 2022 @ 12:27am 
Thank you for the informative answer. :happy_yeti:
IVIemories  [author] 4 Aug, 2022 @ 12:04am 
The reason why changing the light radius of the traveling torch doesn't work is that the game seems to pull light radius for the player from somewhere else and not item.xml.

For placeable objects, increasing the light radius works exactly as it should, however even if you then turned the object into a torch the light radius still wouldn't change.

Where exactly this variable is, I have no idea. It could be hidden in one of the xml files and I just missed it, or it could be baked into the engine.
glamourcat 3 Aug, 2022 @ 8:26am 
Thank you so much for answering my question! I appreciate your time and help putting this tutorial together.
Aphelion 2 Aug, 2022 @ 8:57am 
What values should be changed to make the travelling torch brighter? I went to the items file and changed the radius of travelling torch from 165 to 200 and 300 respectively, but I noticed no difference to the range of light or its brightness in the game.

This is a common request among the players so a solution would be a wonderful. :)
IVIemories  [author] 2 Aug, 2022 @ 5:31am 
Thre's been some changes to the items.xml file since I last touched it, so you should be changing the first and second values now.

So for the copper sword

<Stat isPercentage="0" value="22" type="2"/>
<Stat isPercentage="0" value="33" type="3"/>
<Stat isPercentage="0" value="3" type="7"/>

value="22" should be the minimum damage (or a number that calculates the minimum damage) and value="33" should be the maximum damage.

The game doesn't seem to take these numbers at face value anymore, but the concept is still the same - higher number = more damage
glamourcat 1 Aug, 2022 @ 6:57pm 
Forgive me for the stupid question, but when you say change the values to the stats you want - which ones are we changing specifically? The percentage, the value or the type? Since the second screen shot just had the whole line highlighted with no stats changed from the previous screen shot it was hard for me to tell what needed to be altered.
Gh05T 24 Jul, 2022 @ 3:31am 
IVIemories, thank you so much for this. I made my own Godly Axe and am slicing through my enemies, like a hot knife through butter!
Runkels_GD351 22 Apr, 2020 @ 6:04pm 
Incredible tutorial!