Jump to content

Problem when changing wickerbottoms book recipes


Recommended Posts

Sorry for posting again so soon, but I ran into a problem when changing wickerbottoms book recipes (It crashes when you launch the server) and it says to go to the logs for more info, I've been doing it for a while but cant figure out what is wrong

(I am using the -- (comment marks) because i'm not planning to change them soon because my friend hasn't decided what to do with them yet)

This is currently the code for changing her recipes 

local require = GLOBAL.require
require("recipe")
require("tuning")
TUNING = GLOBAL.TUNING
STRINGS = GLOBAL.STRINGS
RECIPETABS = GLOBAL.RECIPETABS
Recipe = GLOBAL.Recipe
Ingredient = GLOBAL.Ingredient
TECH = GLOBAL.TECH
mod_protect_Recipe = false
----BOOK----
--AddRecipe("book_birds", {Ingredient("papyrus", 2), Ingredient("bird_egg", 2)}, CUSTOM_RECIPETABS.BOOKS, TECH.NONE, nil, nil, nil, nil, "bookbuilder")
--AddRecipe("book_gardening", {Ingredient("papyrus", 2), Ingredient("seeds", 1), Ingredient("poop", 1)}, CUSTOM_RECIPETABS.BOOKS, TECH.SCIENCE_ONE, nil, nil, nil, nil, "bookbuilder")
--AddRecipe("book_sleep", {Ingredient("papyrus", 2), Ingredient("nightmarefuel", 2)}, CUSTOM_RECIPETABS.BOOKS, TECH.MAGIC_TWO, nil, nil, nil, nil, "bookbuilder")
--AddRecipe("book_brimstone", {Ingredient("papyrus", 2), Ingredient("redgem", 1)}, CUSTOM_RECIPETABS.BOOKS, TECH.MAGIC_THREE, nil, nil, nil, nil, "bookbuilder")
AddRecipe("book_tentacles", {Ingredient("papyrus", 2), Ingredient("tentaclespots", 1)}, CUSTOM_RECIPETABS.BOOKS, TECH.SCIENCE_TWO, nil, nil, true, 1, "bookbuilder")
mod_protect_Recipe = true
 
(Sorry it doesn't look as good as it does in my scripter) 
 
I have also attached the client log so maybe someone can find out what is wrong
Many thanks if you do try to figure it out.
(I'm just trying to do this because my friend wants a bit of a nerf for wicker/ balancing, etc.)

 

client_log.txt

Edited by Shinjikro
Fixed spelling errors
Link to comment
Share on other sites

Well, here's your problem:

[00:01:15]: [string "../mods/Wickerbottom tweaks/modmain.lua"]:34: attempt to index global 'CUSTOM_RECIPETABS' (a nil value)

You don't have a CUSTOM_RECIPETABS variable anywhere. If you're trying to reach a global variable in the game, then you need to do the same as you've done here for RECIPETABS, only for CUSTOM_RECIPETABS.

RECIPETABS = GLOBAL.RECIPETABS

...or put "GLOBAL." in front of all your references to that variable.

Link to comment
Share on other sites

6 hours ago, Ultroman said:

Well, here's your problem:


[00:01:15]: [string "../mods/Wickerbottom tweaks/modmain.lua"]:34: attempt to index global 'CUSTOM_RECIPETABS' (a nil value)

You don't have a CUSTOM_RECIPETABS variable anywhere. If you're trying to reach a global variable in the game, then you need to do the same as you've done here for RECIPETABS, only for CUSTOM_RECIPETABS.


RECIPETABS = GLOBAL.RECIPETABS

...or put "GLOBAL." in front of all your references to that variable.

Omg it worked! THANK YOU SO MUCH

Link to comment
Share on other sites

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
 Share

×
  • Create New...