QuickShot010 Posted March 20, 2016 Share Posted March 20, 2016 Hello good people! Is it possible to reskin a tool (for example the axe and the pickaxe) and have it reskinned for only one character? I want to make the tools more primitive for my character Drok the Caveman, but i don't want to create a whole new axe item for him. All help is appreciated! -Space Monkey Link to comment Share on other sites More sharing options...
Arkathorn Posted March 20, 2016 Share Posted March 20, 2016 Sure. Just use 'AddPrefabPostInit' to add an 'if' statement that checks who the player is, and set the animation to a custom one you made. --In 'modmain.lua' AddPrefabPostInit("axe",function(inst) if GetPlayer().prefab == "drok" then inst.AnimState:SetBank("primativeaxe") inst.AnimState:SetBuild("primativeaxe") inst.AnimState:PlayAnimation("idle") --Since it's equippable, you'll also need to override the 'OnEquip' and 'OnDequip' functions --Just copy the relevant code from 'axe.lua', but use a swap animation of your own end end You should also put the animations in an 'Assets' table in 'modmain.lua'. Make sure it is not a local table though. Link to comment Share on other sites More sharing options...
Mobbstar Posted March 20, 2016 Share Posted March 20, 2016 It's probably worth noting that DST supports item skins (e.g. backpack), so those might clash with your item if you decide to make them DST compatible. Link to comment Share on other sites More sharing options...
QuickShot010 Posted March 20, 2016 Author Share Posted March 20, 2016 37 minutes ago, Arkathorn said: Sure. Just use 'AddPrefabPostInit' to add an 'if' statement that checks who the player is, and set the animation to a custom one you made. --In 'modmain.lua' AddPrefabPostInit("axe",function(inst) if GetPlayer().prefab == "drok" then inst.AnimState:SetBank("primativeaxe") inst.AnimState:SetBuild("primativeaxe") inst.AnimState:PlayAnimation("idle") --Since it's equippable, you'll also need to override the 'OnEquip' and 'OnDequip' functions --Just copy the relevant code from 'axe.lua', but use a swap animation of your own end end You should also put the animations in an 'Assets' table in 'modmain.lua'. Make sure it is not a local table though. Thanks! That sounds simple enough! How do i override the OnEquip and OnDequip function though? It's been a while since i had a go at modding. Would using this method also make it possible to alter the dropped texture without changing the default axe (with a thought of making it DST compatible, so axes crafted by other players still look like the normal one)? Thank you for your time! 26 minutes ago, Mobbstar said: It's probably worth noting that DST supports item skins (e.g. backpack), so those might clash with your item if you decide to make them DST compatible. I'm guessing if i name the animation "primitiveaxe" it wouldn't interfere with other skins right? Link to comment Share on other sites More sharing options...
CheeseburgerCockatoo Posted March 20, 2016 Share Posted March 20, 2016 1 hour ago, Mobbstar said: It's probably worth noting that DST supports item skins (e.g. backpack), so those might clash with your item if you decide to make them DST compatible. They shouldn't, due to how skins work with Dyn Files. Link to comment Share on other sites More sharing options...
QuickShot010 Posted March 22, 2016 Author Share Posted March 22, 2016 Okay, i need some more help. This is what i have done right now: (...) Asset("ANIM", "anim/primitiveaxe.zip"), Asset("ATLAS", "images/inventoryimages/primitiveaxe.xml"), Asset("ANIM", "anim/swap_primitiveaxe.zip"), (...) AddPrefabPostInit("axe",function(inst) if GLOBAL.GetPlayer().prefab == "drok" then inst.AnimState:SetBank("primitiveaxe") inst.AnimState:SetBuild("primitiveaxe") inst.AnimState:PlayAnimation("idle") local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_primitiveaxe", "swap_primitiveaxe") 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") end end end) For some reason it still won't work, can someone please take a look at this? The ground animation is invisible for Drok, but when i play as Wilson you can see it. So i guess that's a small step in the right direction. Thanks for your help in advance! Link to comment Share on other sites More sharing options...
Mobbstar Posted March 22, 2016 Share Posted March 22, 2016 @QuickShot010 First of all, remember to set the inventory image (and atlas) as well. Your animation is most likely faulty. Make sure you named everything correctly. Link to comment Share on other sites More sharing options...
QuickShot010 Posted March 22, 2016 Author Share Posted March 22, 2016 @Mobbstar I've done the inventory image now, it's still showing the default axe. I don't think my animation is faulty as i called the build "primitiveaxe" and the animation "idle". I'm really confused on what to do now. Would you know by chance? Link to comment Share on other sites More sharing options...
QuickShot010 Posted March 24, 2016 Author Share Posted March 24, 2016 Okay, everything is working except when the character holds his axe he holds an invisible axe, My question now is how do i get the animation to work? I renamed the build to swap_primitiveaxe, so the build name is correct. Any help here? Thanks a lot! Link to comment Share on other sites More sharing options...
Mobbstar Posted March 24, 2016 Share Posted March 24, 2016 @QuickShot010 Take a look at this Link to comment Share on other sites More sharing options...
Recommended Posts
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.