Jump to content

recipes with more results ?


psykikk

Recommended Posts

is it possible to make a recipe that prouces more than one result ? 

 

this is what I want:

 

recipe Open Box of Chips
{
ChipsBox,
Result:Crisps=10/Crisps2=10/cardbox=1,
Time:10,
}
 
 
so opening the box is supposed to produce the two types of crisps PLUS the empty cardbox.
 
 
i that possible at all ? 
 
thx
Link to comment
Share on other sites

Yes that should work, check the un-boxing recipes already in game.
Have you tried it with your mod yet? I know you have all the icons etc created

If that doesn't work try

Result:Crisps=10, Crisps2=10, cardbox=1,

As I think the / between items is and/or for example the craft bandage recipe is shirt/blouse/pants etc

Link to comment
Share on other sites

I seem to be having some trouble.

I want to make a recipe that allows me to wring a wet bath towel into a container (in this example a bowl) and fill the bowl with water while replacing the wet bath towel with a dry towel.

Example Recipe:

	recipe Wring Wet Bath Towel into Bowl	{		BathTowelWet,		Bowl,				Result:WaterBowl,		Time:60.0,	}

Example lua script

function AnotherResult(_crafttool,_resultItem,_recipe)  if _recipe =="Wring Wet Bath Towel into Bowl" then      getPlayer():getInventory():AddItem("Base.BathTowel")  endendEvents.OnMakeItem.Add(AnotherResult)

I have placed the lua in media/lua/client and it is loading in the game (I added another function to the file and tested that it was loading). When I run the recipe I get the waterbowl but no Bath Towel. The Wet Bath Towel disappears (as its a component of the recipe) without adding a new one.

 

I believe the problem is occurring with OnMakeItem or _recipe

Link to comment
Share on other sites

another easy way could be to use ONCREATE in the recipe:

 

[RECIPES.TXT]

recipe Wring Wet Bath Towel into Bowl    {        BathTowelWet,        Bowl,                Result:WaterBowl,        Time:60.0,        OnCreate:AddBathTowel,    }

[YOURMOD.LUA]


function AddBathTowel()   getPlayer():getInventory():AddItem("BathTowel");end

Didn't test it, but should work.

 

 

But one thing should also be told:

In the "recipe-preview" is only the symbol of the main-result shown.

The other "bonus-results" are not displayed in preview.

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...