Jump to content

Recommended Posts

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

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

 

The comment seems to say "delete this if you don't want to add cooking recipes".

image.png.75f5ab33f96cdd8143cd0fa8eb32f203.png

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 by oregu

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