Jump to content

Mod Recipe Issues

Recommended Posts

In my mod I have added a gold fragment prefab. 4 gold fragments can be made from 1 gold nugget via a recipe in the refine tab whereas 1 gold nugget can be split into 4 gold fragments from the same tab.


I have encountered a strange issue in that when the recipe for the 4 fragments -> 1 gold nugget is displayed, the 4 gold fragments do not render in the recipe.




This imgur album shows both the working recipe and the recipe which isn't displaying correctly



Relevant code:



...Assets = {	Asset("ATLAS","images/inventoryimages/goldfragment.xml"),	Asset("IMAGE","images/inventoryimages/goldfragment.tex"),}		STRINGS = GLOBAL.STRINGSRECIPETABS = GLOBAL.RECIPETABSRecipe = GLOBAL.RecipeIngredient = GLOBAL.IngredientTECH = GLOBAL.TECHSTRINGS.NAMES.GOLDNUGGET = "Gold Nugget"STRINGS.RECIPE_DESC.GOLDNUGGET = "Shiny!"		local goldfragment = GLOBAL.Recipe("goldfragment",{ Ingredient("goldnugget", 1)},RECIPETABS.REFINE, TECH.NONE,nil,nil,nil,4)goldfragment.atlas = "images/inventoryimages/goldfragment.xml"goldfragment.texture = "images/inventoryimages/goldfragment.tex"		local goldnugget = GLOBAL.Recipe("goldnugget",{ Ingredient("goldfragment", 4)},RECIPETABS.REFINE, TECH.NONE)...


local Assets={	Asset("ANIM", "anim/goldfragment.zip"),	Asset("ATLAS", "images/inventoryimages/goldfragment.xml"),}STRINGS.NAMES.GOLDFRAGMENT= "Gold Fragment"		STRINGS.RECIPE_DESC.GOLDFRAGMENT = "A fragment of gold"STRINGS.CHARACTERS.GENERIC.DESCRIBE.GOLDFRAGMENT = "It's so small!"local function fn(Sim)            local inst = CreateEntity()	inst.entity:AddTransform()	inst.entity:AddAnimState()	inst.entity:AddPhysics()	        MakeInventoryPhysics(inst)	    inst.AnimState:SetBank("goldfragmentbank")    inst.AnimState:SetBuild("goldfragment")    inst.AnimState:PlayAnimation("idle", true)        inst:AddComponent("inspectable")        inst:AddComponent("stackable")	inst.components.stackable.maxsize = 100	    inst:AddComponent("inventoryitem")	inst.components.inventoryitem.atlasname = "images/inventoryimages/goldfragment.xml"	        return instendreturn Prefab( "common/inventory/goldfragment", fn, Assets) 

Any help would be greatly appreciated, cheers!

Link to comment
Share on other sites


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