Jump to content

Recommended Posts

Hi guys!

I need a little help. Im making a mod, but its doesnt working. so i want to make a different recipe to the smelter (in the hamlet dlc). For testing i made a different recipe to the science machine (and its worked), but if i change the name for "smelter" its doesnt working (probably becuse its a DLC stuff)

Here are the mod i made:

So pls help me!

another_craft.zip

Edited by asd988
On 2019. 06. 08. at 6:30 PM, inferjus4 said:

Does "crash" message tells anything what is wrong? Maybe check it next time you try to test your mod?

Its doesnt crash, its just doesnt work, like nothing happened

Edited by asd988

You'd be surprised how often I find out halfway through helping someone, that their mod substitutes several original game files with their own copies ;)

I see what you mean with "smetler". Regardless, it would help if you could attach a zip of your mod so I can investigate.

On 30.6.2019 at 8:30 AM, bizziboi said:

He did in his original post?

Sorry. I was juggling a bunch of posts when I was answering this.

The prefab name for the smelter is "smelter", not "smetler", even though some of the code has the word misspelled. The original Recipe-call that adds the Hamlet recipe for the smelter looks like this:

Recipe("smelter", {Ingredient("cutstone", 6), Ingredient("boards", 4), Ingredient("redgem", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO, RECIPE_GAME_TYPE.PORKLAND, "smetler_placer")

Notice the prefab name is "smelter" and that you need to include the DLC and placer parameters, as well.

-.-
OMG i said i tried either way without spelling good, without spellig bad, and btw if you scroll down you can see "--some tests:" and under it all the things is tested and DONT WORK
 

SO WHAT DONT WORK:
 

Recipe("smetler", {Ingredient("cutgrass", 8),Ingredient("spoiled_food", 4),Ingredient("log", 4)}, RECIPETABS.SCIENCE,  TECH.SCIENCE_TWO)
Recipe("smelter", {Ingredient("cutstone", 6),Ingredient("nitre", 4),Ingredient("redgem", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO)
Recipe("smelter", {Ingredient("cutgrass", 8),Ingredient("spoiled_food", 4),Ingredient("log", 4)}, RECIPETABS.SCIENCE,  TECH.SCIENCE_TWO, smetler_placer)
Recipe("smelter", {Ingredient("cutgrass", 8),Ingredient("spoiled_food", 4),Ingredient("log", 4)}, RECIPETABS.SCIENCE,  TECH.SCIENCE_TWO, smelter_placer)


AAND this is crashes:

Recipe("smelter",  {Ingredient("boneshard", 1),Ingredient("nitre", 2),Ingredient("feather_thunder", 3),Ingredient("goldnugget",5)}, RECIPETABS.MAGIC, TECH.MAGIC_TWO, RECIPE_GAME_TYPE.PORKLAND, "smelter_placer") 

and says that:crash.thumb.png.1dc9f5eb18bf8aaf03e2e4cde6d9d5ec.png

and this is ALSO crashes:

Recipe("smelter",  {Ingredient("boneshard", 1),Ingredient("nitre", 2),Ingredient("feather_thunder", 3),Ingredient("goldnugget",5)}, RECIPETABS.MAGIC, TECH.MAGIC_TWO, RECIPE_GAME_TYPE.PORKLAND, "smetler_placer") 

and says that:
crash2.thumb.png.fde4af506244016dc76947494d3f4167.png


SO now when everyone knows everything, NOW help me

3 hours ago, asd988 said:

-.-
OMG i said i tried either way without spelling good, without spellig bad, and btw if you scroll down you can see "--some tests:" and under it all the things is tested and DONT WORK
 

SO WHAT DONT WORK:
 


Recipe("smetler", {Ingredient("cutgrass", 8),Ingredient("spoiled_food", 4),Ingredient("log", 4)}, RECIPETABS.SCIENCE,  TECH.SCIENCE_TWO)

Recipe("smelter", {Ingredient("cutstone", 6),Ingredient("nitre", 4),Ingredient("redgem", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO)

Recipe("smelter", {Ingredient("cutgrass", 8),Ingredient("spoiled_food", 4),Ingredient("log", 4)}, RECIPETABS.SCIENCE,  TECH.SCIENCE_TWO, smetler_placer)

Recipe("smelter", {Ingredient("cutgrass", 8),Ingredient("spoiled_food", 4),Ingredient("log", 4)}, RECIPETABS.SCIENCE,  TECH.SCIENCE_TWO, smelter_placer)


AAND this is crashes:


Recipe("smelter",  {Ingredient("boneshard", 1),Ingredient("nitre", 2),Ingredient("feather_thunder", 3),Ingredient("goldnugget",5)}, RECIPETABS.MAGIC, TECH.MAGIC_TWO, RECIPE_GAME_TYPE.PORKLAND, "smelter_placer") 

and says that:crash.thumb.png.1dc9f5eb18bf8aaf03e2e4cde6d9d5ec.png

and this is ALSO crashes:


Recipe("smelter",  {Ingredient("boneshard", 1),Ingredient("nitre", 2),Ingredient("feather_thunder", 3),Ingredient("goldnugget",5)}, RECIPETABS.MAGIC, TECH.MAGIC_TWO, RECIPE_GAME_TYPE.PORKLAND, "smetler_placer") 

and says that:
crash2.thumb.png.fde4af506244016dc76947494d3f4167.png


SO now when everyone knows everything, NOW help me

Try putting the string in the spoiler below at the top of your modmain.

Spoiler

local RECIPE_GAME_TYPE = GLOBAL.RECIPE_GAME_TYPE

 

14 hours ago, asd988 said:

-.-
OMG i said i tried either way without spelling good, without spellig bad, and btw if you scroll down you can see "--some tests:" and under it all the things is tested and DONT WORK
SO WHAT DONT WORK:
SO now when everyone knows everything, NOW help me

Chill out, m8. We're spending our free time trying to help you here. There's no reason for that kind of attitude. You aren't able to get it to work, and therefore ask other people to help you, but they have no obligation to do so. I did see your tests, but so many small things can be wrong, and none of the tests included the RECIPE_GAME_TYPE.PORKLAND part, which means that the two tests where you tried to add the placer parameter, you were actually passing it the placer where the game type parameter should be. You cannot omit parameters to the left of the right-most parameter you're using, which in this case was the placer parameter. When using a function you're not familiar with (or that has a lot of parameters) always check the function declaration to see the list and order of parameters, to make sure you're using it right.

That said, Portmanteau is right. That line (if put at the top of your modmain.lua) should fix the crashes you got, provided you use the last line of code you posted, where the placer is correctly named "smetler_placer"). You can't really argue with the original game code (which I posted). The 'name' parameter is spelled "smelter" (right, dictionary-wise) and the 'placer' parameter is spelled "smetler_placer" (wrong, dictionary-wise, but right for you).

Edited by Ultroman

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