psykikk Posted March 20, 2014 Share Posted March 20, 2014 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 More sharing options...
Japer Posted March 20, 2014 Share Posted March 20, 2014 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 createdIf that doesn't work tryResult: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 More sharing options...
RoboMat Posted March 20, 2014 Share Posted March 20, 2014 This has been answered here: http://theindiestone.com/forums/index.php/topic/3969-multiple-items-resultting-from-recipe/ Link to comment Share on other sites More sharing options...
psykikk Posted March 21, 2014 Author Share Posted March 21, 2014 oh nice. thx mate. seems rather... straightforward even though I don´t know a thing about lua. but this can be done I think. Link to comment Share on other sites More sharing options...
RoboMat Posted March 21, 2014 Share Posted March 21, 2014 If you need more help, just ask here Link to comment Share on other sites More sharing options...
Saranis Posted March 23, 2014 Share Posted March 23, 2014 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 scriptfunction 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 More sharing options...
Koregan Posted March 23, 2014 Share Posted March 23, 2014 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");endDidn'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 More sharing options...
Saranis Posted March 24, 2014 Share Posted March 24, 2014 Thanks, much easier solution than what I was going for. I still wonder what is happening with OnMakeItem though... Link to comment Share on other sites More sharing options...
RoboMat Posted March 24, 2014 Share Posted March 24, 2014 Have you printed out the _recipe parameter to see if it matches your recipe name? Link to comment Share on other sites More sharing options...
Saranis Posted March 24, 2014 Share Posted March 24, 2014 Have you printed out the _recipe parameter to see if it matches your recipe name? Okay, that seems to be the problem. Its printing"zombie.scripting.objects.Recipe@72cef095" Link to comment Share on other sites More sharing options...
RoboMat Posted March 24, 2014 Share Posted March 24, 2014 I think what you need to use is recipe:getName(). http://theindiestone.com/zomboidjavadocs/zombie/scripting/objects/Recipe.html Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now