Jump to content

Recommended Posts

You ever get to that point where you have to admit defeat? welp i'm there.... *I've been at it for over 7 hours now*

The whole point of this entire thing is the side crafting icon, (otherwise known as a secondary ingredient icon) will not show up no matter what, I've tried looking on several other older threads but no dice! I have provided a screenshot, the log, the mod main and the lua. Can anyone help shed a little light onto this along with some idea why this occurring? I would be forever grateful, I have been trying to use this thread as a reference, but I can't seem to grasp what he intended.dB3pP.jpg

log.txt

modmain.lua

rena.lua

Edited by Renamon
Link to comment
https://forums.kleientertainment.com/forums/topic/47011-coding-help/
Share on other sites

What is and what is in the prefab of that item?

 

local assets=

{

    Asset("ANIM", "anim/renahat.zip"),

    Asset("ATLAS", "images/inventoryimages/renahat.xml")

}

local function onequip(inst, owner)

        owner.AnimState:OverrideSymbol("swap_hat", "renahat", "swap_hat")

        owner.AnimState:Show("HAT")

        owner.AnimState:Show("HAT_HAIR")

        owner.AnimState:Hide("HAIR_NOHAT")

        owner.AnimState:Hide("HAIR")

end

local function onunequip(inst, owner)

        owner.AnimState:Hide("HAT")

        owner.AnimState:Hide("HAT_HAIR")

        owner.AnimState:Show("HAIR_NOHAT")

        owner.AnimState:Show("HAIR")

end

local function fn(Sim)

    local inst = CreateEntity()

    local trans = inst.entity:AddTransform()

    local anim = inst.entity:AddAnimState()

    MakeInventoryPhysics(inst)

    

    inst:AddTag("hat")

    

    anim:SetBank("tophat")

    anim:SetBuild("renahat")

    anim:PlayAnimation("anim")    

        

    inst:AddComponent("inspectable")

    

   

    

    inst:AddComponent("inventoryitem")

    inst.components.inventoryitem.atlasname = "images/inventoryimages/renahat.xml"

    

    inst:AddComponent("dapperness")

    inst.components.dapperness.dapperness = (TUNING.DAPPERNESS_MED * 2)

    

    inst:AddComponent("equippable")

    inst.components.equippable.equipslot = EQUIPSLOTS.HEAD

    

    inst.components.equippable:SetOnEquip( onequip )

    inst.components.equippable:SetOnUnequip( onunequip )

    

    return inst

end

return Prefab( "common/inventory/renahat", fn, assets)

there you go

Edited by Renamon

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