Jump to content

How to change a recipe to yield two different items?


Yamamoto80

Recommended Posts

Greetings. Hopefully this is the most appropriate place to drop this question....

What I would like to have happen (as the title implies) is to receive multiple different items back from a recipe. Using the example script below, I would like the game's output for this recipe to be "foodCornBread" as well as "drinkJarEmpty", so that I am effectively using the jar of water and getting the empty jar back.

 

<recipe name="foodCornBread" count="1" craft_area="campfire" craft_tool="toolCookingPot" tags="perkMasterChef,learnable">
    <ingredient name="foodCornMeal" count="1"/>
    <ingredient name="drinkJarBoiledWater" count="1"/>
</recipe>

 

 

Any ideas?

Link to comment
Share on other sites

You're working with recipes. You have to visualize what happens in game when you're crafting anything that was defined by a recipe. You find it in the list of craftable items, select it and if you have enough ingredients, you can craft that item. You can also craft more than 1 item of the same type if you have enough materials in your inventory, but the game will never let you select more than one different items to craft at the same time using the same recipe. That should give you a hint of how exactly the recipes work and why and so there is also your answer - you can't do that, because the game doesn't work that way.

Link to comment
Share on other sites

Hi Yamamoto80

 

If you only want to recover the drinkJarEmpty, better enable the option in items.xml in the foodCornBread item on this line and it should look like this:

 

<property name = "Create_item" value = "drinkJarEmpty" />

 

The jar will give it to you when you eat the foodCornBread, I hope that helps you.
Regards

Link to comment
Share on other sites

22 hours ago, Gouki said:

Hi Yamamoto80

 

If you only want to recover the drinkJarEmpty, better enable the option in items.xml in the foodCornBread item on this line and it should look like this:

 

<property name = "Create_item" value = "drinkJarEmpty" />

 

The jar will give it to you when you eat the foodCornBread, I hope that helps you.
Regards

I was just going to suggest that. Any idea what happens if you then use foodCornBread as an ingredient for another recipe?

Link to comment
Share on other sites

12 minutes ago, Mihail said:

I was just going to suggest that. Any idea what happens if you then use foodCornBread as an ingredient for another recipe?

foodCornBread would be lost / used. If you're wondering whether it would give you the empty jar or not, the answer is no, it wouldn't.

Link to comment
Share on other sites

Search items.xml for "openbundle" and you will find an item class that can be opened in your inventory. You could extend this to your own bundle so that a single recipe yields any number of items. This is how the "starter pack" mods work.

Not sure if it solves your problem but it offers some interesting possibilities 🤔 

Link to comment
Share on other sites

14 minutes ago, convergent said:

Search items.xml for "openbundle" and you will find an item class that can be opened in your inventory. You could extend this to your own bundle so that a single recipe yields any number of items. This is how the "starter pack" mods work.

Not sure if it solves your problem but it offers some interesting possibilities 🤔 

An excellent suggestion with just one minor drawback. Bundle itself cannot be eaten. ;)

Link to comment
Share on other sites

 

13 hours ago, convergent said:

Search items.xml for "openbundle" and you will find an item class that can be opened in your inventory. You could extend this to your own bundle so that a single recipe yields any number of items. This is how the "starter pack" mods work.

Not sure if it solves your problem but it offers some interesting possibilities 🤔 

 

This is genius. You'd basically create a corn bread bundle item that, when opened, drops a cornbread and an empty jar. Relevant code below to save some searching:
 

<item name="ammoBundleMaster">
	<property name="CreativeMode" value="None"/>
	<property name="CustomIcon" value="ammo9mmBulletBall"/><property name="ItemTypeIcon" value="bundle"/>
	<property name="DescriptionKey" value="ammoBundleGroupDesc"/>
	<property name="HoldType" value="45"/>
	<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
	<property name="Material" value="Mmetal"/>
	<property name="Stacknumber" value="5"/> <!-- STK ammobundle -->
	<property name="Weight" value="0"/>
	<property name="EconomicValue" value="900"/>
	<property name="Group" value="Ammo/Weapons"/>
	<property name="UnlockedBy" value="perkPistolPeteComplete"/>
	<property class="Action0">
		<property name="Class" value="OpenBundle"/>
		<property name="Delay" value="0"/>
		<property name="Use_time" value="0"/>
		<property name="Sound_start" value="close_garbage"/>
		<property name="Create_item" value="ammo9mmBulletBall"/>
		<property name="Create_item_count" value="100"/>
		<!--
		This can spawn multiple item types and quantities. No randomness.
		<property name="Create_item" value="ammo9mmBulletBall,drinkCanRiverWater"/>
		<property name="Create_item_count" value="50,5"/>
		-->
	</property>
</item>

<item name="foodBundlefoodCornBread">
	<property name="Extends" value="ammoBundleMaster"/>
	<property name="CustomIcon" value="foodCornBread"/>
	<property name="Stacknumber" value="10"/> <!-- STK ammobundle high -->
	<property name="EconomicValue" value="30"/>
	<property class="Action0">
		<property name="Create_item" value="foodCornBread,drinkJarEmpty"/>
	</property>
</item>

Then just change the recipe for cornbread to the bundle.

I wonder if there's a way to globally do this for every recipe that takes a jar of water, because stews and such should also return the jar.

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...