Trying to make a turret that can "arc" shots

Discussion in 'Mod Discussions' started by killerkiwijuice, December 4, 2014.

  1. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Do I need to use "firing_arc_pitch"? It seems to do nothing, and breaks the turret's attack ability.

    I'm trying to get the projectile to arc over terrain on a comm boxing map, since turrets shoot the ground from planet curvature. (making a comm boxing mod)
  2. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    Compare with artillery? 'flight type':"ballistic" is probably the important part. Turret laser blasts and artillery shells are all the same 'AMMO_Projectile' class.
  3. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Adding "Flight_type": "Ballistic" breaks the attack ability.
  4. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    There's probably a missing required parameter in the weapon and/ammo that is needed to calculate the shot. Take a look at the log and see if there are any errors, else look at the artillery weapons to see if there are any missing attributes. You'll probably also want to change the base_spec to one of the artillery base tools/ammo.
  5. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Prepare for a wall of code :)
    Each block shows my edited .json data for both laser and artillery tools and ammo. They are all valid, btw.

    Laser Tool Weapon (single barrel):
    Code:
    {
        "base_spec": "/pa/tools/base_artillery_turret/base_artillery_turret.json",
        "ammo_id": "/pa/units/land/laser_defense_single/laser_defense_single_ammo.json",
        "rate_of_fire": 1,
        "max_range": 130,
        "max_firing_velocity": 250,
        "min_firing_velocity": 220,
        "yaw_rate": 60,
        "pitch_rate": 180,
        "firing_arc_yaw": 0,
        "firing_arc_pitch": 5,
        "auto_attack": true,
        "yaw_range": 180,
        "pitch_range": 89.9,
        "firing_standard_deviation": 0.10,
           "auto_attack": true,
            "physics": {
            "radius": 1,
            "push_class": 1,
            "gravity_scalar": 1,
            "add_to_spatial_db": false
        },
        "target_layers": [
            "WL_LandHorizontal",
            "WL_Seafloor",
            "WL_WaterSurface"
        ]
    }
    Laser Turret Ammo:
    Code:
    {
        "base_spec": "/pa/ammo/base_artillery/base_artillery.json",
        "damage": 60,
        "splash_damage": 20,
        "splash_radius": 10,
        "initial_velocity": 250,
        "influence_radius": 400,
        "fx_trail":{
        "filename":"/pa/units/commanders/base_commander/uber_proj_trail.pfx",
        "offset":[
          0.0,
          1.0,
          0.0
        ]
      },
        "lifetime": 10,
        "impact_decals":[
            "/pa/effects/specs/scorch_b_01.json"
        ],
        "events":{
          "died":{
            "audio_cue":"/SE/Weapons/sea/T2_battleship_fire",
            "effect_spec":"/pa/effects/specs/default_explosion.pfx",
            "effect_scale":1.1
          }
        },
        "model":{
        "filename":"/pa/units/air/shell_large/shell_large.papa"
      }
    }
    Default PA Artillery_short Tool:
    Code:
    {
        "base_spec": "/pa/tools/base_artillery_turret/base_artillery_turret.json",
        "ammo_id": "/pa/units/land/artillery_short/artillery_short_ammo.json",
        "rate_of_fire": 0.2,
        "max_firing_velocity": 150,
        "min_firing_velocity": 100,
        "ammo_source": "energy",
        "ammo_capacity": 1000,
        "ammo_demand": 200,
        "ammo_per_shot": 1000,
        "max_range": 260,
        "yaw_rate": 15,
        "pitch_rate": 15,
        "yaw_range": 180,
        "pitch_range": 89.9,
        "firing_arc_yaw": 0,
        "firing_arc_pitch": 5,
        "auto_attack": true,
        "firing_standard_deviation": 0.25,
        "physics": {
            "radius": 1,
            "push_class": 1,
            "gravity_scalar": 1,
            "add_to_spatial_db": false
        },
        "target_layers": [
            "WL_LandHorizontal",
            "WL_Seafloor",
            "WL_WaterSurface"
        ]
    }
    Default PA Artillery_short Ammo:
    Code:
    {
        "base_spec": "/pa/ammo/base_artillery/base_artillery.json",
        "damage": 300,
        "splash_damage": 300,
        "splash_radius": 12,
        "full_damage_splash_radius": 2,
        "splash_damages_allies": false,
        "initial_velocity": 150,
        "lifetime": 30,
        "influence_radius": 400,
        "audio_loop": "/SE/Movement/missile/artillery_short_missile_fly_loop",
        "events": {
            "died": {
                "audio_cue": "/SE/Impacts/missile_artillery_short",
                "effect_spec": "/pa/effects/specs/default_explosion.pfx"
            }
        }
    }
    With the current turret configuration, it does not shoot, nor even try to for that matter. Am I missing something obvious? Because I have all attributes for the turret matching with the artillery.
  6. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Alright I got it working by using the grenadier traits instead.

    Now the only thing that looks wrong is recoil. Is there some way to add recoil to the turret's muzzle so that it matches the projectile curvature?
  7. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Recoil is handled by the anim trees. I'm not on a computer so I can't look it up, but have a look at the anim JSON files for the artillery.
    killerkiwijuice likes this.
  8. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    I think to take a shorter way, how can I make the turret head tilt back in pitch space so it matches the projectile arc? (any parameter to affect the turret pitch?) I think making another anim tree would be too much work :confused:
  9. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Fairly sure that's in the anim tree. They are actually fairly simple files - below is one I just made by merging the laser turret and pelter (untested):

    Code:
    {
      "blend_root": {
        "aim_bone_root": "bone_turret",
        "child": {
          "type": "bind_pose"
        },
        "node_aim_down": {
          "type": "bind_pose"
        },
        "node_aim_neutral": {
          "type": "bind_pose"
        },
        "node_aim_up": {
          "type": "bind_pose"
        },
        "type": "aim_blend"
      },
      "skeleton_controls": [
        {
          "child": {
            "rotation_axis": "z",
            "rotation_bone": "bone_turret",
            "type": "procedural_aim"
          },
          "lerp_func": "is_active",
          "type": "fader"
        },
        {
          "child": {
            "rotation_axis": "x",
            "rotation_bone": "bone_pitch",
            "type": "procedural_aim"
          },
          "lerp_func": "is_active",
          "type": "fader"
        },
        {
          "bone": "bone_leftRecoil",
          "recoil_dist": 1.5,
          "restore_time": 0.5,
          "type": "recoil"
        },
        {
          "bone": "bone_rightRecoil",
          "recoil_dist": 1.5,
          "restore_time": 0.5,
          "type": "recoil"
        }
      ]
    }
    
    killerkiwijuice likes this.
  10. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Oh... I thought the weapon tool could control the pitch. Thanks, I'll try editing the anim trees.

Share This Page