Jump to content

[FYI] Factoring ingredient quality level into crafted item.


Recommended Posts

Have been working on reintroducing weapon parts to create weapons. The one issue is it being seemingly impossible through XML to get multiple resources from scrapping an item. However I figured out a way to essentially average all recipe ingredients' item qualities to influence the crafted item's quality.

 

Basically if you are using quality based (tiered) ingredients in a recipe, you can add the following to the item's effect_group. Using base_set will override your intelligence-based crafting quality.

 

<passive_effect name="CraftingTier" operation="base_set" value="1,6" tier="1,6"/>

 

But when creating an item from a recipe, it goes down the list of ingredients sequentially to determine the output item's tier. Using base_set on all items overwrites the previous base_set each time, meaning the last item in the recipe list is what determines the final output item's quality.

 

Instead what you do is use base_set on the first item in the list to override the intelligence crafting stat, then base_add on the following items. Set the value to 1,6 divided by the amount of items in the recipe list* (note on this below). Say I have 4 items:

 

[color="#FFA500"]Note: These are just examples. I pulled these and the partsMaster code over from A16 and updated a couple properties if you want to do this on your own.[/color]

<item name="partsPistol_grip">
<property name="Extends" value="partsMaster"/>
<property name="CustomIcon" value="modGunForegripSchematic"/>
<effect_group>
	<passive_effect name="CraftingTier" operation="base_set" value="0.25,1.5" tier="1,6"/>
</effect_group>
</item>
<item name="partsPistol_receiver">
<property name="Extends" value="partsMaster"/>
<property name="CustomIcon" value="modGunTriggerGroupBurstSchematic"/>
<effect_group>
	<passive_effect name="CraftingTier" operation="base_add" value="0.25,1.5" tier="1,6"/>
</effect_group>
</item>
<item name="partsPistol_parts">
<property name="Extends" value="partsMaster"/>
<property name="CustomIcon" value="modGunRodAndSpringSchematic"/>
<effect_group>
	<passive_effect name="CraftingTier" operation="base_add" value="0.25,1.5" tier="1,6"/>
</effect_group>
</item>
<item name="partsPistol_barrel">
<property name="Extends" value="partsMaster"/>
<property name="CustomIcon" value="modGunBarrelExtenderSchematic"/>
<effect_group>
	<passive_effect name="CraftingTier" operation="base_add" value="0.25,1.5" tier="1,6"/>
</effect_group>
</item>

 

And the recipe:

 

[color="#FFA500"](Recipe has them placed in the same order, base_set first)[/color]
<recipe name="gunPistol" count="1" craft_area="workbench" tags="learnable">
<ingredient name="partsPistol_grip" count="1" />
<ingredient name="partsPistol_receiver" count="1" />
<ingredient name="partsPistol_parts" count="1" />
<ingredient name="partsPistol_barrel" count="1" />
</recipe>

 

Then say I craft a pistol using a tier 2 grip, tier 4 receiver, tier 4 parts, and tier 5 barrel.

 

0.5 + 1 + 1 + 1.25 = 3.75, rounded down. This would output a tier 3 pistol. If any one of the items were just one tier higher, you would end up with a tier 4 pistol.

 

* Now, you may want to set the values on each item a bit higher than a total sum of 1,6. Due to rounding down, you would need all 4 items to be tier 6 in order to output a tier 6 pistol. If you set them all to 0.27,1.62, you could get away with having three tier 6 items + one tier 5 item (total = 6.21 ). 0.275,1.65 and you could get a tier 6 pistol out of two tier 6 + two tier 5 (total = 6.05). You'd have to do a bit of math and decide what you would prefer.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...