ulybaka Posted July 18, 2023 Share Posted July 18, 2023 I am trying to add my custom food called "borsh" but game always crashes if mod is enabled. Help me please, i am new to dst modding Log: [00:02:03]: [string "scripts/cooking.lua"]:20: table index is nil LUA ERROR stack traceback: scripts/cooking.lua(20,1) in function 'AddCookerRecipe' scripts/modutil.lua(646,1) in function 'AddCookerRecipe' ../mods/borsh/modmain.lua(18,1) in main chunk =[C] in function 'xpcall' scripts/util.lua(780,1) =(tail call) ? scripts/mods.lua(572,1) in function 'InitializeModMain' scripts/mods.lua(546,1) in function 'LoadMods' scripts/main.lua(376,1) in function 'ModSafeStartup' scripts/main.lua(506,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(29,1) in function 'SavePersistentString' scripts/modindex.lua(119,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(106,1) in function 'BeginStartupSequence' scripts/main.lua(505,1) in function 'callback' scripts/modindex.lua(735,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(709,1) in function 'Load' scripts/main.lua(504,1) in main chunk -- modmain.lua local _G = GLOBAL local require = _G.require local FOODTYPE = _G.FOODTYPE local TECH = GLOBAL.TECH local Ingredient = GLOBAL.Ingredient local RECIPETABS = GLOBAL.RECIPETABS local Recipe = GLOBAL.Recipe local AllRecipes = GLOBAL.AllRecipes Assets = { Asset("IMAGE", "images/borsh.tex"), Asset("ATLAS", "images/borsh.xml"), } local customrecipes = require("borsh_food") for k, v in pairs(customrecipes) do AddCookerRecipe("borsh", v, true) end -- borsh_food.lua local foods = { borsh = { test = function(cooker, names, tags) return (tags.meat and tags.meat <= 2) and tags.veggie and not tags.inedible end, priority = 0, foodtype = FOODTYPE.MEAT, health = 120, sanity = 0, hunger = 110, cooktime = 0.75, potlevel = "low", floater = {"small", 0.1, 0.8}, oneaten = function(inst, eater) local original_attack_period = eater.components.combat.min_attack_period local original_walkspeed = eater.components.locomotor.walkspeed local original_runspeed = eater.components.locomotor.runspeed eater.components.combat.min_attack_period = 0 eater.components.locomotor.walkspeed = original_walkspeed * 2 eater.components.locomotor.runspeed = original_runspeed * 2 eater:DoTaskInTime(10, function() eater.components.combat.min_attack_period = original_attack_period eater.components.locomotor.walkspeed = original_walkspeed eater.components.locomotor.runspeed = original_runspeed end) end, }, } return foods Link to comment https://forums.kleientertainment.com/forums/topic/149551-trying-to-call-addcookerrecipe-results-in-crash/ Share on other sites More sharing options...
Rickzzs Posted July 19, 2023 Share Posted July 19, 2023 do you have a cookpot brosh? Link to comment https://forums.kleientertainment.com/forums/topic/149551-trying-to-call-addcookerrecipe-results-in-crash/#findComment-1651131 Share on other sites More sharing options...
ulybaka Posted July 19, 2023 Author Share Posted July 19, 2023 5 hours ago, Rickzzs said: do you have a cookpot brosh? what do you mean? Link to comment https://forums.kleientertainment.com/forums/topic/149551-trying-to-call-addcookerrecipe-results-in-crash/#findComment-1651185 Share on other sites More sharing options...
Rickzzs Posted July 19, 2023 Share Posted July 19, 2023 (edited) 1 hour ago, ulybaka said: what do you mean? What do you mean by adding food recipes into brosh? It is usually AddCookerRecipe("cookpot", recipe) AddCookerRecipe("portablecookpot", recipe) AddCookerRecipe("archivecookpot", recipe) Edited July 19, 2023 by Rickzzs Link to comment https://forums.kleientertainment.com/forums/topic/149551-trying-to-call-addcookerrecipe-results-in-crash/#findComment-1651197 Share on other sites More sharing options...
ulybaka Posted July 19, 2023 Author Share Posted July 19, 2023 4 hours ago, Rickzzs said: What do you mean by adding food recipes into brosh? It is usually AddCookerRecipe("cookpot", recipe) AddCookerRecipe("portablecookpot", recipe) AddCookerRecipe("archivecookpot", recipe) oh thx i thought name between " is food bame Link to comment https://forums.kleientertainment.com/forums/topic/149551-trying-to-call-addcookerrecipe-results-in-crash/#findComment-1651236 Share on other sites More sharing options...
ulybaka Posted July 23, 2023 Author Share Posted July 23, 2023 On 7/19/2023 at 10:35 AM, Rickzzs said: What do you mean by adding food recipes into brosh? It is usually AddCookerRecipe("cookpot", recipe) AddCookerRecipe("portablecookpot", recipe) AddCookerRecipe("archivecookpot", recipe) ok, now i have -- modmain.lua local customrecipes = require("borsh_food") for k, v in pairs(customrecipes) do AddCookerRecipe("cookpot", v, true) end but game still crashes Link to comment https://forums.kleientertainment.com/forums/topic/149551-trying-to-call-addcookerrecipe-results-in-crash/#findComment-1653464 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