Modifying item stats

+
Modifying item stats

Greetings fellow Witcher fans,

Im a first time modder attempting to make something that is probably overly ambitious, but im still motivated to try. Plan is to de-level all items and monsters and change item statistics in such a manner that there are no useless weapons, just different weapons.

I've run into a problem right away which is i can't make sense of the file system and i can't seem to find right information.
Example:
DamLocation.jpg
Steel swords seem to be missing the entry for their main damage type file here is def_items_weapons.xml, but i haven't been able to find the entry in any other file either.
Did i miss something while uncooking? Is it in completely different document?
If there is a comprehensive guide to modding items I would be happy if you could link it.

Cheers!
 
Last edited:
What you're looking at in the image you posted are the base templates for leveled swords generated by the autogen system. The autogen is handled by scripts and assigns each item with base damage or armor rating based on its assigned item level at the time of creation. The file really has 2 parts: if you scroll down you will find a second section whichs includes TAGS assigned to each item. One of those tags is 'autogen'. To give an item a fixed level, you would remove the autogen tag in the bottom section and add a slashing_damage or silver_damage stat in the top section. However, that's not such a great idea for this file. These autogen swords are going to crop up in loot tables throughout the game.

You might take take a look at the crafted swords xml. There you will find items that receive a fixed item level based on their damage stats in the xml.

 
To add some more info:

There are 2 kinds of weapon/armor items in these xml files. What you're looking at here are items that can be found throughout the game that get an item level based on your current level. The scripts then assign that item stats appropriate for that item level. These items carry the 'autogen' tag and don't have assigned primary stats in the xml.

The second type of item are those who always have a specific item level: certain unique relics, Witcher gear, and all crafted items. These have assigned primary stats in the xml, then the scripts give them an item level appropriate for their stats and quality (master, Magic, relic, Witcher, etc).

I'm not sure what it would mean to 'unlevel' weapons and monsters. Do you want all monsters to remain at level 1, and all weapons to remain within a limited range of damage stats? I can sort of see how that would work, but you would need to dive into some scripts to stop monsters from gaining levels. Or, you could change the monster levelup stats and the leveldiff bonuses so that they do not gain health per level. Then you could remove all the 'autogen' tags from weapons and armor and give them specific damage and armor rating stats. The items you make will still be assigned item levels based on the stats you give them, but it might be possible to edit the script gameParams.ws to force item level 1 regardless of their stats.

Yeah I can see this being possible. Study the crafted item xml files, and check out monster_base_abl_new.xml and monster_base_abl.xml. You would want to tweak the levelups and the high/deadly monster buffs. Also opp_base_abl.xml for npc levels. Then you need to crack open scriptstudio and look at the bottom of gameParams.ws for how items are assigned item level based on stats.

I'd be glad to help you along if you post here with more questions. Good luck and have fun.
 
Ok, sorry I wish I could edit my posts to add to them. Your quest here really got me thinking so I keep coming up with refined ideas.

So your unleveling idea is cool and I think it could work. You need to identify all of the xml files for pc weapons and maybe armor, too? You would remove all the 'autogen' related tags and assign specific primary stats to those that are undefined. These items will still be assigned an item level based on their given stats, which you will discover in-game when they spawn. Depending on what stats you give them and item quality, their item levels will probably be within a limited range. Is your intention to keep them close to item level 1, or to choose your own damage value range? If the item level range you end up with is a problem, you might then need to dig into the scripts to force them to item level 1, but this might be a little tricky.

As for monsters, I would suggest just setting the essence per level to 0, and tweaking the level diff buffs as well. The monster_base_abl.xml also has specific buffs for specific enemies throughout the game, as well as the base stats for each monster type. This will likely need some balancing work after such a radical change to sword stats. I'm thinking specifically of armor rating, which would probably have a bigger effect for more of the game if the sword damage stats are not growing.

The weapons file in the picture you linked is actually a great place to start. Remove the autogen tags and then add slashing_damage or silver_damage stats depending on sword type. I guess you would also be messing around with all the secondary stats to make each item unique. For that part of the project, create a simple text file to copy/paste samples of these stats from other xml files. So, open up relic swords xml and copy the lines for all the different kinds of sword stats, which you can then copy/paste into the stats for different swords.
 
Again, sorry.

A key question about your mod is whether the item stats are going to hover around the default item level 1 range, or whether you want some swords/armor to have significantly higher stats without increasing their item level.

If you go for the first concept, your job will be pretty simple. First, remove all the autogen tags and assign those items damage/armor stats that place them within the item level range you want. Then you would also need to adjust all the crafted/unique items to have stats within your chosen range as well. For example, all of the Witcher gear pieces have specific item levels based on damage and armor rating. You would need to adjust those down to the right range for your mod.

If, however, you end up with some items with a significantly higher item level based on the stats you gave them, you might end up needing or wanting to change the scripts that assign item levels based on stats. Doing this might be tricky but it's also potentially advantageous. If you could force item level 1 onto every sword and armor item, then you would have total freedom to assign stats without worrying about changes in item level.

It's hard to predict how your unleveled gear would interact with monsters as the game progresses, even if you prevent them from gaining health. So, look forward to a lot of playtesting. I recommend getting real familiar with the console commands to add items to your inventory, gain levels, and spawn monsters.
 
gogabus Dude, thank you

Method you're describing sounds exactly what im looking for the items. Item level could be tricky since i was hoping to make them all level 1.
Starting plan is to split weapons and armor into categories based on the preferred play style.
Example: Weapons
Brutal - Higher base damage, attack power modifiers, effects like stun
Finesse - Armor piercing, critical damage modifiers, effects like bleed
Magic - Lower base damage, boosts signs, magic effects like burning and freeze

Im going to try this de-leveling thing first and then see if i can build a proper mod around it. I have dreams about changing abilities, making crits condition based and adding potion buffs to relic weapons etc. :D
 
Ok yes, I see where you're going with this. The best thing would be to change the scripts to make all items level 1 regardless of stats. Like I said, this might be tricky or it might be simple. I don't have my gear in front of me and I'm away on a trip, otherwise I would test some solutions myself. But iirc, you need to look to the bottom of gameParams.ws where item level is scaled to primary stats for swords and armor. You would be looking to comment out or delete the setup they have now where an item level is produced based on stats. Replace with something like

level = 1;

or whichever term is actually being used. This would give you the freedom to set your own damage values without worrying about item level. But like I said, the item level stuff is tricky. There are multiple scripts handling it and a lot of weird randomization in different parts. There is a modder named wghost81 who did a lot of work on this and understands it better than I do.

One small thing to note here is about armor penetration. Human npc's are almost all missing this stat, so it should really only be used for silver weapons.

As for conditional effects, that's totally possible. You'll be looking at damageManagerProcessor.ws script for those. You could accomplish that through item tags. For example, let's say you want 'brutal' weapons to do 300% bonus damage to enemies that are stunned. You can create any tag you want and add it to an item in the 'bottom' section of the xml where the tags are written. Something like

<tags> weapon, sword, brutalWeapon, etc etc </tags>

Then in damageManagerProcessor.ws you can introduce a new conditional that checks for your brutalWeapon tag and if the victim is stunned, and multiplies dmgInfo.dmgVal by 3.0. The possibilities here are wide open, and it's something I've done work on in my own projects.

 
Ok a small note about armor penetration. Most humanoid npc's don't have armor rating, but many monster types have some. There is also the % damage resistance stat which usually has a much greater effect (you notice this when fighting golems/elementals).

You could create an item tag for you finesse weapons. Just add to the <tags></tags> section something like 'finesseWeapon', then in damageManagerProcessor.ws you look for the section where 'resist pts' and 'resist perc' are calculated. You add a conditional to check for the finesseWeapon tag on the attackers weapon, and then you could reduce resist points (armor) and percents (damage resistance) in some way (simple math, take the variables and multiply by 0.5 and the target loses half their armor and/or damage reduction.

Its also possible to create brand new efffects at the end of an attack action based on conditions that you specify. You can check out my mod "Flame Strike" on nexusmods. In damageManagerProcessor.ws, search for "flame strike", I believe it should lead you down to the process reaction section where my code is located. You could substitute your own conditions based on your item tags to create new effects for your weapons.
 
Thanks again gogabus, :D

I'll take a look at your Flame strike mod and start to experiment with weapon and enemy stats. I think I start with one pair of swords and one humanoid and one monster enemy, to get a idea of how much tweaking stats changes things. De-leveling first then extra abilities then player abilities.
 
Top Bottom