Modding Help Sword Projectile issue; too high up

Discussion in 'Starbound Modding' started by Campaigner, Dec 23, 2014.

  1. Campaigner

    Campaigner Giant Laser Beams

    problem.jpg
    As it is, my sword fires a projectile. Unfortunately, the projectile is a few pixels too high. It should spawn where the sword's tip is, not out of my face.

    Here's all the files;


    Weapon:
    Code:
    {
      "itemName" : "campworks_starfury",
      "level" : 1,
      "dropCollision" : [-4.0, -3.0, 4.0, 3.0],
      "maxStack" : 1,
      "rarity" : "legendary",
      "description" : "A toy version of a legendary sword. Not really a weapon.",
      "shortdescription" : "Starfury",
      "tooltipKind" : "sword",
      "kind" : "Broadsword",
    
      "image" : "campworks_starfury.png",
      "firePosition" : [15.5, 4.5],
      "fireTime" : 0.84,
      "fireAfterWindup" : true,
      "soundEffect" : { "fireSound" : [ { "file" : "/sfx/melee/swing_twohanded.wav" } ] },
    
      "colorOptions" : [],
    
      "primaryStances" : {
        "directional" : false,
        "projectileType" : "campworks_starfuryslash",
        "projectile" : {
          "speed" : 0.1,
          "power" : 11
        },
        "idle" : {
          "twoHanded" : false,
          "armAngle" : -90,
          "swordAngle" : -90,
          "handPosition" : [0.0, -17.0],
          "duration" : 0.1
        },
        "windup" : {
          "twoHanded" : true,
          "armAngle" : 90,
          "swordAngle" : 90,
          "handPosition" : [0.0, -17.0],
          "duration" : 0.2,
          "statusEffects" : []
        },
        "cooldown" : {
          "twoHanded" : true,
          "armAngle" : -45,
          "swordAngle" : -90,
          "handPosition" : [0.0, -27.5],
          "duration" : 0.4,
          "statusEffects" : []
        }
      },
     
      "parryBlockCooldown" : 1.2,
      "parrySound" : "/sfx/melee/sword_parry.wav",
      "parryParticle" : "shieldspark",
    
      "altStances" : {
        "type" : "parry",
        "rescaleTiming" : false,
        "parryPoly" : [ [12, -14], [12, -2], [28, 6], [28, -38], [12, -26] ],
    
        "idle" : {
          "twoHanded" : false,
          "armAngle" : -90,
          "swordAngle" : -90,
          "handPosition" : [0.0, -17.0],
          "duration" : 0.1
        },
        "windup" : {
          "twoHanded" : true,
          "armAngle" : 58,
          "swordAngle" : 208,
          "handPosition" : [15.0, -17.0],
          "duration" : 1.0
        },
        "cooldown" : {
          "twoHanded" : false,
          "armAngle" : -90,
          "swordAngle" : -90,
          "handPosition" : [0.0, -17.0],
          "duration" : 0.1
        }
      }
    }
    Swoosh:
    Code:
    {
      "projectileName" : "campworks_starfuryslash",
      "frames" : "campworks_starfuryslash.png",
      "animationCycle" : 0.07,
      "frameNumber" : 3,
      "speed" : 0,
      "orientationLocked" : true,
      "damagePoly" : [ [-40, 24.5], [3.5, 24.5], [15.5, 21.5], [28.5, 15.5], [36.5, 7.5], [40.5, -1.5], [40.5, -12.5], [32.5, -24.5], [-12, -24.5] ],
      "animationLoops" : false,
      "piercing" : true,
      "flippable" : true,
      "damageKind" : "2hsword",
      "effectSources" : [ "sparkles" ],
    
      "actionOnReap" : [
        {
          "action" : "projectile",
          "type" : "campworks_starfuryrain",
          "fuzzAngle" : 0,
          "inheritDamageFactor" : 0.15,
          "angleAdjust" : 0
        }
      ]
    }
    Projectile:
    Code:
    {
      "projectileName" : "campworks_starfuryrain",
      "frames" : "campworks_starfuryrain.png",
      "animationCycle" : 0.25,
      "frameNumber" : 1,
      "pointLight" : true,
      "lightColor" : [134, 111, 41],
      "emitters" : [ "sparkles" ],
      "actionOnReap" : [
        {
          "action" : "config",
          "file" : "/projectiles/explosions/bombblockexplosion/bombblockexplosion.config"
        }
      ],
      "power" : 5.0,
      "speed" : 75,
      "damageKind" : "default"
    }


    What do I do to fix this? Other than make a better sprite since this one sucks, of course.
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    That is what the variable fire position is for.
    Use any graphics editor to calculate the fire position of the weapon in its default stance. For sake of example if the default position of the sword is horizontal. The firing position would be around (1 , 14 ). The calculation is made at the midpoint of the graphic as ( 0 , 0 )

    [​IMG]
     
    Last edited: Dec 23, 2014
  3. Campaigner

    Campaigner Giant Laser Beams

    I should stop trying when I'm tired, I forgot that is what fire position meant. Thank you
     

Share This Page