rukoo Posted February 27, 2025 Share Posted February 27, 2025 I'm adding a custom cook recipe to my mod. I followed this guide to enter the code, but the game crashes strangely. To be exact, it crashes in the bottom row of captin.lua, the unpacked part. I've compared the sample mode to my mod many times, but I don't know where the problem is. Please help! This is error message. [string "../mods/Captin (2)/scripts/prefabs/captin.lua"]:490: '<eof>' expected near 'unpack' LUA ERROR stack traceback: =[C] in function 'assert' scripts/mainfunctions.lua(160,1) =(tail call) ? =[C] in function 'xpcall' scripts/mods.lua(188,1) scripts/mods.lua(665,1) in function 'RegisterPrefabs' scripts/gamelogic.lua(316,1) in function 'LoadAssets' scripts/gamelogic.lua(1088,1) in function 'cb' scripts/shardindex.lua(214,1) in function 'OnLoadSaveDataFile' scripts/shardindex.lua(231,1) =[C] in function 'GetPersistentStringInClusterSlot' ... =[C] in function 'GetPersistentString' scripts/saveindex.lua(285,1) in function 'Load' scripts/gamelogic.lua(1324,1) in function 'callback' scripts/playerprofile.lua(1747,1) in function 'Set' scripts/playerprofile.lua(1587,1) =[C] in function 'GetPersistentString' scripts/playerprofile.lua(1585,1) in function 'Load' scripts/gamelogic.lua(1323,1) in main chunk =[C] in function 'require' scripts/mainfunctions.lua(1387,1) Captin (7).zip Link to comment https://forums.kleientertainment.com/forums/topic/164447-add-custom-recipes/ Share on other sites More sharing options...
Baguettes Posted February 27, 2025 Share Posted February 27, 2025 seems like you forgot an end somewhere. Try double checking your lua file. Link to comment https://forums.kleientertainment.com/forums/topic/164447-add-custom-recipes/#findComment-1802146 Share on other sites More sharing options...
oregu Posted February 27, 2025 Share Posted February 27, 2025 You can't put anything after a return statement thats not nested unless you do a comma. what exactly are you trying to unpack food prefabs into? Link to comment https://forums.kleientertainment.com/forums/topic/164447-add-custom-recipes/#findComment-1802352 Share on other sites More sharing options...
rukoo Posted February 28, 2025 Author Share Posted February 28, 2025 Thank you so much for the help! I'm not sure exactly what this does because I inserted the code referring to a different mod. The mod I referenced is this. That mod also ends up with unpack(foodprefabs), but it doesn't seem to crash like mine. https://steamcommunity.com/sharedfiles/filedetails/?id=3223407545 rasputin.lua Link to comment https://forums.kleientertainment.com/forums/topic/164447-add-custom-recipes/#findComment-1802830 Share on other sites More sharing options...
oregu Posted March 1, 2025 Share Posted March 1, 2025 (edited) The comment seems to say "delete this if you don't want to add cooking recipes". You cant put anything after this because this is the return statement. if you want to make changes within the character file it has to be in the main function(s) (common_postinit, master_postinit). Edited March 1, 2025 by oregu Link to comment https://forums.kleientertainment.com/forums/topic/164447-add-custom-recipes/#findComment-1803095 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