Jump to content

Recommended Posts

Hello!
Im new at modding and want to add second recipe to the item ( Basically its WX-71 fixing modules with gears mod )
Here what i tried :
 

local require = GLOBAL.require
local STRINGS = GLOBAL.STRINGS
local Ingredient = GLOBAL.Ingredient
local Recipe = GLOBAL.Recipe
local TECH = GLOBAL.TECH
local Angaraty = GLOBAL.Gargoga1
local SCIENCE_TWO = { SCIENCE = 2}
local SCIENCE_ONE = { SCIENCE = 1}
local NONE = TechThe.Create()
AddRecipe2("Wxpr1", {Ingredient("wx78module_movespeed", 1), Ingredient("gears", 1)}, TECH.SCIENCE_ONE, {product = "wx78module_movespeed"})
AddRecipe2("Wxpr2", {Ingredient("wx78module_movespeed2", 1), Ingredient("gears", 3)}, TECH.SCIENCE_TWO, {product = "wx78module_movespeed2"})

basically my code didn`t work
Game says
"Failed to start dedicated server"
When i turn off My mod this sstart to works

Game won't launch if there's THIS code, I don't really understand your code, it looks strange somehow but if I would want to replace it with something I would use something like that:
 

local function RemoveOriginalRecipe()
    local old_recipe = _G.AllRecipes["wx78module_movespeed"]
    if old_recipe then
        _G.AllRecipes["wx78module_movespeed"] = nil
    end
end

local function AddNewRecipe()
    Recipe2(
        "wx78module_movespeed",                           
        {
            Ingredient("scandata", 2),                    
            Ingredient("rabbit", 1)                       
        },
        TECH.ROBOTMODULECRAFT_ONE,                       
        {
            builder_tag = "upgrademoduleowner",          
            atlas = "images/inventoryimages/wx78module_movespeed.xml",
            image = "wx78module_movespeed.tex",
        },
        {"MODULES"}                                      
    )
end

AddPrefabPostInit("world", function(inst)
    RemoveOriginalRecipe()
    AddNewRecipe()
end)

STRINGS.RECIPE_DESC.WX78MODULE_MOVESPEED = "Does she know how to make grilled cheese?"

 

Edited by Mr.CrazyPotato

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