Jump to content

Recommended Posts

I've been using an old thread as reference to change some crafting recipes, and I'm having issues with the "numtogive" value not working in-game. I was hoping someone might look over my amateur coding work and see why I'm having this problem.

image.thumb.png.2c85803ce981b771093ab9c49ba73712.png

With this in effect both recipes give 1 item, but changing boards to logs worked as intended. I'm trying to change the feather pencil to give 4, and I don't need to change the mini sign. Thanks in advance for the help!

modmain.lua

Edited by Comonavi
16 hours ago, Comonavi said:

I've been using an old thread as reference to change some crafting recipes, and I'm having issues with the "numtogive" value not working in-game. I was hoping someone might look over my amateur coding work and see why I'm having this problem.

image.thumb.png.2c85803ce981b771093ab9c49ba73712.png

With this in effect both recipes give 1 item, but changing boards to logs worked as intended. I'm trying to change the feather pencil to give 4, and I don't need to change the mini sign. Thanks in advance for the help!

modmain.lua 362 B · 2 downloads

smhily seems to have solved it

Note for the future, don't use "Recipe". Not only it's deprecated, Klei uses "Recipe2" now, but modders should use "AddRecipe2" instead to add their own recipes.

Also, let me offer an easier way to accomplish the effect you desire:

GLOBAL.AllRecipes.featherpencil.numtogive = 4

Instead of rewriting the entire recipe, you can call the recipe itself to access the specific element you want to change.

17 hours ago, ariadnesGambit said:

Instead of rewriting the entire recipe, you can call the recipe itself to access the specific element you want to change.

Yes, this is exactly what I needed! I used that bit of code for the remainder of the mod and it's working just as intended now, thanks so much for the help.

image.thumb.png.1b87cc838dc70c16e5cbb6ed068d607a.png

Here is the end result. I'm sure there are some imperfections, but I can't be assed. Thanks again!

Edited by Comonavi
  • GL Happy 1

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