Jump to content

Hide it


Recommended Posts

Hi everyone

 

The mod "Spider Cage" on Steam

 

Playing around with the new feature configure mod, I have options of Normal and Expert.I would love to be able to hide the recipe for none enabled prefabs.When you try to build the none enabled version of the Spider Cage  the game won't let you but, it still take your materials.So i would like to just hide it.The reason it needs to be an option is so you can't accidentally build the dangerous cage.And I don't want to make two versions of the mod.

 

Not ideal but except-able option would be no material consumption.

 

 

Any help would be great!

Link to comment
Share on other sites

From your modmain.lua:

local enabled = (GetModConfigData("Mode")=="on")local disabled = (GetModConfigData("Mode")=="off")		if disabled then 		PrefabFiles = {"silk_farm"}		else		if enabled then 		PrefabFiles = {"silk_farm_advanced","spider_baby"}	endendAssets = 	{		Asset("ATLAS", "images/inventoryimages/silk_farm.xml"),		Asset( "IMAGE", "minimap/silk_farm.tex" ),		Asset( "ATLAS", "minimap/silk_farm.xml" ),		}		AddMinimapAtlas("minimap/silk_farm.xml")		STRINGS = GLOBAL.STRINGS		RECIPETABS = GLOBAL.RECIPETABS		Recipe = GLOBAL.Recipe		Ingredient = GLOBAL.Ingredient		TECH = GLOBAL.TECH		GLOBAL.STRINGS.NAMES.SILK_FARM = "Spider Cage"		STRINGS.RECIPE_DESC.SILK_FARM = "Silk collection at it's best"		GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SILK_FARM = "Hope it's strong enough!"		GLOBAL.STRINGS.NAMES.SILK_FARM_ADVANCED = "Expert Spider Cage"		STRINGS.RECIPE_DESC.SILK_FARM_ADVANCED = "Silk collection at it's best"		GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SILK_FARM_ADVANCED = "It's no match for me!"		local silk_farm = GLOBAL.Recipe("silk_farm",	{ 		Ingredient("spidereggsack", GetModConfigData("Spider Eggs")),		Ingredient("goldnugget", GetModConfigData("Gold Nuggets")),		Ingredient("boards", GetModConfigData("Boards")) 	},		RECIPETABS.TOWN, TECH.NONE, "silk_farm_placer" )		silk_farm.atlas = "images/inventoryimages/silk_farm.xml"		local silk_farm_advanced = GLOBAL.Recipe("silk_farm_advanced",	{		Ingredient("spidereggsack", GetModConfigData("Spider Eggs")),		Ingredient("goldnugget",GetModConfigData("Gold Nuggets")),		Ingredient("boards", GetModConfigData("Boards")) 	},		RECIPETABS.TOWN, TECH.NONE, "silk_farm_placer" )		silk_farm_advanced.atlas = "images/inventoryimages/silk_farm_advanced.xml"TUNING.SILK_AMOUNT = 6

Replace

		local silk_farm_advanced = GLOBAL.Recipe("silk_farm_advanced",	{		Ingredient("spidereggsack", GetModConfigData("Spider Eggs")),		Ingredient("goldnugget",GetModConfigData("Gold Nuggets")),		Ingredient("boards", GetModConfigData("Boards")) 	},		RECIPETABS.TOWN, TECH.NONE, "silk_farm_placer" )		silk_farm_advanced.atlas = "images/inventoryimages/silk_farm_advanced.xml"

with

if enabled then        local silk_farm_advanced = GLOBAL.Recipe("silk_farm_advanced",    {        Ingredient("spidereggsack", GetModConfigData("Spider Eggs")),        Ingredient("goldnugget",GetModConfigData("Gold Nuggets")),        Ingredient("boards", GetModConfigData("Boards"))    },        RECIPETABS.TOWN, TECH.NONE, "silk_farm_placer" )        silk_farm_advanced.atlas = "images/inventoryimages/silk_farm_advanced.xml"end

Then, if the expert mode is not enabled, that "Advanced Silk Farm" recipe will not even be registered.

Does that solve your issues?

Link to comment
Share on other sites

Here we almost have it but, on the recipe tab if enabled the atlas is the same as the one above it.

if not enabled the atlas shows correctly.Only one is showing at this point and recipes can be crafted.

 

if not enabled then
local silk_farm = GLOBAL.Recipe("silk_farm",
{
Ingredient("spidereggsack", GetModConfigData("Spider Eggs")),
Ingredient("goldnugget", GetModConfigData("Gold Nuggets")),
Ingredient("boards", GetModConfigData("Boards"))
},
RECIPETABS.TOWN, TECH.NONE, "silk_farm_placer" )
silk_farm.atlas = "images/inventoryimages/silk_farm.xml"
else
if enabled then
local silk_farm_advanced = GLOBAL.Recipe("silk_farm_advanced",
{
Ingredient("spidereggsack", GetModConfigData("Spider Eggs")),
Ingredient("goldnugget",GetModConfigData("Gold Nuggets")),
Ingredient("boards", GetModConfigData("Boards"))
},
RECIPETABS.TOWN, TECH.NONE, "silk_farm_placer" )
silk_farm_advanced.atlas = "images/inventoryimages/silk_farm_advanced.xml"
end
end
Link to comment
Share on other sites

 

Here we almost have it but, on the recipe tab if enabled the atlas is the same as the one above it.

if not enabled the atlas shows correctly.Only one is showing at this point and recipes can be crafted.

 

if not enabled then

local silk_farm = GLOBAL.Recipe("silk_farm",

{

Ingredient("spidereggsack", GetModConfigData("Spider Eggs")),

Ingredient("goldnugget", GetModConfigData("Gold Nuggets")),

Ingredient("boards", GetModConfigData("Boards"))

},

RECIPETABS.TOWN, TECH.NONE, "silk_farm_placer" )

silk_farm.atlas = "images/inventoryimages/silk_farm.xml"

else

if enabled then

local silk_farm_advanced = GLOBAL.Recipe("silk_farm_advanced",

{

Ingredient("spidereggsack", GetModConfigData("Spider Eggs")),

Ingredient("goldnugget",GetModConfigData("Gold Nuggets")),

Ingredient("boards", GetModConfigData("Boards"))

},

RECIPETABS.TOWN, TECH.NONE, "silk_farm_placer" )

silk_farm_advanced.atlas = "images/inventoryimages/silk_farm_advanced.xml"

end

end

 

Fixed
Although the atlas had showed before i had never added it in as an asset.
 
Thanks for the good starting place!
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...