Milllk Posted September 21, 2015 Share Posted September 21, 2015 the function maybe right, i copied from the orange staff,but there's no mouse hover effect. i looked into the common action files,but can't get further. how can i have the mouse hover effect ,and get the position,that will help to invoke the blink function . Link to comment Share on other sites More sharing options...
Milllk Posted September 22, 2015 Author Share Posted September 22, 2015 who can help me with this. i tried to add on to the action tab,but didnt work. what i want to do is a copy item like the orange staff, but it has less cost to blink,i thought it wont be this hard. but the mouse dont have any hover effect at all, so when equip ,cant call the blink function by right click. where did i go wrong? Link to comment Share on other sites More sharing options...
DrSmugleaf Posted September 22, 2015 Share Posted September 22, 2015 Upload your mod folder or mod files if you can. Link to comment Share on other sites More sharing options...
Milllk Posted September 22, 2015 Author Share Posted September 22, 2015 Upload your mod folder or mod files if you can.local assets ={Asset("ANIM", "anim/amulets.zip"),Asset("ANIM", "anim/torso_amulets.zip"),Asset( "IMAGE", "images/inventoryimages/purpleamuletplus.tex" ),Asset( "ATLAS", "images/inventoryimages/purpleamuletplus.xml" ),}local prefabs ={}local function onblink(staff, pos, caster)if caster.components.sanity ~= nil thencaster.components.sanity:DoDelta(-TUNING.SANITY_MED*.5)endendlocal function blinkstaff_reticuletargetfn()local player = ThePlayerlocal rotation = player.Transform:GetRotation() * DEGREESlocal pos = player:GetPosition()for r = 13, 1, -1 dolocal numtries = 2 * PI * rlocal pt = FindWalkableOffset(pos, rotation, r, numtries)if pt ~= nil thenreturn pt + posendendendlocal function onequip_purple(inst, owner)owner.AnimState:OverrideSymbol("swap_body", "torso_amulets", "purpleamulet")if inst.components.fueled theninst.components.fueled:StartConsuming()endendlocal function onunequip_purple(inst, owner)owner.AnimState:ClearOverrideSymbol("swap_body")if inst.components.fueled theninst.components.fueled:StopConsuming()endendlocal function commonfn(anim, tag, custom_init)local inst = CreateEntity()inst.entity:AddTransform()inst.entity:AddAnimState()inst.entity:AddNetwork()MakeInventoryPhysics(inst)inst.AnimState:SetBank("amulets")inst.AnimState:SetBuild("amulets")inst.AnimState:PlayAnimation(anim)if tag ~= nil theninst:AddTag(tag)endinst.foleysound = "dontstarve/movement/foley/jewlery"if custom_init ~= nil thencustom_init(inst)endinst.entity:SetPristine()if not TheWorld.ismastersim thenreturn instendinst:AddComponent("inspectable")inst:AddComponent("equippable")inst.components.equippable.equipslot = EQUIPSLOTS.BODYinst.components.equippable.dapperness = TUNING.DAPPERNESS_SMALLinst:AddComponent("inventoryitem")inst.components.inventoryitem.atlasname = "images/inventoryimages/purpleamuletplus.xml"return instendlocal function purpleplus()local inst = commonfn("purpleamulet")inst:AddComponent("reticule")inst.components.reticule.targetfn = blinkstaff_reticuletargetfninst.components.reticule.ease = trueif not TheWorld.ismastersim thenreturn instendinst.fxcolour = {1, 145/255, 0}inst.castsound = "dontstarve/common/staffteleport"inst:AddComponent("blinkstaff")inst.components.blinkstaff.onblinkfn = onblinkinst:AddComponent("fueled")inst.components.fueled.fueltype = FUELTYPE.MAGICinst.components.fueled:InitializeFuelLevel(TUNING.PURPLEAMULET_FUEL)inst.components.fueled:SetDepletedFn(inst.Remove)inst.components.equippable:SetOnEquip(onequip_purple)inst.components.equippable:SetOnUnequip(onunequip_purple)inst.components.equippable.dapperness = -TUNING.DAPPERNESS_MEDinst.components.equippable.walkspeedmult = .6MakeHauntableLaunch(inst)return instendreturn Prefab("common/inventory/purpleamuletplus", purpleplus, assets, prefabs) Link to comment Share on other sites More sharing options...
Milllk Posted September 23, 2015 Author Share Posted September 23, 2015 Upload your mod folder or mod files if you can.i use the copy of the orange staff,but it didn't work,there 's no mouse hover effect.so i have to give up this item temporarily. Link to comment 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