Modding Help Projectile Angle Issues [SOLVED]

Discussion in 'Starbound Modding' started by Omeruin, Jun 16, 2020.

  1. Omeruin

    Omeruin Void-Bound Voyager

    Heya.
    I've gotten back into modding and have created a hammer (scythe) with the ability to summon portals which summon giant swords.
    However, I want the swords to ONLY go downward. Whenever the player is left, the portal flips (horizontally) and so does the projectile direction.
    This is the main projectile which summons the swords:
    Code:
    {
        "projectileName": "holysummoning",
        "image": "holysummoning.png",
        "animationCycle": 0.25,
        "frameNumber": 1,
        "timeToLive": 1,
        "damageKindImage": "icon.png",
        "lightColor": [255, 255, 255],
        "pointLight": true,
        "flippable": true,
        "piercing": true,
        "statusEffects": ["holyfire"],
        "power": 5.0,   
        "speed": 0,
        "knockback": 20,
        "movementSettings": {
            "collisionEnabled": false
        },
        "damageKind": "holyfire",
        "fullbright": true,
        "damagePoly": [
            [-16, 24],
            [8, 16],
            [16, -24],
            [-8, -16]
        ],
        "actionOnReap": [{
                "action": "projectile",
                "type": "holysummoningstop",
                "inheritDamageFactor": 1,
                "inheritSpeedFactor": 1
            },
            {
                "action": "sound",
                "options": ["/sfx/projectiles/holytear_stop2.ogg"]
            }
        ],
        "periodicActions": [
        {
                "action": "particle",
                "specification": "holytearsparkle1",
                "time": 0.2,
                "repeat": true
            },
            {
                "action": "particle",
                "specification": "holytearsparkle2",
                "time": 0.2,
                "repeat": true
            },
            {
                "action": "particle",
                "specification": "holytearsparkle3",
                "time": 0.2,
                "repeat": true
            },
            {
                "action": "particle",
                "specification": "holytearsparkle4",
                "time": 0.2,
                "repeat": true
            },
            {
                "action": "projectile",
                "repeat": true,
                "angleAdjust": -90,
                "fuzzAngle" : 0,
                "time": 0.60,
                "type": "holylightblade2",
                "config": {
                    "timeToLive": 0.75,
                    "physics": "laser",
                    "piercing": false,
                    "knockback": 20,
                    "fullbright": true,
                    "lightColor": [218, 255, 255],
                    "flippable": false,
                    "emitters": ["holyfireplasma"],
                    "knockbackDirectional": false,
                    "movementSettings": {
                        "collisionEnabled": false
                    },
                    "power": 45,
                    "speed": 45
                }
            }
        ],
    
        "persistentAudio": "/sfx/projectiles/holytear_loop.ogg"
    }
    I am using angleAdjust for the sword projectile's direction, but now I'm wondering if that's relative to the player's actual direction. Is there a way to have the projectile go in one absolute direction no matter if the spawner/player is flipped or not?

    This is the holysummoningstart projectile just in case:
    Code:
    {
      "projectileName" : "holysummoningstart",
      "image" : "holysummoningstart.png",
      "animationCycle" : 0.2,
      "animationLoops" : false,
      "frameNumber" : 5,
      "timeToLive" : 0.2,
      "lightColor" : [255, 255, 255],
      "pointLight" : true,
      "flippable" : true,
      "piercing" : true,
      "statusEffects" : ["holyfire"],
      "power" : 5.0,
      "speed" : 0,
      "knockback" : 30,
      "knockbackDirectional" : true,
      "movementSettings" : {
        "collisionEnabled" : false
      },
      "damageKind" : "holyfirehammer",
      "fullbright" : true,
      "damagePoly" : [[-12, 20], [0, 20], [16, -20], [4, -20]],
      "actionOnReap" : [
         {
          "action" : "projectile",
          "type" : "holysummoning",
          "inheritDamageFactor" : 0.25,
          "inheritSpeedFactor" : 1
        },
        {
          "action" : "projectile",
          "type" : "holysummoning",
          "offset" : [-7, 0],
          "inheritDamageFactor" : 0.25,
          "inheritSpeedFactor" : 1
        },
        {
          "action" : "projectile",
          "type" : "holysummoning",
          "offset" : [-3.2, 0],
          "inheritDamageFactor" : 0.25,
          "inheritSpeedFactor" : 1
        },
        {
          "action" : "projectile",
          "type" : "holysummoning",
          "offset" : [7, 0],
          "inheritDamageFactor" : 0.25,
          "inheritSpeedFactor" : 1
        },
        {
          "action" : "projectile",
          "type" : "holysummoning",
          "offset" : [3.2, 0],
          "inheritDamageFactor" : 0.25,
          "inheritSpeedFactor" : 1
        }
      ],
    
      "persistentAudio" : "/sfx/projectiles/astraltear_start.ogg"
    }
    
     
  2. projectmayhem

    projectmayhem Ketchup Robot

    have you tried changing the first
    "flippable": true, to false?
     
    Omeruin likes this.
  3. Omeruin

    Omeruin Void-Bound Voyager

    Setting it to False: facing right > correct - projectiles go down; left > upsidedown - projectiles go up
    Setting it to True: facing right > correct; left > flipped horizontally projectiles go up
     
  4. projectmayhem

    projectmayhem Ketchup Robot

    I'm a little tired, so brain isnt working the best... but have you tried maybe changing the physics to something other than lazer, something that is affected by gravity more, so it will always go down?
     
    Omeruin likes this.
  5. Omeruin

    Omeruin Void-Bound Voyager

    I actually finally found the solution. I used Notepad++ to search every projectile in the game and finally found something (after a few hours of course).
    Code:
    {
                "action": "projectile",
                "repeat": true,
                "direction" : [0, -1],
                "fuzzAngle" : 0,
                "time": 0.60,
                "type": "holylightblade2",
                "config": {
                    "timeToLive": 0.75,
                    "physics": "laser",
                    "piercing": false,
                    "knockback": 20,
                    "fullbright": true,
                    "lightColor": [218, 255, 255],
                    "flippable": false,
                    "emitters": ["holyfireplasma"],
                    "knockbackDirectional": false,
                    "movementSettings": {
                        "collisionEnabled": false
                    },
                    "power": 45,
                    "speed": 45
                }
            }
    "direction" was what I was looking for. This way, the projectile always goes in a certain direction, no matter if the player or the summoning projectile is turned or whatnot.
    Thank you for trying to help me!
     
    projectmayhem likes this.

Share This Page