Jump to content

Item Quality

Recommended Posts

Hello all,

I'm working on a power mod that contains new BatteryBanks, SolarCells, and Batteries and i'm having a bit of an issue figuring out item quality settings. Can anyone point me in the right direction so that i can either scale it like vanilla items or set it so they always produce quality 5/6.


Found this in progression.xml, but it doesnt really give you much to go on:


<passive_effect name="CraftingTier" operation="base_add" level="1,2,3,4,5" value="1,2,3,4,4" tags="perkYeahScience"/><!--carBattery-->


thank you

Link to comment
Share on other sites

Everything AFAIK:


This means it depends on perkYeahScience. The base value of quality seems to be 1, so unskilled you would produce a quality 1 item. At level 1 of the perk 1 is added and you produce a quality 2 item. At level 4 of the perk you can already produce quality 5 Batteries (1+4), same as at perk level 5.


If you only want to produce batteries of quality 4 or 5, then the line probably should be


<passive_effect name="CraftingTier" operation="base_add" level="1,2,3,4,5" value="3,3,3,4,4" tags="perkYeahScience"/><!--carBattery-->




Link to comment
Share on other sites

Ok that makes a bit of sense. So any idea how would you add a similar progression to a customer item? There doesnt seem to be an item identifier in the string other than the comment, so how does they system know that this is for carBattery?


If we go on your assumption and then also assume that it is using the comment as an identifier. I should be able to do something like this?


<passive_effect name="CraftingTier" operation="base_add" level="1,2,3,4,5" value="0,1,2,3,4" tags="perkYeahScience"/><!--DoubleCellBattery-->


Then it would allow a quality level that matches the Yeah!Science player level of the custom item DoubleCellBattery


thanks for the info

Link to comment
Share on other sites

Dethar and alphaniner's comments are correct. The second part defining the car battery is in recipes.xml. There it says


<recipe name="carBattery" count="1" craft_area="chemistryStation" tags="learnable,perkYeahScience,chemStationCraftin g">
<ingredient name="resourceScrapLead" count="180"/>
<ingredient name="resourceAcid" count="4"/>
<ingredient name="resourceScrapPolymers" count="6"/>


The tag "perkYeahScience" connects it to the line in progression.xml. There is also a line in items.xml relevant to this:


item name="carBattery">
       <property name="ShowQuality" value="true"/>


which makes quality shown on the item.



If you wanted to craft carBatteries independant of any perk with quality 5 for example, you would remove the tag perkYeahScience from the recipe and set the quality in the recipe directly. If you wanted all batteries, even found ones, to have quality 5 you would set the quality in the item definition in items.xml.


Now I didn't test this, and the actual syntax to use is something you have to find out (often by finding other stuff that works that way). Sometimes it isn't possible at all because of limitations in the code interpreting the xml.

The best way to find out the right syntax is finding examples that work like you want and looking at their code. Since vanilla is consistent in that all items have their craftingTier set in progression.xml you can't do that. You have to look and guess what might work.


A line that might work could be


<passive_effect name="craftingTier" operation="base_set" tier="5"/>


or maybe you need to put it into an effect_group to work:


<passive_effect name="craftingTier" operation="base_set" tier="5"/>


Someone who actually did a lot of modding would know this better, I only made two small mods in A16 so my knowledge is rather spotty.

Link to comment
Share on other sites

Thanks all. I was confused when i saw the carbattery comment in the xml and thought it was somehow just for the battery it self. Now i see that it is for every item using that perk, it makes a lot more sense and also lead me to my issue which was an improper tag on the item. So it wasnt scaling with the perk level properly.


thanks for taking the time to explain.

Link to comment
Share on other sites


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

  • Create New...