Item Creation - ghostboats/bg3_modders_guide GitHub Wiki

Version Details:

  • MAJOR=4 MINOR=4 REVISION=0 BUILD=444

Introduction

This guide is intended to help you create an item mod from start to finish alongside me. I will try to go slow but understand alot of core concepts needs to be found in the class mod guide, file insights, and getting started. Skipping those could lead to some confusion. Anyways, if you want to follow along, take a look at the mod in the repo that this guide revolves around, Death_sword. I will be making two very very simple items to get you started with, a object and a weapon.

Goals

Setup For Modding
Modify An Existing Item To Make A New Item (Death Sword Bag)
Modify An Existing Item To Make A New Item (Death Sword)

Setup For Modding⬆️

*If you haven't taken a look at getting started, I highly suggest you do so you have the same environment setup as I do.

Lets set up our initial folder for our mod. All of our mod files and folders will go in here. We will cover it when we get to it, but this folder will essentially be packed by our multitool to be used as our .pak file which we place in the mods folder for your game. We will only need a few folders and files to get a simple item mod running. The bulk of the files we will deal with are .lsx files which are basically xml files. As your mod gets more intricate, you will need to add more folders/files but the following should be all we need to get started editing an item. Note the indentation on entries to indicate the file tree structure, ie. Localization folder has the English folder in it and so forth.

Mod folder setup

  • Localization : Starting off, we can make a folder called Localization inside your mod folder, in my case my folder called Death_sword. This folder/subfolder will deal with your ingame text. For example, we will later edit the name and description of the item we make, so it appears as so on the character creation screen.
    • English : Should be the language of your ingame text. If you are reading this, I'm guessing yours should also be English.
      • Death_sword.loca : The actual file that has the text you will see in the game for your mod. It is not properly readable so when we do start to add any text, we will adding it to the xml file below. We dont need to make this file but once we convert out Death_sword.xml file below with the multitool, we will get out Death_sword.loca file (Capitalize the first letter when you make it in the multitool)
      • Death_sword.xml : The readable version of the localization file for our mod. We will use the multitool to convert this to the .loca file.
  • Mods : This will let the multitool know the folder it is housed in is an unpacked mod. When you pack your mod, a new folder will appear here with your mod name and inside it, a meta.lsx. This is very important, and we may need to make some changes to it if your mod isn't working right away when we load up the game.
  • Public : The bulk of the work we do will be in this folder and its subfolders.
    • Death_sword : This folder name should be the name of your mod. (Capitalize the first letter)
      • RootTemplates : This folder houses merged.lsx.
        • merged.lsx : This file has all our item templates. It helps give things like icons, scale, name, etc. If you plan on editing an existing item, this is a good place to start.
      • Stats : Folder
        • Generated : Folder
          • Data : This folder houses alot, like spells, passives, boosts, etc. If we want to add an item, typically that means we will need to edit its corresponding .txt file (Want to edit a sword? Look in Weapon.txt. Gloves? Try Armor.txt. Etc Etc).
            • Object.txt : While this mod is meant for a sword, I also show a valuable mod that can help you with items mods. I will cover it below but for now just make the Object.txt.
            • Weapon.txt : Since we want to add a new sword to the game, we will need to add an entry for it in Weapon.txt
          • TreasureTable.txt : While not technically need, this determines where we can get our item from (a merchant for example, or in a certain crate, etc).

*If you are unsure about how to make the loca or lsx files, just open a text document and click save as. On the save as menu, change the "Save as type" option to "All types" and change the file name to your mod name. When you convert via the converter app, make sure you specify the file name and extension

Tutorial Chest Summoning

Before we start, I recommend you download the Tutorial Chest Summoning mod by wesslen. It automatically gives a spell to all classes that allows them to summon a special chest in your inventory for 10 or so turns. This is useful because we can make it so any new items we are testing appear in the box when summoned, so you can test any items you make instantly by putting it in the box. In fact, this mod helped me get started with item creation so it could be a valuable resource even if you dont use it. But I will be using it and showing how to add items to it so you might as well.

Modify An Existing Item To Make A New Item (Death Sword Bag)⬆️

I hope you downloaded the Tutorial Chest Summoning mod like I suggested above because the first thing we are going to do is learn how to place an item in there for us to use when we summon it (I refactored pavlovgarmata's mod, Dark Urge Demonic Blood Swords to implement and learn how to do this). When it comes to item creation, odds are whatever you are thinking of making, probably exists in some capacity in the game. Your goal is to find that similar item and make another item using the similar item as as base/parent. I want to make a bag that will house all the items I want to get from my death sword mod, so lets take a look at an existing bag item in _merged.lsx (not the one we made, the one in the base games shared pack, RootTemplates/_merged.lsx)

merged.lsx/_merged.lsx

Im not sure if it matters if it merged or _merged. Ive seen both but they may have been different files? I have seen multiple merge files in mods so make sure you are aware so you dont get them mixed up. The base game's _merged.lsx is pretty massive, understandably so. It contains alot of information about all the items in the game and its variants (other merged files, like i mentioned above, contain other things beyond items but we are just focused on items for now. We know we want some sort of container to hold our death sword items, so our best bet would be some sort of chest or bag. This way we know we are already working with something that has the capabilities to have items stored in it. It can involve some searching and trial end error but we should look for some sort of bag object. After you do this a few times you will have a better idea of what you are looking for. I know I want a bag. Scrounging through the _merged, I see this entry:

<node id="GameObjects">
	<attribute id="CanBePickedUp" type="19" value="True" />
	<attribute id="LevelName" type="22" value="" />
	<attribute id="MapKey" type="22" value="ea8cc72a-e078-4ce7-bd63-14bcf1851f46" />
	<attribute id="Name" type="23" value="BASE_CONT_Movable_Pickable" />
	<attribute id="ParentTemplateId" type="22" value="e64fc74f-b0c8-4372-88ad-9318ef066b7e" />
	<attribute id="Stats" type="22" value="OBJ_Bag" />
	<attribute id="Type" type="22" value="item" />
	<attribute id="_OriginalFileVersion_" type="32" value="144115188075855892" />
	<children>
		<node id="FadeChildren" />
		<node id="GameMaster" />
		<node id="LayerList">
			<children>
				<node id="Layers" />
			</children>
		</node>
	</children>
</node>

The BASE_CONT_Movable_Pickable, especially the BASE_CONT hints to us that this is some sort of base value for containers. What we need here is the MapKey attribute value. The item we make will use this entry above as its parent essentially, using the MapKey value as a link. This lets us use existing items to make new items by inheriting their properties. If you are worried this may not be what we are looking for, search the items in _merged with that MapKey value. You should see multiple entries will have the MapKey from our entry as the value for the ParentTemplateId (like this: <attribute id="ParentTemplateId" type="22" value="ea8cc72a-e078-4ce7-bd63-14bcf1851f46" />). Alot of these items have names like LOOT_GEN_Backpack_E_Posed_A, or Item_CONT_Barrel_A, which lets us know we are probably on the right track, they look like container items. Here is an entry we see that has the MapKey we are using as our base as the ParentTemplateId.

<node id="GameObjects">
	<attribute id="CanClickThrough" type="19" value="False" />
	<attribute id="CanClimbOn" type="19" value="False" />
	<attribute id="CanShootThrough" type="19" value="True" />
	<attribute id="CoverAmount" type="1" value="0" />
	<attribute id="Description" type="28" handle="h22bde06dgcd23g4050gbe16gb1347123b08a" version="2" />
	<attribute id="DisplayName" type="28" handle="h77c334eegca81g44ebgbde1g45f35b294c41" version="1" />
	<attribute id="Icon" type="22" value="Item_LOOT_GEN_Backpack_A_Posed_A" />
	<attribute id="InventoryType" type="1" value="11" />
	<attribute id="IsInspector" type="19" value="False" />
	<attribute id="IsPointerBlocker" type="19" value="False" />
	<attribute id="LevelName" type="22" value="" />
	<attribute id="LoopSound" type="22" value="" />
	<attribute id="MapKey" type="22" value="f81999db-1f55-4251-8084-526cf74530e6" />
	<attribute id="Name" type="23" value="LOOT_GEN_Backpack_B_Posed_A_Colorvar_B" />
	<attribute id="ParentTemplateId" type="22" value="ea8cc72a-e078-4ce7-bd63-14bcf1851f46" />
	<attribute id="PhysicsTemplate" type="22" value="91ec345d-e243-92bf-6ee8-ba6bbbc087f9" />
	<attribute id="ReadinessFlags" type="5" value="128" />
	<attribute id="Scale" type="6" value="1.25" />
	<attribute id="SoundAttenuation" type="2" value="-1" />
	<attribute id="SoundInitEvent" type="22" value="" />
	<attribute id="Stats" type="22" value="OBJ_Backpack" />
	<attribute id="Tooltip" type="1" value="2" />
	<attribute id="TreasureOnDestroy" type="19" value="True" />
	<attribute id="Type" type="22" value="item" />
	<attribute id="VisualTemplate" type="22" value="04164ede-781f-7b8f-cd80-0d0063787c7f" />
	<attribute id="Wadable" type="19" value="False" />
	<attribute id="WalkOn" type="19" value="False" />
	<attribute id="WalkThrough" type="19" value="True" />
	<attribute id="_OriginalFileVersion_" type="32" value="144115188075855909" />
	<children>
		<node id="Bounds">
			<children>
				<node id="Bound">
					<attribute id="Height" type="6" value="0.591562" />
					<attribute id="Max" type="12" value="0.116174 0.593682 0.0918415" />
					<attribute id="Min" type="12" value="-0.111174 -0.00787998 -0.1364405" />
					<attribute id="Radius" type="6" value="0.113354" />
					<attribute id="Shape" type="1" value="1" />
					<attribute id="Type" type="1" value="0" />
				</node>
				<node id="Bound">
					<attribute id="Height" type="6" value="0.591562" />
					<attribute id="Max" type="12" value="0.232348 0.593682 0.183683" />
					<attribute id="Min" type="12" value="-0.222348 -0.00787998 -0.272881" />
					<attribute id="Radius" type="6" value="0.226708" />
					<attribute id="Shape" type="1" value="1" />
					<attribute id="Type" type="1" value="1" />
				</node>
				<node id="Bound">
					<attribute id="Height" type="6" value="0.591562" />
					<attribute id="Max" type="12" value="0.232348 0.593682 0.183683" />
					<attribute id="Min" type="12" value="-0.222348 -0.00787998 -0.272881" />
					<attribute id="Radius" type="6" value="0.226708" />
					<attribute id="Shape" type="1" value="1" />
					<attribute id="Type" type="1" value="2" />
				</node>
			</children>
		</node>
		<node id="GameMaster" />
		<node id="OnDestroyActions">
			<children>
				<node id="Action">
					<attribute id="ActionType" type="4" value="26" />
					<children>
						<node id="Attributes">
							<attribute id="ActivateSoundEvent" type="22" value="3ea82655-5140-4287-9ab8-794559f182d3" />
							<attribute id="Animation" type="22" value="" />
							<attribute id="PlayOnHUD" type="19" value="False" />
						</node>
					</children>
				</node>
			</children>
		</node>
	</children>
</node>

We actually dont need alot of this stuff to be honest. Our bag is going to be pretty simple and ontop of that we dont care if we let some attributes be inherited from its parent. Lets move this entry into our own merged.lsx and trim the fat and adjust values/handles.

Death_sword\Public\Death_sword\RootTemplates\merged.lsx

<?xml version="1.0" encoding="utf-8"?>
<save> 
	<version major="4" minor="0" revision="6" build="5" />
	<region id="Templates">
		<node id="Templates">
			<children>	
				<node id="GameObjects">
					<attribute id="Description" type="TranslatedString" handle="hfe150b1agf604g4953ga814g734f9e1d47ad" version="1" />
					<attribute id="DisplayName" type="TranslatedString" handle="h3e5dbf1bg7a31g4699gad7egf8461631695d" version="1" />
					<attribute id="Icon" type="FixedString" value="Item_LOOT_GEN_Backpack_A_Posed_A" />
					<attribute id="InventoryType" type="uint8" value="11" />
					<attribute id="LevelName" type="FixedString" value="" />
					<attribute id="MapKey" type="FixedString" value="0619ee4f-25b4-45ef-9cec-8c963ed82d74" />
					<attribute id="Name" type="LSString" value="DeathSword_Bag" />
					<attribute id="ParentTemplateId" type="FixedString" value="ea8cc72a-e078-4ce7-bd63-14bcf1851f46" />
					<attribute id="ReadinessFlags" type="uint32" value="128" />
					<attribute id="Scale" type="float" value="0.5" />							
					<attribute id="Stats" type="FixedString" value="DeathSword_Bag" /> 
					<attribute id="Tooltip" type="uint8" value="2" />
					<attribute id="TreasureOnDestroy" type="bool" value="True" />
					<attribute id="Type" type="FixedString" value="item" />
					<attribute id="WalkThrough" type="bool" value="True" />
					<attribute id="_OriginalFileVersion_" type="int64" value="144115188075855912" />
					<children>
						<node id="GameMaster" />
						<node id="InventoryList">
							<children>
								<node id="InventoryItem">
									<attribute id="Object" type="FixedString" value="DeathSword_Bag_TT" />
								</node>
							</children>
						</node>
					</children>
				</node>	
			</children>
		</node>
	</region>
</save>

Aside from the normal handle changes, lets take a look at what we changed here. Im sure the first thing you noticed was the removal of most of the child node stuff. We only kept the children nodes for GameMaster and InventoryList. We would have removed that as well too if we didnt want to integrate the tutorial chest. For that reason, I wont cover it but just understand this section is just to get our item to spawn in the tutorial chest. I will cover it more when we look at TreasureTables.txt. The most important thing we need to change though is our MapKey. Since this is a new item, I generated a new UUID. We should also change the name to whatever we want our internal item name to be, in my case DeathSword_Bag. The rest of these attributes can be viewed in file insights(TODO).

TreasureTable.txt

TreasureTable is used determine where items can be found in game, like an npc vendor or inside a container, etc. Lets add this entry in:

Death_sword\Public\Death_sword\Stats\Generated\TreasureTable.txt

new treasuretable "TUT_Chest_Potions"
CanMerge 1
new subtable "1,1"
object category "I_DeathSword_Bag",1,0,0,0,0,0,0,0

The intent behind this is to add the DeathSword bag to the Tutorial Chest we summon. Essentially we create a table entry. We add the item to that table and whatever that table references, we can find our item there. Like most often, there are more options that could be added for a treasuretable but lets break it down quickly.

data explanation

  • new treasuretable : An obvious one, basically us denoting our new treasure table. Typically we would name it related to whatever we are doing but this treasure table is actually special, which we can tell from the line below this one, CanMerge, where I will better explain it.

  • CanMerge : If we see CanMerge it means we are going to merge this table with an existing one. That is why the name of the table I made is so specific. The table for the tutorial chest in the base game is TUT_Chest_Potions. Since we want to add our item into it, we need to basically be saying we are adding, or merging, this table into the existing TUT_Chest_Potions table. (1 stands for true, so yes true it can merge basically).

  • new subtable : I will be honest, I used 1,1 for this because the tutorial chest mod i learned from used it. Not sure what it does. I do know that if it is set as -1, the item will appear in whatever table its been added to no matter what, even if the item is unique and already spawned or somethin. Basically, if you want to guarantee it, use -1.

  • object category : This takes alot of parameters. First put your object, prefixied with I_,

Object.txt

Here is where we make our entry for our item, which we do by referring to the MapKey of the item we made in merged.lsx.

Death_sword\Public\Death_sword\Stats\Generated\Data\Object.txt

new entry "DeathSword_Bag"
type "Object"
using "_Container"
data "RootTemplate" "0619ee4f-25b4-45ef-9cec-8c963ed82d74"
data "ValueOverride" "1000"
data "Weight" "0.01"
data "Rarity" "Rare"

Lets cover what this all means really quick.

data explanation

  • new entry : Pretty clear, the name of the item, typically whatever you put as the name in merged.lsx. DeathSword_Bag for me.

  • type : Usually denoting what kind of data entry it is. We are making an object, hence object.

  • using : Like most things in bg3, items will inherit properties from parent/root objects. In our case we want some of the properties to be the default that a container has so we use the _container object which exists in the base game objects file and say we are using its values for whatever we dont define here. For example, we dont define ValueScale here but it is inheriting it from _container. Or how contianer has a weight but since we add a new one below, we override it.(_container is using from _BaseItem, this base item has pretty much most properties set to give a default for all items that inherit)

  • data "RootTemplate" : This should reference the mapkey you used in merged.lsx like I said.

  • The rest are just properties for the bag, like its weight and rarity.

This alone should be enough to just add this new bag into the game when we summon the Tutorial chest. If we loaded up our game and summoned our Tutorial Chest, we will find our bag inside the chest that has spawned in our inventory. Now that we have a simple idea of how to implement the Tutorial Chest as well as how to edit an item to make a new one, lets do this again but for our actual mod, the Death Sword.

Modify An Existing Item To Make A New Item (Death Sword)⬆️

With our Death Sword bag setup, we are ready to create our death sword weapon to place in the bag. Again we will need to turn to the _merged.lsx file in the base game.

merged.lsx/_merged.lsx

Like before, we should look for an existing item that is in the game that we could base our sword off of. In the _merged.lsx I found this entry for what looks like a greatsword.

<node id="GameObjects">
	<attribute id="CanClickThrough" type="19" value="False" />
	<attribute id="CanClimbOn" type="19" value="False" />
	<attribute id="CanShootThrough" type="19" value="True" />
	<attribute id="CoverAmount" type="1" value="0" />
	<attribute id="DisplayName" type="28" handle="h5592fbfagf71fg4bd4gab58gd17bc25b4869" version="2" />
	<attribute id="EquipmentTypeID" type="31" value="8ac2eb82-8563-4657-8c4c-1507573978d7" />
	<attribute id="Icon" type="22" value="Item_WPN_HUM_Greatsword_A_0" />
	<attribute id="IsPointerBlocker" type="19" value="False" />
	<attribute id="LevelName" type="22" value="" />
	<attribute id="LoopSound" type="22" value="" />
	<attribute id="MapKey" type="22" value="2798c9f8-b06b-44d4-9d6c-e6d982c502fa" />
	<attribute id="Name" type="23" value="BASE_WEAPON_Greatswords" />
	<attribute id="ParentTemplateId" type="22" value="f44c9c6f-bc71-42ad-9cad-2dae306e750e" />
	<attribute id="PhysicsTemplate" type="22" value="928451e2-5f3a-6d4c-8e9b-182ce189114b" />
	<attribute id="SoundAttenuation" type="2" value="-1" />
	<attribute id="SoundInitEvent" type="22" value="" />
	<attribute id="Stats" type="22" value="WPN_Greatsword" />
	<attribute id="Type" type="22" value="item" />
	<attribute id="VisualTemplate" type="22" value="037c06e4-86e9-6a94-93b2-0bdccd467356" />
	<attribute id="Wadable" type="19" value="False" />
	<attribute id="WalkOn" type="19" value="False" />
	<attribute id="WalkThrough" type="19" value="True" />
	<attribute id="_OriginalFileVersion_" type="32" value="144115200960758165" />
	<children>
		<node id="Bounds">
			<children>
				<node id="Bound">
					<attribute id="Height" type="6" value="0.0783766" />
					<attribute id="Max" type="12" value="0.0793875 0.03607 0.163658" />
					<attribute id="Min" type="12" value="-0.0793875 -0.015371 -0.804635" />
					<attribute id="Radius" type="6" value="0.2330765" />
					<attribute id="Shape" type="1" value="1" />
					<attribute id="Type" type="1" value="0" />
				</node>
				<node id="Bound">
					<attribute id="Height" type="6" value="0.0783766" />
					<attribute id="Max" type="12" value="0.158775 0.03607 0.327316" />
					<attribute id="Min" type="12" value="-0.158775 -0.015371 -1.60927" />
					<attribute id="Radius" type="6" value="0.466153" />
					<attribute id="Shape" type="1" value="1" />
					<attribute id="Type" type="1" value="1" />
				</node>
				<node id="Bound">
					<attribute id="Height" type="6" value="0.0783766" />
					<attribute id="Max" type="12" value="0.158775 0.03607 0.327316" />
					<attribute id="Min" type="12" value="-0.158775 -0.015371 -1.60927" />
					<attribute id="Radius" type="6" value="0.466153" />
					<attribute id="Shape" type="1" value="1" />
					<attribute id="Type" type="1" value="2" />
				</node>
			</children>
		</node>
		<node id="Tags">
			<children>
				<node id="Tag">
					<attribute id="Object" type="31" value="ef13fc1c-dd55-4167-ab82-88059e5798f3" />
				</node>
				<node id="Tag">
					<attribute id="Object" type="31" value="aec4ed1a-993b-491f-a2db-640bf11869c1" />
				</node>
			</children>
		</node>
	</children>
</node>

The name being called BASE_WEAPON_Greatswords is the best giveaway that this is the base item we are looking for, in terms of greatswords. Even this entry has a parentid but since we want the default parameters of greatswords, we dont want to keep generalizing our item more and more if that makes sense by going higher up the family tree. Anyways, now that we have a MapKey, lets look for an item in _merged that has the MapKey as its ParentTemplateId so we can mimic that entry for our own item so it adopt everything we need from BASE_WEAPON_Greatswords. I found this entry for WPN_HUM_Greatsword_A_0 that has the ParentTemplateId that matches the MapKey of the BASE_WEAPON_Greatswords. Lets take a look.

<node id="GameObjects">
	<attribute id="CanShootThrough" type="19" value="True" />
	<attribute id="Description" type="28" handle="hab6f5de3gc76fg4832g81bbgf1c21bdea4f9" version="1" />
	<attribute id="DisplayName" type="28" handle="h48b32e1ege1feg4e8ag890fg5fc966fffbf6" version="1" />
	<attribute id="EquipmentTypeID" type="31" value="8ac2eb82-8563-4657-8c4c-1507573978d7" />
	<attribute id="Flag" type="4" value="0" />
	<attribute id="Icon" type="22" value="Item_WPN_HUM_Greatsword_A_0" />
	<attribute id="IsInspector" type="19" value="True" />
	<attribute id="LevelName" type="22" value="" />
	<attribute id="LevelOverride" type="4" value="-1" />
	<attribute id="MapKey" type="22" value="ecfb9f69-5bc3-402e-acd8-c91d57e28403" />
	<attribute id="Name" type="23" value="WPN_HUM_Greatsword_A_0" />
	<attribute id="ParentTemplateId" type="22" value="2798c9f8-b06b-44d4-9d6c-e6d982c502fa" />
	<attribute id="PhysicsTemplate" type="22" value="b8ae24d1-753f-865f-d6ce-fd99297bb9e2" />
	<attribute id="Race" type="27" value="0" />
	<attribute id="ReadinessFlags" type="5" value="128" />
	<attribute id="Stats" type="22" value="WPN_Greatsword" />
	<attribute id="Tooltip" type="1" value="2" />
	<attribute id="Type" type="22" value="item" />
	<attribute id="VisualTemplate" type="22" value="12f3193c-ce1a-5a69-1bf0-8537b9b606f9" />
	<attribute id="WalkThrough" type="19" value="True" />
	<attribute id="_OriginalFileVersion_" type="32" value="144115188075855930" />
	<children>
		<node id="Bounds">
			<children>
				<node id="Bound">
					<attribute id="Height" type="6" value="0.0783766" />
					<attribute id="Max" type="12" value="0.158775 0.03607 0.327316" />
					<attribute id="Min" type="12" value="-0.158775 -0.015371 -1.60927" />
					<attribute id="Radius" type="6" value="0.466153" />
					<attribute id="Shape" type="1" value="1" />
					<attribute id="Type" type="1" value="1" />
				</node>
				<node id="Bound">
					<attribute id="Height" type="6" value="0.0783766" />
					<attribute id="Max" type="12" value="0.158775 0.03607 0.327316" />
					<attribute id="Min" type="12" value="-0.158775 -0.015371 -1.60927" />
					<attribute id="Radius" type="6" value="0.466153" />
					<attribute id="Shape" type="1" value="1" />
					<attribute id="Type" type="1" value="2" />
				</node>
				<node id="Bound">
					<attribute id="Height" type="6" value="0.0783766" />
					<attribute id="Max" type="12" value="0.0793875 0.03607 0.163658" />
					<attribute id="Min" type="12" value="-0.0793875 -0.015371 -0.804635" />
					<attribute id="Radius" type="6" value="0.2330765" />
					<attribute id="Shape" type="1" value="1" />
					<attribute id="Type" type="1" value="0" />
				</node>
			</children>
		</node>
		<node id="GameMaster">
			<attribute id="GameMasterSpawnSubSection" type="28" handle="he788bc00ga31fg49a2g9f9ag9b43911e5efa" version="1" />
		</node>
		<node id="InventoryList">
			<children>
				<node id="InventoryItem">
					<attribute id="Object" type="22" value="Empty" />
				</node>
			</children>
		</node>
		<node id="OnDestroyActions">
			<children>
				<node id="Action">
					<attribute id="ActionType" type="4" value="26" />
					<children>
						<node id="Attributes">
							<attribute id="ActivateSoundEvent" type="22" value="3ea82655-5140-4287-9ab8-794559f182d3" />
							<attribute id="Animation" type="22" value="" />
							<attribute id="PlayOnHUD" type="19" value="False" />
						</node>
					</children>
				</node>
			</children>
		</node>
		<node id="Tags">
			<children>
				<node id="Tag">
					<attribute id="Object" type="31" value="abadcad5-9229-4999-8c7a-cd557ff2c95c" />
				</node>
			</children>
		</node>
	</children>
</node>

Just like before, lets strip out what we dont need and lets add it above our entry for Death Bag in the merged.lsx file we made. I changed the handles and generated a new unique MapKey for the entry.

Death_sword\Public\Death_sword\RootTemplates\merged.lsx

<?xml version="1.0" encoding="utf-8"?>
<save> 
	<version major="4" minor="0" revision="6" build="5" />
	<region id="Templates">
		<node id="Templates">
			<children>	
				<node id="GameObjects">
					<attribute id="CanShootThrough" type="bool" value="True" />
					<attribute id="Description" type="TranslatedString" handle="h8906cc3dgc916g44ccg8973g0b329b67203b" version="1" />
					<attribute id="DisplayName" type="TranslatedString" handle="h3f818017gb447g45d2ga1b5gb255b36c4556" version="1" />
					<attribute id="EquipmentTypeID" type="guid" value="f85002a2-8e0e-4a49-0faa-2ef57d983a3a" />
					<attribute id="Flag" type="int64" value="0" />
					<attribute id="Icon" type="FixedString" value="Item_MAG_Giantslayer_Greatsword" />
					<attribute id="IsInspector" type="bool" value="True" />
					<attribute id="LevelName" type="FixedString" value="" />
					<attribute id="LevelOverride" type="int64" value="-1" />
					<attribute id="MapKey" type="FixedString" value="e877d728-e895-4aea-a8c3-0c4abea5e278" />
					<attribute id="Name" type="LSString" value="DeathSwordGreatsword" />
					<attribute id="ParentTemplateId" type="FixedString" value="2798c9f8-b06b-44d4-9d6c-e6d982c502fa" />
					<attribute id="PhysicsTemplate" type="FixedString" value="1b42ed05-5c92-3c8f-fcdf-b203fdc45769" />
					<attribute id="Race" type="int8" value="0" />
					<attribute id="ReadinessFlags" type="uint32" value="144" />
					<attribute id="Stats" type="FixedString" value="DeathSwordGreatsword" />
					<attribute id="Tooltip" type="uint8" value="2" />
					<attribute id="Type" type="FixedString" value="item" />
					<attribute id="VisualTemplate" type="FixedString" value="441ea20b-53f4-005d-bdcb-6e195817d545" />
					<attribute id="WalkThrough" type="bool" value="True" />
					<attribute id="_OriginalFileVersion_" type="int64" value="144115188075855912" />
					<children>
						<node id="GameMaster" />
						<node id="OnDestroyActions">
							<children>
								<node id="Action">
									<attribute id="ActionType" type="int64" value="26" />
									<children>
										<node id="Attributes">
											<attribute id="ActivateSoundEvent" type="FixedString" value="3ea82655-5140-4287-9ab8-794559f182d3" />
											<attribute id="Animation" type="FixedString" value="" />
											<attribute id="PlayOnHUD" type="bool" value="False" />
										</node>
									</children>
								</node>
							</children>
						</node>
					</children>
				</node>
				<node id="GameObjects">
					<attribute id="Description" type="TranslatedString" handle="hfe150b1agf604g4953ga814g734f9e1d47ad" version="1" />
					<attribute id="DisplayName" type="TranslatedString" handle="h3e5dbf1bg7a31g4699gad7egf8461631695d" version="1" />
					<attribute id="Icon" type="FixedString" value="Item_LOOT_GEN_Backpack_A_Posed_A" />
					<attribute id="InventoryType" type="uint8" value="11" />
					<attribute id="LevelName" type="FixedString" value="" />
					<attribute id="MapKey" type="FixedString" value="0619ee4f-25b4-45ef-9cec-8c963ed82d74" />
					<attribute id="Name" type="LSString" value="DeathSword_Bag" />
					<attribute id="ParentTemplateId" type="FixedString" value="ea8cc72a-e078-4ce7-bd63-14bcf1851f46" />
					<attribute id="ReadinessFlags" type="uint32" value="128" />
					<attribute id="Scale" type="float" value="0.5" />							
					<attribute id="Stats" type="FixedString" value="DeathSword_Bag" /> 
					<attribute id="Tooltip" type="uint8" value="2" />
					<attribute id="TreasureOnDestroy" type="bool" value="True" />
					<attribute id="Type" type="FixedString" value="item" />
					<attribute id="WalkThrough" type="bool" value="True" />
					<attribute id="_OriginalFileVersion_" type="int64" value="144115188075855912" />
					<children>
						<node id="GameMaster" />
						<node id="InventoryList">
							<children>
								<node id="InventoryItem">
									<attribute id="Object" type="FixedString" value="DeathSword_Bag_TT" />
								</node>
							</children>
						</node>
					</children>
				</node>	
			</children>
		</node>
	</region>
</save>

TreasureTable.txt

Like we did with our Death Bag, lets add our Death Sword into a treasure table. More specifically, lets move it into the Death Bag so we can get it whenever we summon the Tutorial Chest.

Death_sword\Public\Death_sword\Stats\Generated\TreasureTable.txt

new treasuretable "TUT_Chest_Potions"
CanMerge 1
new subtable "1,1"
object category "I_DeathSword_Bag",1,0,0,0,0,0,0,0

new treasuretable "DeathSword_Bag_TT"
new subtable "1,1"
object category "I_DeathSwordGreatsword",1,0,0,0,0,0,0,0

Here we can see that I added a new treasure table entry. Standard convention is to add the prefix TT for a treasure table you add. Also like before you see we added the I before the object name in object category, I believe this is required and even if not, it's good standard convention.

Weapon.txt

Weapon.txt is basically the same thing as Object.txt from earlier but for weapons instead of objects. Lets make an entry for our new weapon. We are making a greatsword so lets take a look at a greatsword entry in the games base Weapon.txt file. I found this entry for a pretty basic greatsword.

new entry "WPN_Greatsword_1"
type "Weapon"
using "WPN_Greatsword"
data "RootTemplate" "1a2a58b7-4bd5-44d5-b1fe-8cd7e5b53def"
data "ValueUUID" "4cd41c74-9c86-4233-922e-4db5bc750df5"
data "Rarity" "Uncommon"
data "DefaultBoosts" "WeaponEnchantment(1);WeaponProperty(Magical)"
data "Weapon Properties" "Twohanded;Heavy;Melee;Dippable;Magical"

Lets adjust this to our needs. Death_sword\Public\Death_sword\Stats\Generated\Data\Weapon.txt

new entry "DeathSwordGreatsword"
type "Weapon"
using "WPN_Greatsword"
data "RootTemplate" "e877d728-e895-4aea-a8c3-0c4abea5e278"
data "ValueUUID" "4cd41c74-9c86-4233-922e-4db5bc750df5"
data "Rarity" "VeryRare"
data "DefaultBoosts" "WeaponEnchantment(1);WeaponProperty(Magical)"
data "Weapon Properties" "Twohanded;Heavy;Melee;Dippable;Magical"

The main thing we need to make sure we change is that RootTemplate, it needs to point to the MapKey of the entry we created for our sword in our merged.txt file. And dont forget to change the name. If you were to load up the game right now you will be able to find the death sword in the death bag! The rarity has changed since I changed that to indicate its a new item from the one we copied. Feel free to go smack something with it! Some of the visuals may be off, id guess I would need to modify merged a bit more or perhaps inherit from another class. I plan on updating this guide for that soon, sorry.

Last edit 1/27 2:26 pm

Minor edit 3/15 going to start trying to update my guides more since I guess people actually read them lol

⚠️ **GitHub.com Fallback** ⚠️