Modding Help Needing help modding a weaponability script

Discussion in 'Starbound Modding' started by Vinderex, Jul 15, 2017.

  1. Vinderex

    Vinderex Pangalactic Porcupine

    I'm trying to create a new weaponability based on the broadsword's Parry ability. This ability will be called Riposte, and I want it to work just like Parry, except immediately after successfully blocking an attack, you counterattack and deal 2.5 times the weapon's base damage.

    So... I'm really not familiar with LUA at all. I've done a few minor adjustments to scripts before, but I'm at a loss for what to do in this case. The .weaponability file itself I can work with just fine, I know It'll be needing new stances for the counterattack, and a parameter for the damage multiplier, but as for the LUA, I can only get a rough grasp of what's going on by reading it, but I haven't the slightest idea of what exactly I need to add to it. Best I can do is just make a guess that it's something to do with the damageListener? lol ;p

    Can anyone help me out? Thanks! ^.^
     
  2. projectmayhem

    projectmayhem Spaceman Spiff

    My best guess would be editing this part of parry

    Code:
    local damageListener = damageListener("damageTaken", function(notifications)
        for _,notification in pairs(notifications) do
          if notification.sourceEntityId ~= -65536 and notification.healthLost == 0 then
            animator.playSound("parry")
            animator.setAnimationState("parryShield", "block")
            return
          end
        end
    Where it says playSound and setAnimationState, you need to add some kind of damage to the closest NPC/monster.
    Maybe you can also look at the kunai blast, or something. Make it spawn a projectile that is invisible when it block an attack.
     
    Last edited: Jul 15, 2017

Share This Page