Modding Help Custom Sound on weapon swing

Discussion in 'Starbound Modding' started by projectmayhem, Mar 3, 2017.

  1. projectmayhem

    projectmayhem Spaceman Spiff

    Making a star wars themed mod, kind of a learn as I go experience. I have 4 different lightsabers, and Jedi armor completed. However, one of the things I cannot figure out is getting a custom sound to play when swinging the weapon. Here is my file, can anyone take a look at it and tell me what I've done wrong? I pretty much copied the broadsword from vanilla and changed what I felt comfortable changing. This is the animation file for one of the lightsabers.

    Code:
    {
      "globalTagDefaults" : {
        "paletteSwaps" : ""
      },
    
      "animatedParts" : {
        "stateTypes" : {
          "swoosh" : {
            "default" : "idle",
            "states" : {
              "idle" : {
              },
              "fire" : {
                "frames" : 3,
                "cycle" : 0.1,
                "mode" : "transition",
                "transition" : "idle"
              },
              "fire2" : {
                "frames" : 3,
                "cycle" : 0.1,
                "mode" : "transition",
                "transition" : "idle"
              },
              "fire3" : {
                "frames" : 3,
                "cycle" : 0.1,
                "mode" : "transition",
                "transition" : "idle"
              }
            }
          }
        },
    
        "parts" : {
          "blade" : {
            "properties" : {
              "zLevel" : 0,
              "centered" : true,
              "image" : "<partImage><paletteSwaps>?<directives>?<bladeDirectives>",
              "offset" : [0, 1.875],
              "transformationGroups" : ["weapon"],
              "rotationCenter" : [0, 0],
              "damageArea" : [ [-0.7, -1.0], [-0.7, 2.5], [0.5, 2.5], [0.5, -1.0] ]
            }
          },
          "handle" : {
            "properties" : {
              "zLevel" : 1,
              "centered" : true,
              "image" : "<partImage><paletteSwaps>?<directives>",
              "offset" : [0, 1.875],
              "transformationGroups" : ["weapon"],
              "rotationCenter" : [0, 0]
            }
          },
          "swoosh" : {
            "properties" : {
              "zLevel" : -1,
              "centered" : true,
              "transformationGroups" : ["swoosh"],
              "rotationCenter" : [0, 0]
            },
    
            "partStates" : {
              "swoosh" : {
                "idle" : {
                  "properties" : {
                    "image" : ""
                  }
                },
                "fire" : {
                  "properties" : {
                    "image" : "swoosh1/physicalswoosh.png:<frame>",
                    "offset" : [0, 2.5],
                    "damageArea" : [[-5, 2], [-2.5, 3], [1, 3], [4, 1.75], [5, -0.25], [5, -2.25], [4, -3.25], [0, -2.5]]
                  }
                },
                "fire2" : {
                  "properties" : {
                    "image" : "swoosh2/physicalswoosh.png:<frame>",
                    "offset" : [5.0, 1.0],
                    "damageArea" : [[-4, 1], [2.5, 1], [2.5, -2], [-4, -2]]
                  }
                },
                "fire3" : {
                  "properties" : {
                    "image" : "swoosh3/physicalswoosh.png:<frame>",
                    "offset" : [3.5, 0],
                    "damageArea" : [[-4.75, 1.5], [3, 1], [3, -1], [-4.75, -1.5]]
                  }
                }
              }
            }
          }
        }
      },
    
      "transformationGroups" : {
        "weapon" : {},
        "swoosh" : {}
      },
    
      "particleEmitters" : {
        "physicalswoosh" : {
          "active" : true,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 1,
          "burstCount" : 1,
          "particles" : []
        },
        "fireswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "burstCount" : 4,
          "particles" : [
            { "particle" : "fireswoosh1"},
            { "particle" : "fireswoosh2"},
            { "particle" : "fireswoosh3"}
          ]
        },
        "electricswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "burstCount" : 3,
          "particles" : [
            { "particle" : "electricswoosh1"},
            { "particle" : "electricswoosh2"},
            { "particle" : "electricswoosh2"}
          ]
        },
        "poisonswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "burstCount" : 3,
          "particles" : [
            { "particle" : "poisonswoosh1"},
            { "particle" : "poisonswoosh2"},
            { "particle" : "fireswoosh2"}
          ]
        },
        "iceswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "burstCount" : 3,
          "particles" : [
            { "particle" : "iceswoosh1"},
            { "particle" : "iceswoosh2"},
            { "particle" : "iceswoosh3"}
          ]
        }
      },
    
      "sounds" : {
        "fire" : ["swing_lightsaber.ogg" ],
        "fire2" : ["swing_lightsaber.ogg" ],
        "fire3" : ["swing_lightsaber.ogg" ]
      }
    }
    
     
  2. bk3k

    bk3k Oxygen Tank

    Check out the solus katana's animation.

    Although I recently wasted some time assuming what I found in that and others would apply to objects... nope.
     
  3. projectmayhem

    projectmayhem Spaceman Spiff

    THANK YOU! Not only did I figure out the sounds, by looking at the Solus I was able to make a lightsaber that retracts and extends.
     

Share This Page