#Give a burst-fire gun a cooldown animation?

20 messages · Page 1 of 1 (latest)

dull hazel
#

I started having this issue yesterday and I tried a few things, but none of them worked. Basically, I want this gun to fire a burst of bullets and then have an animation to spin once in your hand. This code works if the gun has the "auto" fire-type, but not when you change it to "burst". Nothing I change to the cooldown animation seems to do anything. Is there a way to give a burst-fire weapon that kind of animation?

Here's the code for the ability:

    "scripts" : ["/items/active/weapons/ranged/gunfire.lua"],
    "class" : "GunFire",

    "fireTime" : 0.3,
    "baseDps" : 12,
    "energyUsage" : 27,
    "inaccuracy" : 0.08,

    "projectileCount" : 1,
    "fireType" : "burst",
    "burstCount" : 3,
    "burstTime" : 0.1,

    "projectileType" : "standardbullet",
    "projectileParameters" : {
      "knockback" : 10
    },

    "stances" : {
      "idle" : {
        "armRotation" : 0,
        "weaponRotation" : 0,
        "twoHanded" : false,

        "allowRotate" : true,
        "allowFlip" : true
      },
      "fire" : {
        "duration" : 0.3,
        "armRotation" : 3,
        "weaponRotation" : 8,
        "twoHanded" : false,

        "allowRotate" : false,
        "allowFlip" : false
      },
      "cooldown" : {
        "duration" : 0.2,
        "armRotation" : -7,
        "weaponRotation" : -360,
        "twoHanded" : false,

        "allowRotate" : true,
        "allowFlip" : false
      }
    }
  }```
dull hazel
#

This appears to be the problem, so I'm wondering if there might be a way to mod in a patch to the fire type to give it a cooldown animation?

#

or mod in a new firetype that behaves like burst but with a cooldown. No idea how to do that or how much work that might take but if anyone's done anything similar I'd appreciate a reference

dull hazel
#

Or if there's a different way to add a post-fire animation?

vague marsh
#

patching it would affect EVERY gun that uses the burst fire type. which is not great in this case I feel

#

ALSO MAKE SURE TO PREFIX
EVERYTHING IN YOUR MOD
LIKE THIS: “prefix_firetype”
prefixes are usually either the acronym for your mod or an acronym of the modders name

#

sorry if that comes off as weird but I have to give that talk
to every new modder so we don’t end up with another FU situation

dull hazel
#

Thanks for the response

#

I don’t know if you know any mods that add a new firetype that I could go off of

#

is there like a method we’re allowed talk about here to access starbound’s source code to reference stuff like fire types?

vague marsh
#

the source code is just purely the source code and not the assets plus application so it’s not piracy for rules reasons

#

if you look up “starbound source code” you can find it pretty easily

#

the devs also don’t care about the leak at all

#

I’ll look into adding new firetypes when I get back to my computer

dull hazel
wet coral
#

fire types are an entirely scripted thing