Jump to content

How to remove a base recipe?


Snakeman

Recommended Posts

I want to remove or desactivated a base.recipe in lua because i want to create a new recipe in a mod.

I tried to add the NeedToBeLearn to true to dissappear on all players but nothing happens.
 

ZAWRemove = {}

function ZAWRemove.ZAW_remove(recipe2)
    local recipe2 = ScriptManager.instance:getRecipe("the name of recipe");
    if recipe2 then
       recipe2:setNeedToBeLearn (true);
    else
    end
end

Events.OnGameStart.Add(ZAWRemove.ZAW_remove);

Link to comment
Share on other sites

  • 1 month later...
On 7/28/2016 at 10:36 AM, Snakeman said:

I want to remove or desactivated a base.recipe in lua because i want to create a new recipe in a mod.

I tried to add the NeedToBeLearn to true to dissappear on all players but nothing happens.
 

ZAWRemove = {}

function ZAWRemove.ZAW_remove(recipe2)
    local recipe2 = ScriptManager.instance:getRecipe("the name of recipe");
    if recipe2 then
       recipe2:setNeedToBeLearn (true);
    else
    end
end

Events.OnGameStart.Add(ZAWRemove.ZAW_remove);

Hey man, pretty simple work around for this. Just copy and paste the vanilla recipe that you want to alter into a new file and change it as you want to:

ORIGINAL RECIPE:

module Base
{
    recipe Make Mortar and Pestle
	{
	   Plank,
	   keep Saw,

	   Result:MortarPestle,
	   SkillRequired:Woodwork=2,
	   Sound:PZ_Hammer,
	   Time:50.0,
	   Category:Carpentry,
	}
}

ALTERED RECIPE:

module Base
{
    recipe Make Mortar and Pestle
	{
	   Plank,
	   keep Saw,

	   Result:MortarPestle,

	   Sound:PZ_Hammer,
	   Time:50.0,
	   Category:Carpentry,
	}
}

You just need to make sure it says module Base at the top and the recipe names match exactly and it should work with no issue. And with the altered file you don't need to copy the entire recipe file, just the one you want to change.

Link to comment
Share on other sites

9 hours ago, tommysticks said:

Hey man, pretty simple work around for this. Just copy and paste the vanilla recipe that you want to alter into a new file and change it as you want to:

ORIGINAL RECIPE:


module Base
{
    recipe Make Mortar and Pestle
	{
	   Plank,
	   keep Saw,

	   Result:MortarPestle,
	   SkillRequired:Woodwork=2,
	   Sound:PZ_Hammer,
	   Time:50.0,
	   Category:Carpentry,
	}
}

ALTERED RECIPE:


module Base
{
    recipe Make Mortar and Pestle
	{
	   Plank,
	   keep Saw,

	   Result:MortarPestle,

	   Sound:PZ_Hammer,
	   Time:50.0,
	   Category:Carpentry,
	}
}

You just need to make sure it says module Base at the top and the recipe names match exactly and it should work with no issue. And with the altered file you don't need to copy the entire recipe file, just the one you want to change.

Are you sure? i was doing that weeks ago and recipes duplicates on crafting panel.

Link to comment
Share on other sites

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