Modding Help Spear Flurry altAbility Help

Discussion in 'Starbound Modding' started by Tamamo89, Nov 23, 2016.

Tags:
  1. Tamamo89

    Tamamo89 Pangalactic Porcupine

    So i made a custom weaponability for spears with a status effect, but there is no glow when using the alt ability. Not sure why, any ideas?
     
    Last edited: Nov 23, 2016
  2. bk3k

    bk3k Oxygen Tank

    Without seeing what we're dealing with here, no ideas. I mean I haven't looked too heavily at weapons, but you're kind of leaving too much guess work on our part when you aren't including your WIP example.
     
  3. Tamamo89

    Tamamo89 Pangalactic Porcupine

    Code:
    {
      "animationParts" : { },
      "animationCustom" : {
        "sounds" : {
          "flurry" : [ "/sfx/melee/spear_flurry.ogg" ]
        }
      },
    
      "ability" : {
        "name" : "Sting Flurry",
        "type" : "stingflurry",
        "scripts" : ["/items/active/weapons/melee/abilities/spear/stingflurry/stingflurry.lua"],
        "class" : "Flurry",
    
        "cooldownResetTime" : 0.25,
        "maxCooldownTime" : 0.25,
        "minCooldownTime" : 0.15,
        "cooldownSwingReduction" : 0.04,
    
        "energyUsage" : 9.0,
        "cooldownTime" : 0.2,
    
        "damageConfig" : {
          "damageSourceKind" : "spear",
          "statusEffects" : [ "fubeesting2" ],
          "baseDamage" : 3,
          "knockback" : 10,
          "timeout" : 0.15,
          "timeoutGroup" : "alt"
        },
    
        "cycleRotationOffsets" : [0, 7.5, -7.5],
        "stances" : {
            "idle" : {
              "armRotation" : -90,
              "weaponRotation" : 0,
              "twoHanded" : false,
              "weaponOffset" : [0, 0.5],
    
              "allowRotate" : true,
              "allowFlip" : true
            },
          "swing" : {
            "duration" : 0.1,
            "armRotation" : -15,
            "weaponRotation" : -75,
            "twoHanded" : true,
            "weaponOffset" : [0.0, 0.0],
    
            "allowRotate" : false,
            "allowFlip" : false
          }
        }
      }
    }
     
  4. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    Is your glow associated with the stance of the ability or the status effect itself? (I'm haven't exactly used anything from FU, specifically status effects, in my mods before.)

    In either case, the abilitys file doesn't have anything here to do with glow.
    We would need to likely see your animation file for the ability to check for the problem.
     
  5. Tamamo89

    Tamamo89 Pangalactic Porcupine

    Not sure, the glow i'm referring to is the slash's glow since it's poison elemental. It works for the regular spear stab but not the flurry.
    All I did was add a status effect.
     
  6. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    Alright, im getting the picture then.
    I took a look into the abilities to find this.

    I'm pretty sure it doesn't glow is because the Flurry ability doesn't inherently create a glow effect. (I'm guessing your ability is the same as Flurry minus the name and effect.)

    Most other abilities create projectiles that inflict damage as well as create the glow corresponding to the element type.
    However, the Flurry ability does not have a projectile. It creates a damage poly at the part point of the spear (the tip) that inflicts damage whenever something collides with that poly.

    If you were to add the glow, you would probably add a projectile to the ability, like many other abilities, to do so.
    But you would also probably want to remove the part collision damage to prevent multiple damage sources.
     
  7. bk3k

    bk3k Oxygen Tank

    I think that's close, but not quite right(unless you are looking for a status effect during the alt ability too).

    Looking at this one

    Code:
    {
      "animationParts" : { },
      "animationCustom" : {
        "animatedParts" : {
          "stateTypes" : {
            "spinSwoosh" : {
              "default" : "idle",
              "states" : {
                "idle" : {
                },
                "spin" : {
                  "frames" : 1,
                  "cycle" : 0.5,
                  "properties" : {
                    "persistentSound" : "/sfx/melee/spear_twirl_loop.ogg"
                  }
                }
              }
            }
          },
          "parts" : {
            "spinSwoosh" : {
              "properties" : {
                "zLevel" : 1,
                "centered" : true,
                "transformationGroups" : ["swoosh"],
                "offset" : [0, 0],
                "damageArea" : [ [-3.75, 1.75], [-1.75, 3.75], [1.75, 3.75], [3.75, 1.75], [3.75, -1.75], [1.75, -3.75], [-1.75, -3.75], [-3.75, -1.75] ]
              },
              "partStates" : {
                "spinSwoosh" : {
                  "idle" : {
                    "properties" : {
                      "image" : ""
                    }
                  },
                  "spin" : {
                    "properties" : {
                      "image" : "/items/active/weapons/melee/abilities/spear/elementalspin/<elementalType>spinswoosh.png:<frame>"
                    }
                  }
                }
              }
            }
          }
        },
        "sounds" : {
          "fireSpin" : ["/sfx/melee/elemental_spin_fire.ogg" ],
          "fireSpinFire" : ["/sfx/melee/travelingslash_fire2.ogg" ],
          "iceSpin" : ["/sfx/melee/elemental_spin_ice.ogg" ],
          "iceSpinFire" : ["/sfx/melee/travelingslash_ice2.ogg" ],
          "electricSpin" : [ "/sfx/melee/elemental_spin_electric.ogg" ],
          "electricSpinFire" : [ "/sfx/melee/travelingslash_electric7.ogg" ],
          "poisonSpin" : ["/sfx/melee/elemental_spin_poison.ogg" ],
          "poisonSpinFire" : ["/sfx/melee/travelingslash_poison1.ogg" ]
        },
        "particleEmitters" : {
          "fireSpin" : {
            "active" : false,
            "emissionRate" : 12,
            "offsetRegion" : [-3.5, -3.5, 3.5, 3.5],
            "particles" : [
              { "particle" : "fireswoosh1"},
              { "particle" : "fireswoosh2"},
              { "particle" : "fireswoosh3"},
              { "particle" : "fireswoosh1"},
              { "particle" : "fireswoosh2"},
              { "particle" : "fireswoosh3"}
            ]
          },
          "electricSpin" : {
            "active" : false,
            "emissionRate" : 12,
            "offsetRegion" : [-3.5, -3.5, 3.5, 3.5],
            "particles" : [
              { "particle" : "electricswoosh1"},
              { "particle" : "electricswoosh2"},
              { "particle" : "electricswoosh2"}
            ]
          },
          "poisonSpin" : {
            "active" : false,
            "emissionRate" : 12,
            "offsetRegion" : [-3.5, -3.5, 3.5, 3.5],
            "particles" : [
              { "particle" : "poisonswoosh1"},
              { "particle" : "poisonswoosh2"},
              { "particle" : "fireswoosh2"},
              { "particle" : "poisonswoosh1"},
              { "particle" : "poisonswoosh2"},
              { "particle" : "fireswoosh2"}
            ]
          },
          "iceSpin" : {
            "active" : false,
            "emissionRate" : 12,
            "offsetRegion" : [-3.5, -3.5, 3.5, 3.5],
            "particles" : [
              { "particle" : "iceswoosh1"},
              { "particle" : "iceswoosh2"},
              { "particle" : "iceswoosh3"},
              { "particle" : "iceswoosh1"},
              { "particle" : "iceswoosh2"},
              { "particle" : "iceswoosh3"}
            ]
          }
        }
      },
    
      "ability" : {
        "name" : "Energy Whirl",
        "type" : "elementalspin",
        "scripts" : ["/items/active/weapons/melee/abilities/spear/elementalspin/elementalspin.lua"],
        "class" : "ElementalSpin",
    
        "energyUsage" : 60,
        "projectileEnergyCost" : 30,
        "cooldownTime" : 1.0,
    
        "spinRate" : -1750,
    
        "elementalConfig" : {
          "fire" : {
            "projectileType" : "firespinswoosh",
            "damageConfig" : { "statusEffects" : [ "burning" ] }
          },
          "ice" : {
            "projectileType" : "icespinswoosh",
            "damageConfig" : { "statusEffects" : [ "frostslow" ] }
          },
          "poison" : {
            "projectileType" : "poisonspinswoosh",
            "damageConfig" : { "statusEffects" : [ "weakpoison" ] }
          },
          "electric" : {
            "projectileType" : "electricspinswoosh",
            "damageConfig" : { "statusEffects" : [ "electrified" ] }
          }
        },
    
        "damageConfig" : {
          "damageSourceKind" : "<elementalType>spear",
          "statusEffects" : [ ],
          "baseDamage" : 6,
          "knockbackMode" : "none",
          "knockback" : 30,
          "timeout" : 0.5,
          "timeoutGroup" : "alt"
        },
        "projectileParameters" : {
          "power" : 6,
          "knockback" : 15
        },
    
        "stances" : {
          "windup" : {
            "duration" : 0.35,
            "armRotation" : -160,
            "weaponRotation" : -40,
            "twoHanded" : false,
            "weaponOffset" : [0, 0],
    
            "allowRotate" : false,
            "allowFlip" : true
          },
          "fire" : {
            "duration" : 0.25,
            "armRotation" : -20,
            "weaponRotation" : -50,
            "twoHanded" : false,
            "weaponOffset" : [0, 1.5],
    
            "allowRotate" : false,
            "allowFlip" : false
          }
        }
      }
    }


    See the "particleEmitters" in there? That's where your pretty effects are gonna come from. I believe projectiles can also accomplish this though. And indeed this file does have projectiles, but I think that is for the statuses rather than the pretty lights. Depending on exactly what you want the ability to do. Those particle emitters can be toggled on an off by the LUA script. First though you need something to toggle.

    That LUA code looks like this

    animator.setParticleEmitterActive("electricSpin", true)
    to turn it on, and
    animator.setParticleEmitterActive("electricSpin", false)
    to turn it off again
     
    Inf_Wolf14 likes this.
  8. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    Ah, yeah that was it. I was thinking of particle emitters inside projectile animations.

    Silly me.
     

Share This Page