Jump to content

Recommended Posts

I'm trying to make a custom recipe for nightmare fuel where it costs 15 HP+Sanity and i keep bumping into two errors.

undefined or not declared, and if the game doesn't crash sometimes whenever i mess with the code it partially acknowledges the code, via by two blank squares with 15 in both of them in the recipe for nightmare fuel. If anyone could help with this that be awesome
 

The code is in the modmain lua and wonder is the character's name

Spoiler

local require = GLOBAL.require
 local STRINGS = GLOBAL.STRINGS
 GetPlayer = GLOBAL.GetPlayer
  local Ingredient = GLOBAL.Ingredient
  local RECIPETABS = GLOBAL.RECIPETABS
  local TECH = GLOBAL.TECH
  local STRINGS = GLOBAL.STRINGS
  local CHARACTER_INGREDIENT = GLOBAL.CHARACTER_INGREDIENT

  Recipe = GLOBAL.Recipe
  Ingredient = GLOBAL.Ingredient
  TECH = GLOBAL.TECH

  GLOBAL.Recipe("nightmarefuel", {Ingredient(GLOBAL.CHARACTER_INGREDIENT.HEALTH, 15), Ingredient(GLOBAL.CHARACTER_INGREDIENT.SANITY, 15)}, RECIPETABS.REFINE, TECH.MAGIC_ONE, nil, nil, "wonder")


   

6 hours ago, Onedumbazz said:

oh alright, what would be the way to have it be able to have it work for the base and other dlcs?

Use Health:RecalculatePenalty and Sanity:RecalculatePenalty for maximum health and sanity costs, you can have a look at prefabs/waxwelljournal.lua as an example

Edited by _zwb
1 hour ago, _zwb said:

Use Health:RecalculatePenalty and Sanity:RecalculatePenalty for maximum health and sanity costs, you can have a look at prefabs/waxwelljournal.lua as an example

alright, thank you ^^, i'll update when i test it out

hope that you're having a wonderful day/night

7 hours ago, _zwb said:

Use Health:RecalculatePenalty and Sanity:RecalculatePenalty for maximum health and sanity costs, you can have a look at prefabs/waxwelljournal.lua as an example

hey, but i genuinely can't  see how the waxwelljournal.lua can be used for as an example for recipe making, it only has the summoning shadow-maxwell code in it and it's a lil confusing to see how it could be used for recipes

1 hour ago, Onedumbazz said:

hey, but i genuinely can't  see how the waxwelljournal.lua can be used for as an example for recipe making, it only has the summoning shadow-maxwell code in it and it's a lil confusing to see how it could be used for recipes

Oh wait, are you trying to add an item that cost health&sanity rather than maximum health/sanity? I don't think you can do that easily in non-Hamlet worlds

6 minutes ago, _zwb said:

Oh wait, are you trying to add an item that cost health&sanity rather than maximum health/sanity? I don't think you can do that easily in non-Hamlet worlds

yea, the only instance of it being the empty balloons for wes but haven't have much luck finding the code for the recipe of it but eh, i can settle down with making the nightmarefuel cheaper and try to begin the other goal for the character

 

thanks again for the help ^^

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