MrGurtis Posted July 14, 2018 Share Posted July 14, 2018 I did some snooping and I couldn't find any topics that answered this question (that or i'm a terrible detective). I'm currently working on a mod and I was wondering if there was a way that could increase a boomerang's impact damage the further it has to travel to it's target. Link to comment https://forums.kleientertainment.com/forums/topic/93502-weapon-damage-based-on-distance-from-target/ Share on other sites More sharing options...
Makishim Posted July 23, 2018 Share Posted July 23, 2018 You can start a timer when the function OnThrown's called. When OnHit's called you get the timer value and does: damage + (timer * aditional damage). Link to comment https://forums.kleientertainment.com/forums/topic/93502-weapon-damage-based-on-distance-from-target/#findComment-1067551 Share on other sites More sharing options...
MrGurtis Posted September 20, 2018 Author Share Posted September 20, 2018 On 7/24/2018 at 5:39 AM, Makishim said: You can start a timer when the function OnThrown's called. When OnHit's called you get the timer value and does: damage + (timer * aditional damage). Any idea how I would write that in the context of this code: local function OnThrown(inst, owner, target) if target ~= owner then owner.SoundEmitter:PlaySound("dontstarve/wilson/boomerang_throw") end inst.AnimState:PlayAnimation("spin_loop", true) end local function OnHit(inst, owner, target) if owner == target or owner:HasTag("playerghost") then if owner ~= nil and owner.components.inventory ~= nil and owner.components.inventory.isopen then if inst.components.equippable ~= nil and not owner.components.inventory:GetEquippedItem(inst.components.equippable.equipslot) then owner.components.inventory:Equip(inst) else owner.components.inventory:GiveItem(inst) end owner:PushEvent("catch") end else ReturnToOwner(inst, owner) end if target ~= nil and target:IsValid() then local impactfx = SpawnPrefab("impact") if impactfx ~= nil then local follower = impactfx.entity:AddFollower() follower:FollowSymbol(target.GUID, target.components.combat.hiteffectsymbol, 0, 0, 0) impactfx:FacePoint(inst.Transform:GetWorldPosition()) end end end I did have a look at how DS RoG did timers in the SGmoose file as that has a disarm cooldown timer, but it didn't have anything on getting the values of the timer. The help is greatly appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/93502-weapon-damage-based-on-distance-from-target/#findComment-1086068 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