Jump to content

Harder recipes mod, Need help!


Recommended Posts

So I'm making a mod, as I mentioned before. All that my mod does is changes the amount of stuff you need to craft something and changes what you need as well. But one problem: when I install my mod and click on Science tab the game crashes. Here's the error:

 

20rn1ue.png

 

Here's my Science part in modmain:

 

 

--SCIENCE
Recipe("researchlab", {Ingredient("goldnugget", 4),Ingredient("log", 6),Ingredient("rocks", 10),Ingredient("rope", 1),Ingredient("gears", 2),Ingredient("twigs", 6),Ingredient("transistor"), 1}, RECIPETABS.SCIENCE, TECH.NONE, "researchlab_placer")
Recipe("researchlab2", {Ingredient("boards", 4),Ingredient("cutstone", 9), Ingredient("transistor", 2),Ingredient("gears", 3),}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE, "researchlab2_placer")
Recipe("transistor", {Ingredient("goldnugget", 2), Ingredient("cutstone", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("winterometer", {Ingredient("boards", 2), Ingredient("goldnugget", 2)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE, "winterometer_placer")
Recipe("rainometer", {Ingredient("boards", 2), Ingredient("goldnugget", 2), Ingredient("rope",2)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE, "rainometer_placer")
Recipe("gunpowder", {Ingredient("rottenegg", 1), Ingredient("charcoal", 1), Ingredient("nitre", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO)
Recipe("lightning_rod", {Ingredient("goldnugget", 4), Ingredient("cutstone", 1), Ingredient("lightninggoathorn", 1), Ingredient("marble")},
RECIPETABS.SCIENCE, TECH.SCIENCE_ONE, "lightning_rod_placer")
Recipe("firesuppressor", {Ingredient("gears", 2),Ingredient("ice", 15),Ingredient("transistor", 2),Ingredient("cutstone", 8)}, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO, "firesuppressor_placer")
 
Please help me figure out the error, I really want to get into mod making.
Link to comment
Share on other sites

 

Did you define the following in modmain?

 

RECIPETABS = GLOBAL.RECIPETABS
Recipe = GLOBAL.Recipe
Ingredient = GLOBAL.Ingredient
TECH = GLOBAL.TECH
 
or something to that effect?

 

Yes I do have it, but I only used that for Purple gem refining.

 

Question: Why do I need it? What difference does it make? For the purple gem I needed it, all tho I didn't even change the Purple gem recipe! All tho I did put it in Magic section (yes, I DID rename SCIENCE_ONE for it to MAGIC_[whatever prestihatitator prototyper is called])

 

And I don't want to post all of my modmain, because someone might steal my mod.

Link to comment
Share on other sites

Yes I do have it, but I only used that for Purple gem refining.

 

Question: Why do I need it? What difference does it make? For the purple gem I needed it, all tho I didn't even change the Purple gem recipe! All tho I did put it in Magic section (yes, I DID rename SCIENCE_ONE for it to MAGIC_[whatever prestihatitator prototyper is called])

 

And I don't want to post all of my modmain, because someone might steal my mod.

 

VARIABLE = GLOBAL.VARIABLE

 

Those are needed because they are global variables, and they need to be declared in your modmain so that the game knows what you mean when you say stuff like

 

DoThings(VARIABLE)

 

since otherwise, VARIABLE is nil, and you can't do something with nothing.

 

If you won't post your code, then we can't help you much.

 

That's also a very confusing stance to have, since your mod will be open source when you release it.

 

Up and Away, for instance, has been visible since it's inception, and nobody stole it.

Link to comment
Share on other sites

@debugman18 but he only changes recipes and look here:
Recipe("researchlab", {Ingredient("goldnugget", 4),Ingredient("log", 6),Ingredient("rocks", 10),Ingredient("rope", 1),Ingredient("gears", 2),Ingredient("twigs", 6),Ingredient("transistor"), 1}, RECIPETABS.SCIENCE, TECH.NONE, "researchlab_placer")
 
Ingredient("transistor"), 1 --> Ingredient("transistor", 1)

Link to comment
Share on other sites

@debugman18 but he only changes recipes and look here:

Recipe("researchlab", {Ingredient("goldnugget", 4),Ingredient("log", 6),Ingredient("rocks", 10),Ingredient("rope", 1),Ingredient("gears", 2),Ingredient("twigs", 6),Ingredient("transistor"), 1}, RECIPETABS.SCIENCE, TECH.NONE, "researchlab_placer")

 

Ingredient("transistor"), 1 --> Ingredient("transistor", 1)

poker_face.png

!£$^$%*()^*&)*(_^&&$£^%(%^$^&^&$%!!!

Link to comment
Share on other sites

@debugman18 but he only changes recipes and look here:

Recipe("researchlab", {Ingredient("goldnugget", 4),Ingredient("log", 6),Ingredient("rocks", 10),Ingredient("rope", 1),Ingredient("gears", 2),Ingredient("twigs", 6),Ingredient("transistor"), 1}, RECIPETABS.SCIENCE, TECH.NONE, "researchlab_placer")

 

Ingredient("transistor"), 1 --> Ingredient("transistor", 1)

 

That's true, but he still had a question that needed to be answered about a fairly important bit of information for a modder. That bit with GLOBAL is used all of the time, so knowing why it's important is, well, important.

 

Your fix is correct. He was passing the ingredient name correctly, but was passing the quantity outside of it.

Link to comment
Share on other sites

poker_face.png

!£$^$%*()^*&)*(_^&&$£^%(%^$^&^&$%!!!

Killed me with that xD

 

That's true, but he still had a question that needed to be answered about a fairly important bit of information for a modder. That bit with GLOBAL is used all of the time, so knowing why it's important is, well, important.

 

Your fix is correct. He was passing the ingredient name correctly, but was passing the quantity outside of it.

Okay, I'll left it to do for you :)

Link to comment
Share on other sites

Allright, allright, that Poker face thing was only a joke.

 

Anyways, so how should I write my Science bit? It still crashes. I do have this at the beginning of the file:

 

local Ingredient = GLOBAL.Ingredient
local RECIPETABS = GLOBAL.RECIPETABS
local STRINGS = GLOBAL.STRINGS
local Recipe = GLOBAL.Recipe
local TECH = GLOBAL.TECH
local recipe = Recipe
local tuning = Tuning
Link to comment
Share on other sites

 

Allright, allright, that Poker face thing was only a joke.

 

Anyways, so how should I write my Science bit? It still crashes. I do have this at the beginning of the file:

 

local Ingredient = GLOBAL.Ingredient
local RECIPETABS = GLOBAL.RECIPETABS
local STRINGS = GLOBAL.STRINGS
local Recipe = GLOBAL.Recipe
local TECH = GLOBAL.TECH
local recipe = Recipe
local tuning = Tuning

 

 

What is the specific error you are getting?

 

Also, what are you using these variables for?

 

local recipe = Recipe
local tuning = Tuning

 

Link to comment
Share on other sites

 

What is the specific error you are getting?

 

Also, what are you using these variables for?

 

local recipe = Recipe
local tuning = Tuning

 

I don't even know what it does! Minik453 just told me to write it and didn't give a reason why. I'm guessing that's something to do with functioning stuff... idk. It was mainly for fixing Purple gem bug which happened without a reason.

 

And I don't know how to post my modmain so you can download it.

Link to comment
Share on other sites

I said, try to use my modmain in 5th post... I posted repaired modmain from our private chat with trinkets in recipes. And those
local recipe = Recipe
local tuning = Tuning

I posted because it crashed without it :/

Link to comment
Share on other sites

Yeah, well never mind trinkets (Actually thanks for doing that) I tried to have my program without the trinkets and it still crashed. I think the problem is that having so many items required to craft something just crashes the game or even just modifying Science tab recipes makes the game crash: the question is why and how to fix this.

 

EDIT: hei the mod actually works now! Wow! I do not know what was the problem before, but it sure works now! I tried to test this and created a science machine (obviously debug spawned stuff) and then hammered it to see if it crashes or of it drops half of the stuff I required as recipes for it and it worked as well! I decided to remove the doodad for Science machine, I don't even know why I added it for it sinse you need Science machine to actually build the doodad itself, lol.

Link to comment
Share on other sites

There are two things I just want to add for this mod:
 
1) add more loot to drop from mobs and stuff
2) make it so the recipes look more like this (basically have all items in the craft thing show smaller and for the first item to start at the left side and continue to the right up until the 6th item and then go a row down):

keiz6f.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...