Jump to content

Recommended Posts

So I've tried to create a mod in which you can craft rocks from wood and cutgrass (Wanna add something to "The minimalist challenge")

Everything is fine, I have my recipies, they do work, but I still want to add a description to them.

Please note, that this is my first mod and basically my first modification to a game ever made.

So here is the code:
 

STRINGS = GLOBAL.STRINGS
RECIPETABS = GLOBAL.RECIPETABS
Recipe = GLOBAL.Recipe
Ingredient = GLOBAL.Ingredient
TECH = GLOBAL.TECH
 
Recipe("rocks", { Ingredient("cutgrass", 1), Ingredient("log", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("flint", { Ingredient("rocks", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("nitre", { Ingredient("rocks", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("goldnugget", { Ingredient("rope", 1), Ingredient("rocks", 10)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("moonrocknugget", { Ingredient("goldnugget", 5), Ingredient("nitre", 3)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE
 
STRINGS.RECIPE_DESC.rocks = "Create rock, with grass and log."
STRINGS.RECIPE_DESC.flint = "Create flint, with all mighty rock."
STRINGS.RECIPE_DESC.nitre = "Create nitre, with all mighty rock."
STRINGS.RECIPE_DESC.goldnugget = "Create gold, with rocks and ropes."
STRINGS.RECIPE_DESC.moonrocknugget = "Create moon fragments, with gold and some nitre."

Can someone please explain to me how it should be done so that it can work? 

14 hours ago, Szalyn said:

Can someone please explain to me how it should be done so that it can work? 

The names after RECIPE_DESC also need to be capitalized.

See: scripts/strings.lua:

    RECIPE_DESC =
    {
        BOOK_BIRDS = "1000 species: habits, habitats, and calls.",
        BOOK_TENTACLES = "Let's learn about our subterranean friends!",
        BOOK_GARDENING = "On the care and feeding of plants.",
        BOOK_SILVICULTURE = "A guide to branch management.",

 

  • Big Ups 1

image.thumb.png.e6585bb9bd86f33314781e068eb24c83.png

So I did it, but the game shows a crash now.

Here is the code as for this moment:

STRINGS = GLOBAL.STRINGS
RECIPETABS = GLOBAL.RECIPETABS
Recipe = GLOBAL.Recipe
Ingredient = GLOBAL.Ingredient
TECH = GLOBAL.TECH
 
Recipe("rocks", { Ingredient("cutgrass", 1), Ingredient("log", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("flint", { Ingredient("rocks", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("nitre", { Ingredient("rocks", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("goldnugget", { Ingredient("rope", 1), Ingredient("rocks", 10)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("moonrocknugget", { Ingredient("goldnugget", 5), Ingredient("nitre", 3)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE
 
STRINGS.RECIPE_DESC.ROCKS = "Create rock, with grass and log."
STRINGS.RECIPE_DESC.FLINT = "Create flint, with all mighty rock."
STRINGS.RECIPE_DESC.NITRE = "Create nitre, with all mighty rock."
STRINGS.RECIPE_DESC.GOLDNUGGET = "Create gold, with rocks and ropes."
STRINGS.RECIPE_DESC.MOONROCKNUGGET = "Create moon fragments, with gold and some nitre."

What may be going wrong?

4 hours ago, Szalyn said:

image.thumb.png.e6585bb9bd86f33314781e068eb24c83.png

Recipe("rocks", { Ingredient("cutgrass", 1), Ingredient("log", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("flint", { Ingredient("rocks", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("nitre", { Ingredient("rocks", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("goldnugget", { Ingredient("rope", 1), Ingredient("rocks", 10)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE)
Recipe("moonrocknugget", { Ingredient("goldnugget", 5), Ingredient("nitre", 3)}, RECIPETABS.SCIENCE, TECH.SCIENCE_ONE

What may be going wrong?

You're missing the ')' to end the Recipe function call at the last one there.

  • Like 1
  • Thanks 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...