AutumnPingo Posted June 2, 2018 Share Posted June 2, 2018 Hi, I'm trying to have my character be able to craft Unagi (an existing item, but with no crafting recipe to my knowledge) with no TECH requirements (where only he can craft it). I've run through a multitude of code searching online, but can't get any of them to work. The simplest, and most easy to follow of these is: local function GenerateMealRecipe(prefab, 1) AddRecipe( prefab, { Ingredient("fish", 1),Ingredient("cutlichen", 1) }, RECIPETABS.FOOD, TECH.NONE, nil, nil, nil, 6, "ching" ) end GenerateMealRecipe("unagi", 1) This code looks like it would be more appropriate, but I couldn't even get the game to not crash using this: local myrecipe = AddRecipe("unagi", {GLOBAL.Ingredient("cutlichen", 1), GLOBAL.Ingredient("fish", 1)}, GLOBAL.RECIPETABS.FOOD, GLOBAL.TECH.NONE, nil, nil, nil, nil, min_spacing, nounlock, numtogive"meal_builder", "images/inventoryimages/unagi.xml", "unagi.tex") GLOBAL.STRINGS.RECIPE_DESC.UNAGI = "Food" --Chr prefab has been assigned "meal_builder" tag --I've used placeholder unagi.xml,.tex files just to make sure they're in my mod directory Thanks, I hate to bring up a point that's been explored alot, but I'm at loss on how everyone else got it to work. Any help appreciated. Link to comment Share on other sites More sharing options...
K1NGT1GER609 Posted June 2, 2018 Share Posted June 2, 2018 Eyeballing this one and say your missing quite a few lines of code: local Ingredient = GLOBAL.Ingredient local RECIPETABS = GLOBAL.RECIPETABS Recipe = GLOBAL.Recipe Ingredient = GLOBAL.Ingredient TECH = GLOBAL.TECH local unagi_recipe = AddRecipe("unagi", { Ingredient("cutlichen", 1), Ingredient("fish", 1)}, RECIPETABS.FOOD, TECH.NONE, nil, nil, nil, nil, "meal_builder", "images/inventoryimages/uangi.xml") all this goes into the modmain, like I said I eye balled this one so test it out (bit busy today) Link to comment Share on other sites More sharing options...
AutumnPingo Posted June 2, 2018 Author Share Posted June 2, 2018 Oh right, I already had that first block, but commented it out on accident. But is your code to replace what I've already got? Or add to it? Either way, I'm not seeing any option to craft Unagi (I imagine when its working, the FOOD tab will always appear with the single option? Right now the game acts vanilla-ly, with no sign of new recipes). And don't worry, I'm in no hurry either. Link to comment Share on other sites More sharing options...
K1NGT1GER609 Posted June 2, 2018 Share Posted June 2, 2018 Huh the food tab is actually the farm tab, heh ok well reediting: local unagi_recipe = AddRecipe("unagi", { Ingredient("cutlichen", 1), Ingredient("fish", 1)}, RECIPETABS.FARM, TECH.NONE, nil, nil, nil, nil, "meal_builder", "images/inventoryimages/unagi.xml") there only the character with the meal_builder tag can build it. Link to comment Share on other sites More sharing options...
AutumnPingo Posted June 3, 2018 Author Share Posted June 3, 2018 That one seems to work! What was different that time? The two lines seemed identical (other than the .xml typo) 1 Link to comment Share on other sites More sharing options...
K1NGT1GER609 Posted June 3, 2018 Share Posted June 3, 2018 The recipes tab titled food is actually a farm tab in the coding, heh like my chernobyl tab being labeled shop. Link to comment Share on other sites More sharing options...
AutumnPingo Posted June 3, 2018 Author Share Posted June 3, 2018 Ahhh, never noticed that, thanks 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