Jump to content

Want to mod for T7 guns/armor and better


Recommended Posts

So what I am looking for is basically I want to mod current items to include a tier 7 or 8 variant. Yes,I know it'll be broken and overpowered. But my boys and I are on my private server and as it stands we can run around and loot and that's about it, I've added Improved Hordes and other mods, and blood moons are the only "fun" we are having. Looking for a way to spend the hundreds of thousands of dukes we have. So my idea is to make tier 7/8 items that would only be sold at traders for an ungodly sum of like 200k. Just to give us a broken item, but something to work towards.

 

But I know nothing about weapon and armor modding, and get pretty lost when I look at it.

 

First off, is this possible? And if so, how would I go about doing it?

Link to comment
Share on other sites

I would think it is quite possible, but one has to test it to really know. I haven't modded in a long time, so take my words with a grain of salt.

 

The first step is to change qualityinfo.xml to add more quality levels and the colors shown for them.

 

Then change all the items you want with higher quality levels:

  1) Check if that item in items.xml has lines like with "tier=..." in it, those lines refer to quality level. Example:

 

<passive_effect name="EntityDamage" operation="perc_add" value=".1,.5" tier="2,6" tags="perkMiner69r"/> <!-- tier bonus -->

--->

<passive_effect name="EntityDamage" operation="perc_add" value=".1,.9" tier="2,10" tags="perkMiner69r"/> <!-- tier bonus -->

 

Even those where you don't want to have changes for your added quality tiers you should at least specify the tier, otherwise the line would be ignored for your new levels. Example:

 

<passive_effect name="ModSlots" operation="base_set" value="1,1,2,2,3,4" tier="1,2,3,4,5,6"/>

--->

<passive_effect name="ModSlots" operation="base_set" value="1,1,2,2,3,4" tier="1,2,3,4,5,6,7,8,9"/>

or

<passive_effect name="ModSlots" operation="base_set" value="1,1,2,2,3,4,4,4,4,4" tier="1,2,3,4,5,6,7,8,9"/>

 

AFAIK the two changed lines are equivalent because the last value in "value=..." is just continued, if there are more "tier" than "value" values, but the latter line is safer if you don't want to test it out.

 

Next you need to make sure that the items can be found. Check out loot.xml and add some lines below the line "<!-- *** Loot_Quality_Templates -->" so that starting at a specifc lootlevel you will find your new quality levels, example:

 

               <qualitytemplate level="140,149" default_quality="1">
                        <loot quality="1" prob="0.426"/>
                        <loot quality="2" prob="0.313"/>
                        <loot quality="3" prob="0.33"/>
                        <loot quality="4" prob="0.448"/>
                        <loot quality="5" prob="0.643"/>
                        <loot quality="6" prob="1"/>
                </qualitytemplate>

-->

               <qualitytemplate level="140,149" default_quality="1">
                        <loot quality="1" prob="0.426"/>
                        <loot quality="2" prob="0.313"/>
                        <loot quality="3" prob="0.33"/>
                        <loot quality="4" prob="0.448"/>
                        <loot quality="5" prob="0.643"/>
                        <loot quality="6" prob="0.68"/>
                        <loot quality="7" prob="1"/>
                </qualitytemplate>

 

This means that starting with your lootstage 140 you would have a very small chance finding quality 7 level items. I.e. multiply all previous roll-fails (1-0.426)*(1-0.313)*(1-0.33)... and you have the chance to find a level 7 item instead of a lower level item at that stage

 

If you also want to add it to trader inventories, check out trader.xml and make appropriate changes there too

 

Edited by meganoth (see edit history)
Link to comment
Share on other sites

I did not test the code, it is quite usual that code only works after some debugging. And debugging works by observing the game and seeing what changed and what didn't but should have and using this to find the bug or problem.

 

So, first question, what did you do? Where did you change or insert what lines? (Did you use XPath for this? Hint: If you don't know what that is you didn't use it).

 

How did you test that it doesn't work? For example did you try to find the higher quality item in the creative menue? Or did you just play around and hope that it drops for you? Did you use a test game or the game you all are playing? Did you check the logfiles for new errors that seem to occur because of your mod?

 

(IF you are using XPath you should also locate your savegame (use the launcher for example) and look into the directory ConfigDumps. There are your config files as the game has read them. Check if your changes done per xpath have actually been applied)

 

Link to comment
Share on other sites

<config>
    <set xpath="/qualityinfo">
        <!--Broken-->                                
        <quality key="0" color="808080"/>
        <!--Junk -->
        <quality key="1" color="E0E0DF"/>
        <!--Common-->
        <quality key="2" color="FF7200"/>
        <!--Uncommon-->
        <quality key="3" color="FFC000"/>
        <!--Rare-->
        <quality key="4" color="2985FD"/>
        <!--Epic-->
        <quality key="5" color="FA004C"/>
        <!--Legendary-->
        <quality key="6" color="A42ACC"/>
        <!--Ultime-->
        <quality key="7" color="FFCC11"/>
    </set>
</config>

 

At startup I get this error:

 

2023-04-23T20:45:40 259.740 ERR XML loader: Loading and parsing 'qualityinfo.xml' failed
2023-04-23T20:45:40 259.742 EXC Index was outside the bounds of the array.
  at QualityInfo.Add (System.Int32 _key, System.String _hexColor) [0x0000c] in <d885d5e5cbd941a78c268f40cc2ae744>:0
  at QualityInfoFromXml+<CreateQualityInfo>d__0.MoveNext () [0x000be] in <d885d5e5cbd941a78c268f40cc2ae744>:0
  at ThreadManager+<CoroutineWrapperWithExceptionCallback>d__48.MoveNext () [0x00044] in <d885d5e5cbd941a78c268f40cc2ae744>:0
UnityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
<>c__DisplayClass52_0:<loadSingleXml>b__2(Exception)
<CoroutineWrapperWithExceptionCallback>d__48:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Edited by Jessy (see edit history)
Link to comment
Share on other sites

Yes, tested it as well and it doesn't work. So the 6 quality levels seem to be hardcoded. To change that you would need to change the underlying code (written in C#) with the help of Harmony (a tool to inject code into the game libraries). Quite a bit more complicated than changing the xml

 

If you still want to go forward I would suggest checking out the code of an overhaul mod who added quality levels as well, I think I remember there was at least one.

 

Link to comment
Share on other sites

That might be a minor issue.  Did you happen to code up to craft a higher quality level item (7+) and see if you can make it in game?

 

I recall an issue I had in my mod where you could craft a higher tier weapon than Q6 based on some changes I mad to the progression file.  I can't recall if I tried to craft it since that wasn't my desire outcome so I reworked my progression changes.  When I saw it in the crating menu, it was listed as Q7 but with Q6 coloring.  I also didn't make any changes in the item file to increase the max level from 6 to 7.

 

I might whip up some code in the next day or so to see if I can craft a higher quality weapon.

Link to comment
Share on other sites

5 hours ago, Jessy said:

Yes I would be interested to see what you could get :)

It doesn't make any actual changes other than the displayed Quality level when crafting.  I set it up to be able to craft a Q8 pump shotgun which was shown in the crafting window.  However, when I put it in my inventory, it was just a Q6 pump shotgun.

A20.7_2023-04-26_20-24-20.jpg

A20.7_2023-04-26_20-19-36.jpg

Link to comment
Share on other sites

I looked at doing something like this during my last playthrough, but hit the same problem with adding quality levels.

 

For OP: I did kind of work around the quality issue by just taking all of the T3 weapons and adding in new versions of them as unique items. I set the showquality property as false which removes the quality colour bar (but leaves the number its self, which I guess is hardcoded), the lack of colour did distinguish them enough for my use though. You can then just bump up the stats and value and add them to the traders.

 

I am now wondering though whether you could set the new weapons up to use 6 tiers as well, essentially give the item 12 levels by setting the new version to appear at T1 around the same game stage as the original T6 version, though off the top of my head, I am not sure exactly how the trader groups relate to game stage.

 

Edit: I was mistaken, setting showquality does in fact hide the colour and number on the item when viewing it in the inventory, it still shows the number only in the traders interface. I guess this means you could just draw on a colour bar and a No. 7 to the items icon if you really wanted to 😁

Edited by Ananais (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...