↜ Add a new weapon to the game! by WNG ↝
Introduction
Hello! This guide will show you how to create new uniques items and how to make them available in the game (to be dropped and found in chests.) I'll use a sword for this example, but any other item type would work just the same way.
I may assume you have some basic knowledge and overlook some manipulations. Feel free to tell me if anything is unclear.
I. Copy and recolor an item
This step will require:
- ARC Explorer
Used to extract files from the archives of the game.
Download it here : https://www.kirmiziperfect.com/titan-quest-immortal-throne-arc-explorer-tool/ - TEX Viewer
Used to convert game's textures into an editable format.
Download it here : https://www.kirmiziperfect.com/titan-quest-immortal-throne-texture-viewer-tool/ - Software for image-editing
Used to edit textures and give new looks to our items. To do so, you will need a software that edit images, such as Photoshop. If you don't own it, GIMP is a free software that will suffice for this task. MS Paint just won't cut it.
I. Gather ressources:
The plan is to start from an existing item, take its textures and give it a new hue. Start by opening your Art Manager and open your mod. Click on Database > Import Record... and browse to an item you want to work from. For this tutorial, I will make a new blade. Here's where the swords are stored.
records\item\equipmentweapon\sword
records\xpack\item\equipmentweapons\sword
records\xpack2\item\equipmentweapons\sword
Pick the one of your choice. For this tutorial, I'll pick the sword Silence.
records\item\equipmentweapon\sword\u_e_silence.dbr
Select it and press OK. The original sword is now loaded in your mod for consultation. Open the file and go to Actor Variables. Look at the file path that is set at "baseTexture". For Silence, it's this :
Items\EquipmentWeapon\Sword\Default\RSword05C.tex
Now this is where ARC Explorer comes in. Open it, press File > Open and go to this directory : C:\Program Files (x86)\Steam\steamapps\common\Titan Quest Anniversary Edition\Resources
When you get there, you will notice a bunch of .arc files. That's where the game's assets are stored. Now, open Items.arc, or choose the one located in the XPack/XPack2 folder if you chose an item from an expansion.
You will see a bunch of folders appear. Browse to find the texture file as seen in the "baseTexture". Double click on it, and save it where you wish. This is the texture applied to item in a 3D environment. Also, go to the Item Parameters tab, and also import the texture that's specified on the "bitmap" field. It's the texture used to represent the item in your inventory.
II. Edit the textures:
When the two textures have been exported, launch TEX Viewer. Open one of the newly imported textures. Once opened, all you have to do File > Export, and save it under another name. Make sure to add the ".tga" extension at the end, or you will receive an error message.
Now, open your image-editing software. Open your .tga files and edit them as you please. I simply changed their color, turning the green of the blade with a red and the yellow handle was turned into gray.
Texture:
(https://i.imgur.com/4zn2fxH.png)
UI Bitmap:
(https://i.imgur.com/1iMx7XR.png)
Save your work, still in .tga format.
III. Import your texture into your mod:
Open the Art Manager and select your mod. It will now be time to import your texture into your mod. Before importing it, I'd recommend creating a folder specifically for your custom textures. To do so, right-click on "name_of_your_mod/source > Create New Directory".
Now, select the matching folder, right-click, and select "Import...". Find your texture and select it. It should appear in the menu. Right-click it and choose Auto-Create Asset. You will be prompted to choose between Texture or Bitmap. Choose Bitmap, and proceed by pressing OK.
(https://i.imgur.com/nG0qJO1.png)
IV. Build your texture:
Your texture isn't quite in your mod yet. You will need to visit the "Assets" tab, and seek your texture in the folder structure, wich should be the same as in your "Source" tab. Right-click on it and choose "Build". When that is done, build your mod by pressing F7. Your texture will now become usable in your mod.
(https://i.imgur.com/Sw9SJoU.png)
II. Create your new item
I. Copy an item:
Right-click on the .dbr of the item and copy it. Paste it where you like (I did in a custom directory) to create a new instance. Rename it, then right-click > Build.
(https://i.imgur.com/MxN0H20.png)
II. Edit your new item:
Open your new item. There is a few parameters that you are going to be interested in editing. See the Spoiler below for details. Irrelevant parameters are omitted.
General parameters
Item Parameters
Item Name Tag: The name of your item. Reference it in your ModStrings.txt. More info here : https://titanquest.fandom.com/wiki/Modstrings.txt
Bitmap: Texture file of your item when in the inventory. !! Include your own texture here !!
ItemCostName: Contains equations that, when combined with the ItemLevel value below, sets automatic requirements. For more control and simplicity, I recommend to set them manually.
ItemSetName: .dbr file that refers to the set your item belongs to.
ItemClassification: Rarity of your item.
Item Requirements
Self-explanatory.
Actor Variables
BaseTexture: Texture of your item in a 3D environement. !! Include your own texture here !!
Item Parameters (the actual stats of your item)
This is a review of the many (not all!) basic parameters you may set on your item. If you know about those, skip this.Many of the parameters share the same proprietes. I'll explain them once.Offensive ParametersOffensive Global (for offensive bonuses with a global chance (5% of +10% Total Damage, +20% Poison Damage, ...))
- offensiveGlobalChance : Chance of offensive global effects to occur (choose the effects with booleans in the sections below.)
Offensive Absolute (for flat/percent based damage bonuses)
(https://i.imgur.com/Xxvinq4.png)
- offensiveXMin : Minimum of flat X damage.
- offensiveXMax : Maximum of flat X damage.
- offensiveXChance : Chance of the X damage set above to occur.
- offensiveXXOR : Boolean. Set to 1 to select only one bonus in the global pool.
- offensiveXGlobal : Boolean. Set to 1 to make the bonus part of the global chance pool.
- offensiveXModifier : Increases by X% the damage of the selected type.
- offensiveXModifierChance : Chance of the percent damage bonus to occur.
Offensive Duration (for damage/debuffs over time bonuses)
(https://i.imgur.com/poQSMAJ.png)
- offensiveSlowXMin : Minimum of X damage over time (every second).
- offensiveSlowXMax : Maximum of X damage over time (every second).
- offensiveSlowXDurationMin : Minimal duration of the DoT effect.
- offensiveSlowXDurationMax : Maximial duration of the DoT effect.
- offensiveSlowXChance : Chance of the X damage over time set above to occur.
- offensiveSlowXXOR : Boolean. Set to 1 to select only one bonus in the global pool.
- offensiveSlowXGlobal : Boolean. Set to 1 to make the bonus part of the global chance pool.
- offensiveSlowXModifier : Increases by X% the damage of the selected type.
- offensiveSlowXModifierChance : Chance of the percent damage bonus to occur.
- offensiveSlowXDurationModifier : Increases the duration of the DoT effect by x%.
Offensive Influence (for debuffs for a set duration, such as Confusion, Mind-Control, etc.)
See the above sections, they share similar parameters.
Retaliation ParametersRetaliation Global (for retaliation bonuses with a global chance (5% of 15 Piercing Retaliation, 20 Elemental Retaliation, ...))
- retaliationGlobalChance : Chance of retaliation global effects to occur (choose the effects with booleans in the sections below.)
Retaliation Absolute (for flat retaliation bonuses)
(https://i.imgur.com/kQrDqM6.png)
- retaliationXMin : Minimal damage of the retaliation of the set type.
- retaliationXMax : Maximal damage of the retaliation of the set type.
- retaliationXChance : Chance of the retaliation to occur.
- retaliationXXOR : Boolean. Set to 1 to select only one bonus in the global pool.
- retaliationXGlobal : Boolean. Set to 1 to make the bonus part of the global chance pool.
- retaliationXModifier : Boosts the damage of the retaliation of X type by a set percent.
- retaliationXModifierChance : Chance of the percent damage boost to occur.
Retaliation Duration (for DoT retaliation bonuses)
(https://i.imgur.com/ABXC3sK.png)
- retaliationSlowXMin : Minimal damage of the retaliation of the set type (per second.)
- retaliationSlowXMax : Maximal damage of the retaliation of the set type (per second.)
- retaliationSlowXDurationMin : Minimal duration of the DoT of the set type.
- retaliationSlowXDurationMax : Minimal damage of the DoT of the set type.
- retaliationSlowXChance : Chance of the retaliation to occur.
- retaliationSlowXXOR : Boolean. Set to 1 to select only one bonus in the global pool.
- retaliationSlowXGlobal : Boolean. Set to 1 to make the bonus part of the global chance pool.
- retaliationSlowXModifier : Boosts the DoT of the retaliation of X type by a set percent.
- retaliationSlowXModifierChance : Chance of the percent DoT boost to occur.
- retaliationSlowXDurationModifier : Boosts the DoT of X type's duration by a set percent.
- retaliationSlowXDurationModifierChance : Chance of the percent duration boost to occur.
Defensive ParametersDefensive Absolute (for resistances bonuses)
(https://i.imgur.com/QRTHLNF.png)
- defensiveX : Increases resistance to the damage type of by a set percent.
- defensiveXChance : Chance of the resistance to the damage type of by the percent set above.
- defensiveXModifier : Increases the resistance bonus by a set percent.
- defensiveXModifierChance : Chance of the resistance bonus to the damage type by the percent set above.
- defensiveXDuration : Same as above, for the matching DoT.
- defensiveXDurationChance : Same as above, for the matching DoT.
- defensiveXDurationModifier : Same as above, for the matching DoT.
- defensiveXDurationModifierChance : Same as above, for the matching DoT.
Defensive Special (for resistances versus certain DoTs)
See the Defensive Absolute section, they share similar parameters.
Defensive Misc (for blocking/reflecting bonuses)
See the Defensive Absolute section, they share similar parameters.
Defensive Influence (for secondary resistances)
See the Defensive Absolute section, they share similar parameters.
Monster Defense (for tertiary resistances)
See the Defensive Absolute section, they share similar parameters.
Character ParametersCharacter Base AttributescharacterBaseAttackSpeed : Base Attack Speed.
characterBaseAttackSpeedTag : Displayed Attack Speed.
Character Bonus Attributes (for direct stats bonuses)
(https://i.imgur.com/9Ujupm4.png)
- characterStrenght : Flat strenght increase.
- characterDexterity : Flat dexterity increase.
- characterIntelligence : Flat intelligence increase.
- characterLife : Flat health points increase.
- characterMana : Flat energy points increase.
- characterStrenghtModifier : Percent strenght increase.
- characterDexterityModifier : Percent dexterity increase.
- characterIntelligenceModifier : Percent intelligence increase.
- characterLifeModifier : Percent health points increase.
- characterManaModifier : Percent energy points increase.
- characterIncreasedExperience : Increases experience gained.
- characterPhysToElementalRation : x% converted to elemental damage.
Character Speed (for speed bonuses)
(https://i.imgur.com/ISOF79h.png)
- characterRunSpeed : Increases base run speed. Unused at this date.
- characterAttackSpeed : Increases base attack speed. Unused at this date.
- characterSpellCastSpeed : Increases base spell cast speed. Unused at this date.
- characterRunSpeedModifier : Increases run speed by x%.
- characterAttackSpeedModifier : Increases attack speed by x%.
- characterSpellCastSpeedModifier : Increases spell cast speed by x%.
- characterTotalSpeedModifier : Increases total speed by x%.
Character Regeneration (for regeneration bonuses)
(https://i.imgur.com/AYKUZ7F.png)
- characterLifeRegen : Increases health regeneration by a flat amount.
- characterManaRegen : Increases energy regeneration by a flat amount.
- characterLifeRegenModifier : Increases health regeneration by a percent amount.
- characterManaRegenModifier : Increases energy regeneration by a percent amount.
Character Ability (for dodge/critical hit bonuses)
(https://i.imgur.com/lBlQEQq.png)
- characterOffensiveAbility : Increases OA by a flat amount.
- characterDefensiveAbility : Increases DA by a flat amount.
- characterOffensiveAbilityModifier : Increases OA by a percent amount.
- characterDefensiveAbilityModifier : Increases DA by a percent amount.
- characterDefensiveBlockRecoveryReduction : Reduces shield recovery time.
- characterEnergyAbsorptionPercent : Recovers energy when hit by spells by percent amount.
- characterDodgePercent : Increases melee attack dodge chance.
- characterDeflectProjectile : Increases projectile dodge chance.
Character Reserve (for mana reservation reduction bonuses)
(https://i.imgur.com/M1j6qj9.png)
- characterManaLimitReserve : Not quite sure...
- characterManaLimitReserveReduction : Decreases energy reserved by a flat amount.
- characterManaLimitReserveModifier : Not quite sure...
- characterManaLimitReserveReductionModifier : Decreases energy reserved by a percent amount.
Requirement Reduction (for requirement reduction bonuses)
(https://i.imgur.com/6lN23fu.png)
Self-explanatory. Also, you do NOT need to add the negative.
Skill Parameters (for bonuses that regard spells)
Skill Reduction (for reduced recharge and mana costs)
(https://i.imgur.com/q6UV1Nj.png)
- skillCooldownReduction : Flat cooldown reduction.
- skillCooldownReductionChance : Chance of flat cooldown reduction.
- skillManaCostReduction : Flat mana cost reduction.
- skillManaCostReductionChance : Chance of flat mana cost reduction.
- skillCooldownReductionModifier : Percent cooldown reduction.
- skillCooldownReductionModifierChance : Chance of percent cooldown reduction.
- skillManaCostReductionModifier : Percent mana cost reduction.
- skillManaCostReductionModifierChance : Chance of percent mana cost reduction.
Projectile Bonus (for projectile speed)
- skillProjectileSpeedModifier : Percent increase of the projectile speed.
- skillProjectileSpeedModifierChance : Chance of percent increase of the projectile speed.
Skill Augment (boosts or grants skills)
(https://i.imgur.com/ExDpbM2.png)
- augmentSkillName1 : The database entry of the skill you wish to boost. (ex.: records\skills\stealth\envenomweapon.dbr)
- augmentSkillLevel1 : Level by wich the skill above is increased.
- augmentSkillName2 : The database entry of ANOTHER the skill you wish to boost.
- augmentSkillLevel2 : Level by wich the skill above is increased.
- augmentMasteryName1 : The database entry of a mastery you wish to boost all of its skills.
- augmentMasteryLevel2 : Level by wich the skills of the mastery above is increased.
- augmentMasteryName2 : The database entry of ANOTHER mastery you wish to boost all of its skills.
- augmentMasteryLevel2 : Level by wich the skills of the mastery above is increased.
See this for masteries names :
- Warfare : records\skills\warfare\warfaremastery.dbr
- Defense : records\skills\defensive\defensivemastery.dbr
- Rogue : records\skills\stealth\stealthmastery.dbr
- Hunting : records\skills\hunting\huntingmastery.dbr
- Dream : records\xpack\skills\dream\dreammastery.dbr
- Nature : records\skills\nature\naturemastery.dbr
- Earth : records\skills\earth\earthmastery.dbr
- Storm :records\skills\storm\stormmastery.dbr
- Runes : records\xpack2\skills\runemaster\runemaster_mastery.dbr
- Spirit :records\skills\spirit\spiritmastery.dbr
- augmentAllLevel : Level by wich all skills should be increased.
- itemSkillName : See the part IV.
- itemSkillLevel : See the part IV.
- itemSkillAutoController : See the part IV.
Racial Bonus (for increased offense/defense versus certain races)
(https://i.imgur.com/DdRCtNL.png)
- racialBonusRace : Races that will be affected by the bonuses below. You can have as many as you like.
- racialBonusPercentDamage : Percent damage increase versus the race.
- racialBonusAbsoluteDamage : Flat damage increase versus the race.
- racialBonusPercentDefense : Percent reduced damage received from the race.
- racialBonusAbsoluteDefense : Flat reduced damage received from the race.
Pet Bonus (for bonuses to all pets)
- petBonusName : Select a pet bonus for the item. May explain the creation of one of these later.
Give the item the stats of your choosing. When you are done, right-click on it and build your .dbr.
Woooh, a very detailed guide. :)
Although i do not modding, i find it useful to understand how it works.
I have a few questions:
- how item grant skills are implemented (passive or active skills) ?
- have you a way to attach a particular graphical effect or even a sound effect to an item (like a broken glass sound for a cold weapon) ?
- how work the loot tables ?
In particular what i don't undestand is, say, you have a loot table shared for 10 items. If you add 10 more new items, does it mean you double the global drop rate or does it mean you spare a mean global drop rate among all the items (old+new)?
Question 1:
This is where you setup the "Grants Skill" on any item that can hold one.
(https://i.imgur.com/dwuA62d.png)
At itemSkillName, you set the .dbr file of the skill you want to be granted.
At itemSkillLevel, you determine which level will the skill be at.
At itemSkillAutoController, you set a special .dbr that determines under wich conditions will the skill be used automatically. If omitted, the skill will be available in your skill tab.
Question 2:
Of course. You can set a sound for when you swipe and for when you hit with the weapon. The sound when you drop it on the ground or in your inventory isn't hardcoded either, so it can be virtually anything you wish. And yes, it can also have particle effects attached to it like Pagos or Iris if you edit the mesh.[/li][/list]
Question 3:
Well, there's different types of loot tables, but I guess you want to know how the uniques' loot tables work. Here's how they work.
First, it begins with a monster's loot pages. You see it has 100% chance to have a weapon equipped on its right hand. Then, it can choose from up to 6 arrays of loot tables (arrays that contains one loot table per difficulty). Though, most monters only have 2 arrays of loot tables : one for common items, one for uniques. This hero has 13 chances versus 5000 to wield a unique weapon, so it's roughly 0.26%.
(https://i.imgur.com/foH1iC4.png)
Considering you fall on the uniques' loot table, wich act differently from commons' loot tables, it simply picks an item from the array. Each act and difficulty has its own array of uniques.
(https://i.imgur.com/gP3mrLD.png)
Hope this answers your questions ^^