waw Posted January 4, 2017 Share Posted January 4, 2017 (edited) Using a simple custom recipe in modmain with the prefab "mermhouse" such as : Recipe("mermhouse", {Ingredient("boards", 8), Ingredient("cutstone", 6), Ingredient("fish", 16)}, RECIPETABS.TOWN, TECH.SCIENCE_TWO, "mermhouse_placer") Causes the game to crash when scrolling to the recipe in chosen recipe tab ../data/scripts/widgets/text.lua:55: calling 'SetString' on bad self (string expected, got table) LUA ERROR stack traceback: =[C]:-1 in (method) SetString (C) <-1--1> ../data/scripts/widgets/text.lua:55 in (method) SetString (Lua) <53-56> ../data/scripts/widgets/recipepopup.lua:268 in (method) Refresh (Lua) <153-301> ../data/scripts/widgets/recipepopup.lua:307 in (method) SetRecipe (Lua) <304-308> ../data/scripts/widgets/craftslot.lua:168 in (method) Refresh (Lua) <117-173> ../data/scripts/widgets/craftslot.lua:177 in (method) SetRecipe (Lua) <175-179> ../data/scripts/widgets/crafting.lua:137 in (method) UpdateRecipes (Lua) <97-158> ../data/scripts/widgets/crafting.lua:178 in (method) ScrollUp (Lua) <174-183> ../data/scripts/widgets/crafting.lua:31 in (field) onclick (Lua) <31-31> ../data/scripts/widgets/button.lua:37 in (method) OnControl (Lua) <20-45> ../data/scripts/widgets/widget.lua:112 in (field) OnControl (Lua) <106-116> ../data/scripts/widgets/crafting.lua:161 in (method) OnControl (Lua) <160-172> Is there a way to fix it ? Edited January 4, 2017 by waw Wrong CP Link to comment https://forums.kleientertainment.com/forums/topic/73096-weird-crash-with-mermhouse-as-custom-recipe/ Share on other sites More sharing options...
Mobbstar Posted January 4, 2017 Share Posted January 4, 2017 the second ingredient has a } too much Link to comment https://forums.kleientertainment.com/forums/topic/73096-weird-crash-with-mermhouse-as-custom-recipe/#findComment-855392 Share on other sites More sharing options...
waw Posted January 4, 2017 Author Share Posted January 4, 2017 (edited) @Mobbstar It was a wrong copy paste, I've just edited my post If you want to test : modmain.lua local _G = GLOBAL _G.STRINGS.RECIPE_DESC.MERMHOUSE = "Test recipe" _G.Recipe("mermhouse", {_G.Ingredient("twigs", 1)}, _G.RECIPETABS.TOWN, _G.TECH.NONE) --> Crashing local _G = GLOBAL _G.STRINGS.RECIPE_DESC.SLURTLEHOLE = "Test recipe" _G.Recipe("slurtlehole", {_G.Ingredient("twigs", 1)}, _G.RECIPETABS.TOWN, _G.TECH.NONE) --> Not crashing Edited January 4, 2017 by waw Link to comment https://forums.kleientertainment.com/forums/topic/73096-weird-crash-with-mermhouse-as-custom-recipe/#findComment-855394 Share on other sites More sharing options...
Mobbstar Posted January 4, 2017 Share Posted January 4, 2017 It might have to do with STRINGS.NAMES.MERMHOUSE being a table rather than a value, without "GENERIC" field: MERMHOUSE = { BASE = "Mermhouse", SW = "Merm Hut", }, Try this before the recipe: _G.STRINGS.NAMES.MERMHOUSE.GENERIC = "Mermhouse" Link to comment https://forums.kleientertainment.com/forums/topic/73096-weird-crash-with-mermhouse-as-custom-recipe/#findComment-855413 Share on other sites More sharing options...
waw Posted January 4, 2017 Author Share Posted January 4, 2017 @Mobbstar Still crashing Link to comment https://forums.kleientertainment.com/forums/topic/73096-weird-crash-with-mermhouse-as-custom-recipe/#findComment-855506 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