Jump to content

Adding Quality Caps by Item


OgreLXXV

Recommended Posts

My mod is coming right along. Crazy how much knowledge I've gained in the last few weeks just diving in and doing it.

I would like to set both minimum and maximum quality caps on items. In my mod it will be by Tier (i.e. a T0 item could only be  Q1-3, T1 could be Q2-4, etc) but I believe I would have to set it by individual item. I should be able to control looted items with the quality templates in the loot.xml, but not sure on crafted items. I know I can adjust crafting quality based on perk ranks, but that affects all items created with that perk. Any ideas on this?

 

Thanks!

Link to comment
Share on other sites

Not sure if anyone is interested, but pretty sure I have this figured out. I'll show using Clubs. Note that I've changed the nomenclature for items and perks to something that makes more logical sense to me, but the logic still applies regardless.

 

First, you add a custom tag to the recipe for each item, so you have a tag for both the perk and the item, along with any other tags you need. In this case I have learnable for the items that are unlocked in one way or another.

 

<recipe name="meleeClubT0" count="1" tags="perkClubs,meleeClubT0">
    <ingredient name="resourceWood" count="5"/>
</recipe>

<recipe name="meleeClubT1" count="1" tags="learnable,perkClubs,meleeClubT1">
    <ingredient name="resourceForgedIron" count="5"/>
</recipe>

<recipe name="meleeClubT2" count="1" tags="learnable,perkClubs,meleeClubT2">
    <ingredient name="resourceForgedSteel" count="5"/>
</recipe>

<recipe name="meleeClubT3" count="1" tags="learnable,perkClubs,meleeClubT3">
    <ingredient name="resourceForgedIron" count="5"/>
    <ingredient name="resourceForgedSteel" count="5"/>
    <ingredient name="meleeClubT2" count="1"/>
</recipe>

 

Then in your progression.xml, you simply add a separate passive effect for each item and define the values there. For example:

 

<effect_group>
            <passive_effect name="CraftingTier" operation="base_add" level="1,5" value="0" tags="meleeClubT0"/>
            <passive_effect name="CraftingTier" operation="base_add" level="1,2,3,4,5" value="0,1,2,2,2" tags="meleeClubT1"/>
            <passive_effect name="CraftingTier" operation="base_add" level="3,4,5" value="2,3,4" tags="meleeClubT2"/>
            <passive_effect name="CraftingTier" operation="base_add" level="5" value="5" tags="meleeClubT3"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="1,5" value="1" tags="meleeClubT1"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="3,5" value="1" tags="meleeClubT2"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="5,5" value="1" tags="meleeClubT3"/>
            <passive_effect name="BlockDamage" operation="perc_add" level="1,5" value=".2,1" tags="perkClubs"/>
            <passive_effect name="EntityDamage" operation="perc_add" level="1,5" value=".1,.5" tags="perkClubs"/>
            <passive_effect name="EntityDamage" operation="perc_add" level="1,5" value="0.4,2" tags="perkClubs">
                <requirement name="CVarCompare" cvar="_stunned" operation="Equals" value="1" target="other"/>
            </passive_effect>
        </effect_group>

 

The net result of this is that T0 clubs are always Quality 1 (base + 0).  T1 clubs are Q1 at perkClubs rank 1 (base +0), Q2 at perkClubs rank 2 (base + 1), and then cap out at Q3 for perkClubs rank 3 and above (base + 2). The T2 club, which you can't make until perkClubs rank 3, starts at Quality 3 (base + 2) and moves up with perkClubs rank to a max of Q5 at rank 5. The T3 club can only be crafted at max perkClubs rank 5 and will always be a Q6 item (base +5).

 

Hope others find this useful. I really like the idea of primitive weapons and tools always being quality 1, and others items having minimum or maximum quality based on their tier. Now to take care of looted items...

Link to comment
Share on other sites

This topic seems very close to what I'm trying to figure out myself but with looted weapons instead of crafted ones. I created legendary weapons that only spawn in t5 hardened chests but cannot figure out how to make them always be quality 6 instead of random. Any thoughts? 

Link to comment
Share on other sites

34 minutes ago, IrishManJMo said:

This topic seems very close to what I'm trying to figure out myself but with looted weapons instead of crafted ones. I created legendary weapons that only spawn in t5 hardened chests but cannot figure out how to make them always be quality 6 instead of random. Any thoughts? 

 

You need to add your legendary items into their own lootgroup and apply a lootqualitytemplate something like below:

 


 

<lootqualitytemplate name="qualLegendaryTemplate">
       <qualitytemplate level="1,999999" default_quality="6">
            <loot quality="6" prob="1"/>
       </qualitytemplate>

</lootqualitytemplate>



<lootgroup name="legendaryitems" loot_quality_template="qualLegendaryTemplate">
    <item name="legendaryitem1"/>
    ...
</lootgroup>

 

One thing to remember is that any loot_quality_template applied to a lootcontainer overrides all loot quality templates of any lootgroup that is called as a subgroup.

So you would likely need to remove the loot_quality_template from the hardened chest loot container in order to achieve what you want.  Also remember not to call any item that has quality levels without defining a loot quality template for it.

At least this is how it worked as of A18.  Haven't tested with A19.  It can get a bit complicated once you start wanting to limit or define quality levels to various items.

 

Link to comment
Share on other sites

Thank you so much! You just confirmed for me that I was on the right track because I discovered the loot group templates about an hour ago and have been trying to get a legendary one to work lol. You're right that the hardened chest must have one overwriting mine so I'm gonna try that now. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...