Lokoluna Posted November 3, 2016 Share Posted November 3, 2016 So i've been messing with other mods files, and have been able to make custom icons/names for items and have them with their own animation (sorta) But i copied the .lua files from dst for the fishing rod.. but i can't seem to ever give it a actual inventory image or name, what am i doing wrong? Or better yet, should i start making a fishing rod fro mscratch? Link to comment https://forums.kleientertainment.com/forums/topic/71363-custom-fishing-rod/ Share on other sites More sharing options...
Lumina Posted November 3, 2016 Share Posted November 3, 2016 It's always hard to say without seeing the code. Could you put your mod here ? Link to comment https://forums.kleientertainment.com/forums/topic/71363-custom-fishing-rod/#findComment-832530 Share on other sites More sharing options...
Lokoluna Posted November 4, 2016 Author Share Posted November 4, 2016 (edited) local assets = { Asset("ANIM", "anim/fishingrod.zip"), Asset("ANIM", "anim/swap_fishingrod.zip"), } local function onequip (inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_fishingrod", "swap_fishingrod") owner.AnimState:OverrideSymbol("fishingline", "swap_fishingrod", "fishingline") owner.AnimState:OverrideSymbol("FX_fishing", "swap_fishingrod", "FX_fishing") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function onunequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") owner.AnimState:ClearOverrideSymbol("fishingline") owner.AnimState:ClearOverrideSymbol("FX_fishing") end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("fishingrod") inst.AnimState:SetBuild("fishingrod") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("weapon") inst.components.weapon:SetDamage(TUNING.FISHINGROD_DAMAGE) inst.components.weapon.attackwear = 4 ----- inst:AddComponent("fishingrod") inst.components.fishingrod:SetWaitTimes(4, 40) inst.components.fishingrod:SetStrainTimes(0, 5) ------- inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "fishinrod" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip(onequip) inst.components.equippable:SetOnUnequip(onunequip) MakeHauntableLaunch(inst) return inst end return Prefab("common/inventory/fishinrod", fn, assets) The reason it doesn't have a ingame inventory to show is because the game does not provide one. Edited November 4, 2016 by Lokoluna Link to comment https://forums.kleientertainment.com/forums/topic/71363-custom-fishing-rod/#findComment-832937 Share on other sites More sharing options...
Lumina Posted November 4, 2016 Share Posted November 4, 2016 inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "fishinrod" Try adding a line : inst.components.inventoryitem.atlasname = "images/inventoryimages/fishinrod.xml" (or whatever is your xml name) Also, you probably need this in the modmain.lua Assets = { Asset("ATLAS", "images/inventoryimages/fishinrod.xml"), } Let me know if it work. If not, put the entire mod please It's not easy to know if the error is in one file or another. Link to comment https://forums.kleientertainment.com/forums/topic/71363-custom-fishing-rod/#findComment-833149 Share on other sites More sharing options...
Lokoluna Posted November 5, 2016 Author Share Posted November 5, 2016 Worked Great thank you. Do you know how to add a way to make an item be able to be burned? Link to comment https://forums.kleientertainment.com/forums/topic/71363-custom-fishing-rod/#findComment-833555 Share on other sites More sharing options...
Kzisor Posted November 5, 2016 Share Posted November 5, 2016 54 minutes ago, Lokoluna said: Worked Great thank you. Do you know how to add a way to make an item be able to be burned? A good file to study up on is the standardcomponents.lua file in the data/scripts folder. It has a lot of useful global functions that a lot of the standard prefabs use. Link to comment https://forums.kleientertainment.com/forums/topic/71363-custom-fishing-rod/#findComment-833575 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now