1. Please be advised of a few specific rules and guidelines for this section.

RELEASED Windup Armory Tweaks (Glow) 0.2

Adds glow effect to let you know your hammer or axe is charged and ready to swing.

  1. IHart

    IHart Scruffy Nerf-Herder

    IHart submitted a new mod:

    Windup Armory Tweaks (Glow) - Adds glow effect to let you know your hammer or axe is charged and ready to swing.

    Read more about this mod...
     
  2. IHart

    IHart Scruffy Nerf-Herder

  3. bk3k

    bk3k Oxygen Tank

    Now there is a mod on the workshop that adds a bit of thrust to melee combos and I can't use both because you replace the same script I believe.

    Could you make a version that does this.

    In meleecombo.lua
    under MeleeCombo:windup

    after
    Code:
    if self.stances["preslash"..self.comboStep] then
        self:setState(self.preslash)
      else
    but before
    Code:
        self:setState(self.fire)
      end
    this code
    Code:
        local cv = mcontroller.velocity()
        if mcontroller.movingDirection() == self.weapon.aimDirection and mcontroller.running() then
          mcontroller.setVelocity({math.max(50, cv[1] + 20) * self.weapon.aimDirection, cv[2]})
        elseif not mcontroller.running() then
          mcontroller.setVelocity({math.max(20, cv[1] + 10) * self.weapon.aimDirection, cv[2]})
        end
    That's a bit different than from the mod I'm talking about because I changed it to consider current velocity and the math.max part, but I think that would work well.
     
  4. IHart

    IHart Scruffy Nerf-Herder

    id be happy to but I only overwrite axecleave.lua and hammersmash.lua, i dont think it is this mod that's creating this issue for you

    edit: link to the mod so that i can investigate further
     
    Last edited: Nov 3, 2016
  5. bk3k

    bk3k Oxygen Tank

    Hmm I assumed you where over-writing that file. I'm wrong you aren't. I guess I should check my mods over to see what's doing what. Too many workshop files makes it harder to investigate.

    But I suppose I could do a text-specific "find in files" search for specific code

    Now if you want to see the mod I'm talking about
    http://steamcommunity.com/sharedfiles/filedetails/?id=744753941
    Only it doesn't work anymore(for me), so some mod somewhere is loading after and undoing what it does.

    But if you want to cut to the chase, the only file in that mod is replacing meleecombo.lua

    Code:
    -- Melee primary ability
    MeleeCombo = WeaponAbility:new()
    
    function MeleeCombo:init()
      self.comboStep = 1
    
      self.energyUsage = self.energyUsage or 0
    
      self:computeDamageAndCooldowns()
    
      self.weapon:setStance(self.stances.idle)
    
      self.edgeTriggerTimer = 0
      self.flashTimer = 0
      self.cooldownTimer = self.cooldowns[1]
    
      self.animKeyPrefix = self.animKeyPrefix or ""
    
      self.weapon.onLeaveAbility = function()
        self.weapon:setStance(self.stances.idle)
      end
    end
    
    -- Ticks on every update regardless if this is the active ability
    function MeleeCombo:update(dt, fireMode, shiftHeld)
      WeaponAbility.update(self, dt, fireMode, shiftHeld)
    
      if self.cooldownTimer > 0 then
        self.cooldownTimer = math.max(0, self.cooldownTimer - self.dt)
        if self.cooldownTimer == 0 then
          self:readyFlash()
        end
      end
    
      if self.flashTimer > 0 then
        self.flashTimer = math.max(0, self.flashTimer - self.dt)
        if self.flashTimer == 0 then
          animator.setGlobalTag("bladeDirectives", "")
        end
      end
    
      self.edgeTriggerTimer = math.max(0, self.edgeTriggerTimer - dt)
      if self.lastFireMode ~= (self.activatingFireMode or self.abilitySlot) and fireMode == (self.activatingFireMode or self.abilitySlot) then
        self.edgeTriggerTimer = self.edgeTriggerGrace
      end
      self.lastFireMode = fireMode
    
      if not self.weapon.currentAbility and self:shouldActivate() then
        self:setState(self.windup)
      end
    end
    
    -- State: windup
    function MeleeCombo:windup()
      local stance = self.stances["windup"..self.comboStep]
    
      self.weapon:setStance(stance)
    
      self.edgeTriggerTimer = 0
    
      if stance.hold then
        while self.fireMode == (self.activatingFireMode or self.abilitySlot) do
          coroutine.yield()
        end
      else
        util.wait(stance.duration)
      end
    
      if self.energyUsage then
        status.overConsumeResource("energy", self.energyUsage)
      end
    
      if self.stances["preslash"..self.comboStep] then
        self:setState(self.preslash)
      else
        if mcontroller.movingDirection() == self.weapon.aimDirection and mcontroller.running() then
          mcontroller.setVelocity({50 * self.weapon.aimDirection, 5})
        elseif not mcontroller.running() then
          mcontroller.setVelocity({20 * self.weapon.aimDirection, 3})
        end
        self:setState(self.fire)
      end
    end
    
    -- State: wait
    -- waiting for next combo input
    function MeleeCombo:wait()
      local stance = self.stances["wait"..(self.comboStep - 1)]
    
      self.weapon:setStance(stance)
    
      util.wait(stance.duration, function()
        if self:shouldActivate() then
          self:setState(self.windup)
          return
        end
      end)
    
      self.cooldownTimer = math.max(0, self.cooldowns[self.comboStep - 1] - stance.duration)
      self.comboStep = 1
    end
    
    -- State: preslash
    -- brief frame in between windup and fire
    function MeleeCombo:preslash()
      local stance = self.stances["preslash"..self.comboStep]
    
      self.weapon:setStance(stance)
      self.weapon:updateAim()
    
      util.wait(stance.duration)
    
      self:setState(self.fire)
    end
    
    -- State: fire
    function MeleeCombo:fire()
      local stance = self.stances["fire"..self.comboStep]
    
      self.weapon:setStance(stance)
      self.weapon:updateAim()
    
      local animStateKey = self.animKeyPrefix .. (self.comboStep > 1 and "fire"..self.comboStep or "fire")
      animator.setAnimationState("swoosh", animStateKey)
      animator.playSound(animStateKey)
    
      local swooshKey = self.animKeyPrefix .. (self.elementalType or self.weapon.elementalType) .. "swoosh"
      animator.setParticleEmitterOffsetRegion(swooshKey, self.swooshOffsetRegions[self.comboStep])
      animator.burstParticleEmitter(swooshKey)
    
      util.wait(stance.duration, function()
        local damageArea = partDamageArea("swoosh")
        self.weapon:setDamage(self.stepDamageConfig[self.comboStep], damageArea)
      end)
    
      if self.comboStep < self.comboSteps then
        self.comboStep = self.comboStep + 1
        self:setState(self.wait)
      else
        self.cooldownTimer = self.cooldowns[self.comboStep]
        self.comboStep = 1
      end
    end
    
    function MeleeCombo:shouldActivate()
      if self.cooldownTimer == 0 and (self.energyUsage == 0 or not status.resourceLocked("energy")) then
        if self.comboStep > 1 then
          return self.edgeTriggerTimer > 0
        else
          return self.fireMode == (self.activatingFireMode or self.abilitySlot)
        end
      end
    end
    
    function MeleeCombo:readyFlash()
      animator.setGlobalTag("bladeDirectives", self.flashDirectives)
      self.flashTimer = self.flashTime
    end
    
    function MeleeCombo:computeDamageAndCooldowns()
      local attackTimes = {}
      for i = 1, self.comboSteps do
        local attackTime = self.stances["windup"..i].duration + self.stances["fire"..i].duration
        if self.stances["preslash"..i] then
          attackTime = attackTime + self.stances["preslash"..i].duration
        end
        table.insert(attackTimes, attackTime)
      end
    
      self.cooldowns = {}
      local totalAttackTime = 0
      local totalDamageFactor = 0
      for i, attackTime in ipairs(attackTimes) do
        self.stepDamageConfig[i] = util.mergeTable(copy(self.damageConfig), self.stepDamageConfig[i])
        self.stepDamageConfig[i].timeoutGroup = "primary"..i
    
        local damageFactor = self.stepDamageConfig[i].baseDamageFactor
        self.stepDamageConfig[i].baseDamage = damageFactor * self.baseDps * self.fireTime
    
        totalAttackTime = totalAttackTime + attackTime
        totalDamageFactor = totalDamageFactor + damageFactor
    
        local targetTime = totalDamageFactor * self.fireTime
        local speedFactor = 1.0 * (self.comboSpeedFactor ^ i)
        table.insert(self.cooldowns, (targetTime - totalAttackTime) * speedFactor)
      end
    end
    
    function MeleeCombo:uninit()
      self.weapon:setDamage()
    end
    

    and as I say, the code I provided is slightly different than theirs. The difference in code versus vanilla is located where I indicated before.

    ----update: mystery solved-----

    It turned out to be Frackin Races over-writting that script. I have to admit I didn't see that one coming.
     
    Last edited: Nov 3, 2016

Share This Page