Jump to content

Recommended Posts

Straight to the point, when my client tries to create custom items with custom recipes(by a custom character), she does the action but the item is not made. As a host, I can create them no problem. Did they update something? I'm playing on ROG btw.

 

Heres a tidbit of it:

 

The item

local assets ={	Asset("ANIM", "anim/formredgem.zip"),    Asset("ATLAS", "images/inventoryimages/formredgem.xml"),	Asset("IMAGE", "images/inventoryimages/formredgem.tex"),}local prefabs = {	"redgem",}-- Still does nothing. Dunno what it should do...local function fn(Sim)	local inst = CreateEntity()	inst.entity:AddTransform()	inst.entity:AddAnimState()    MakeInventoryPhysics(inst)	inst.entity:AddTransform()	inst.entity:AddAnimState()	inst.entity:AddSoundEmitter()    inst.entity:AddNetwork()    	inst:AddTag("formredgem")	    if not TheWorld.ismastersim then        return inst    end		inst.entity:AddLight()    inst.Light:Enable(true)    inst.Light:SetRadius(1)    inst.Light:SetFalloff(.6)    inst.Light:SetIntensity(0.9)    inst.Light:SetColour(231/255,49/255,62/255)		inst.entity:SetPristine()         inst.AnimState:SetBank("formredgem")    inst.AnimState:SetBuild("formredgem")    inst.AnimState:PlayAnimation("idle", false)	    MakeHauntableLaunch(inst)    inst:AddComponent("inspectable")		inst:AddComponent("stackable")	inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM			inst:AddComponent("perishable")	inst.components.perishable:SetPerishTime(TUNING.PERISH_ONE_DAY)	inst.components.perishable:StartPerishing()	inst.components.perishable.onperishreplacement = "redgem"	    inst:AddComponent("inventoryitem")	inst.components.inventoryitem.imagename = "formredgem"	inst.components.inventoryitem.atlasname = "images/inventoryimages/formredgem.xml"	    return instendreturn Prefab( "common/inventory/formredgem", fn, assets) 

 

A tidbit of the code recipe(In Modmain of course):

	local require = GLOBAL.requirelocal STRINGS = GLOBAL.STRINGSlocal resolvefilepath = GLOBAL.resolvefilepathlocal Ingredient = GLOBAL.Ingredientlocal RECIPETABS = GLOBAL.RECIPETABSlocal Recipe = GLOBAL.Recipelocal TECH = GLOBAL.TECHlocal formredgem_recipe = Recipe("formredgem",  {Ingredient("flint", 3),Ingredient("charcoal", 2),Ingredient("goldnugget", 1)}, RECIPETABS.ANCIENT, TECH.ANCIENT_TWO) 		formredgem_recipe.atlas = resolvefilepath("images/inventoryimages/formredgem.xml")		formredgem_recipe.tagneeded = true		formredgem_recipe.sortkey = -5000		formredgem_recipe.builder_tag ="ancient_builder"

Edited by rons0n

@rons0n, that is no longer how you create custom recipes. You should be using the AddRecipe function as PeterA has fixed it so that recipes using that method will no longer need to set the tagneeded to true or the sortkey.

 

You should be able to see rezecib's post which is stickied at the top of this sub-forum for more details about it. 

 

Edit: Seems rezecib has not updated his post with the new information.

Edit 2: UPDATE! Thanks to PeterA for finding this information for me to repost.

Quick update, this is what adding a new recipe will look like from your modmain now. You don't need to specify "bindingring.tex" though, that's optional, since we assume the image will be name .. ".tex"

AddRecipe("bindingring", {GLOBAL.Ingredient("goldnugget", 10), GLOBAL.Ingredient("moonrocknugget", 1)}, GLOBAL.RECIPETABS.MAGIC, GLOBAL.TECH.NONE, nil, nil, nil, nil, nil, "images/inventoryimages/bindingring.xml", "bindingring.tex" )
Edited by Kzisor

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