Modding Help How to add "muzzle effect" to a one handed weapon w/ chargefire?

Discussion in 'Starbound Modding' started by XtremelyEvilGumDrop, Jun 13, 2018.

Tags:
  1. XtremelyEvilGumDrop

    XtremelyEvilGumDrop Space Hobo

    I am trying to make a revolver similar to the dragonhead pistol that features a held/charged fire. However, unlike the dragonhead, I want it to have the vanilla muzzle flash effect. However, every time i try to add muzzle flash to the active item, my game loads and crashes as soon as I fire it? I am betting the vanilla fire effect was not designed for the charge ability, but does anyone have good experience with animation/frames files and can help give my gun the appearance of having muzzle flash? The files below are functional btw.


    Code:
    {
      "itemName" : "widowmaker",
      "price" : 2500,
      "maxStack" : 1,
      "rarity" : "Legendary",
      "description" : "The revolver of a true gunslinger.",
      "shortdescription" : "Widowmaker",
      "tooltipKind" : "base",
      "category" : "uniqueWeapon",
      "twoHanded" : false,
      "itemTags" : ["weapon","ranged"],
      "level" : 6,
    
      "inventoryIcon" : "widowmaker.png",
    
      "animation" : "widowmaker.animation",
      "animationParts" : {
        "gun" : "widowmaker.png"
      },
      "animationCustom" : {},
      "muzzleOffset" : [2.5, 0.5],
    
      "scripts" : ["/items/active/weapons/ranged/gun.lua"],
    
      "elementalType" : "physical",
    
      "primaryAbilityType" : "chargefire",
      "primaryAbility" : {
        "chargeLevels" : [
          {
            "time" : 0,
            "energyCost" : 15,
            "cooldown" : 0.1,
            "projectileType" : "bullet-2",
            "projectileParameters" : {},
            "inaccuracy" : 0.008,
            "baseDamage" : 9,
            "fireSound" : "fire"
          },
          {
            "time" : 1.5,
            "energyCost" : 50,
            "cooldown" : 0.5,
            "projectileType" : "bullet-1",
            "projectileParameters" : {},
            "inaccuracy" : 0,
            "baseDamage" : 12,
            "fireSound" : "fire2"
          }
        ]
      },
    
      "builder" : "/items/buildscripts/buildunrandweapon.lua"
    }
    


    Code:
    {
      "animatedParts" : {
        "stateTypes" : {
          "firing" : {
            "default" : "off",
            "states" : {
              "off" : {},
              "charge" : {
                "frames" : 4,
                "cycle" : 1.0,
                "mode" : "transition",
                "transition" : "fullcharge",
                "properties" : {
                }
              },
              "fullcharge" : {
                "frames" : 1,
                "cycle" : 0.0,
                "mode" : "loop"
              },
              "fire" : {
                "frames" : 1,
                "cycle" : 0.0,
                "mode" : "transition",
                "transition" : "off"
              }
            }
          }
        },
    
        "parts" : {
          "gun" : {
            "properties" : {
              "centered" : true,
              "offset" : [1.0, 0.25],
              "transformationGroups" : ["weapon"]
            },
    
            "partStates" : {
              "firing" : {
                "off" : {
                  "properties" : {
                    "image" : "widowmaker.png"
                  }
                },
                "charge" : {
                  "properties" : {
                    "image" : "widowmaker.png"
                  }
                },
                "fullcharge" : {
                  "properties" : {
                    "image" : "widowmaker.png"
                  }
                },
                "fire" : {
                  "properties" : {
                    "image" : "widowmaker.png"
                  }
                }
              }
            }
          }
        }
      },
    
      "transformationGroups" : {
        "weapon" : {},
        "muzzle" : {}
      },
    
      "sounds" : {
        "fire" : [ "revolverfire2.ogg" ],
        "fire2" : [ "revolverfire2.ogg" ]
      }
    }
    
     

    Attached Files:

    Last edited: Jun 13, 2018
  2. Iris Blanche

    Iris Blanche Pudding Paradox Forum Moderator

    I added a spoiler tag and a code tag for better overview. :nuruhappy:
     
  3. XtremelyEvilGumDrop

    XtremelyEvilGumDrop Space Hobo

    Thanks. I am new here, but desperate for help. No muzzle flash = no life
     

Share This Page