[REFERENCE] Tool & Ammo Blueprints

Discussion in 'Mod Discussions' started by Raevn, June 10, 2013.

  1. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Disclaimer: This information is based on build 49186 and may change in future builds.

    Weapons, Construction arms(collectively, tools) and ammo in PA are defined in .json files. Each has it's own folder, which are located in the following areas:

    • /PA/media/pa/ammo
    • /PA/media/pa/tools

    Viewing the .json files can be difficult due to the formatting, but using a josn parser can help, such as http://jsonlint.com/, or see this thread on a tool to re-format all .json files: http://forums.uberent.com/forums/viewtopic.php?f=72&t=47529.

    For Unit Blueprints, see http://forums.uberent.com/forums/viewtopic.php?f=72&t=47378&p=738070.

    Tools
    Tools can be either weapons or construction definitions, and each have their own set of properties. Unit specific tool files can be found in the same folder as the unit, or there are more generic ones that are found in "PA/media/pa/tools".

    All tools have a tool_type value (usually in the base inherited .json files). The possible values for this are:
    Code:
    "TOOL_BuildArm"
    "TOOL_Weapon"
    Weapons
    Weapon files describe the characteristics of a units' weapons. Weapons also have a corresponding ammo file with projectile characteristics.

    The weapon tool file for the ant is shown below.
    Code:
    {
        "base_spec": "/pa/tools/base_shell_turret/base_shell_turret.json",
        "ammo_id": "/pa/units/land/tank_light_laser/tank_light_laser_ammo.json",
        "rate_of_fire": 1,
        "max_range": 100,
        "yaw_rate": 90,
        "pitch_rate": 90,
        "yaw_range": 180,
        "pitch_range": 15,
        "auto_attack": true
    }
    "base_spec": The filename of the inherited tool .json file.
    "ammo_id": The filename of the weapon's ammo file.
    "rate_of_fire": Shots per second
    "max_range": Maximum range of the weapon
    "yaw_rate": Rate of horizontal aiming (degrees per second?)
    "pitch_rate": Rate of vertical aiming (degrees per second?)
    "yaw_range": Range of horizontal motion, in either direction from the direction the unit is facing.
    "pitch_range": Range of horizontal motion, in either direction from the direction the unit is facing.
    "auto_attack": true/false, whether the unit attacks without an explicit command or not.
    "target_layers": Which layers the weapon can target:
    Code:
    "WL_Land"
    "WL_Water"
    "WL_Air"
    "ammo_source": Accepted values:
    Code:
    "energy"
    "ammo_capacity": Maximum ammo capacity.
    "ammo_demand": Unknown. Energy per ammo?
    "ammo_per_shot": How much ammunition is used per shot.
    "firing_arc_yaw": Unknown
    "firing_arc_pitch": Unknown
    "manual_fire": true/false. Fired by script rather than by unit? (Seen on death weapon)
    "arc_type": Accepted values:
    Code:
    "Both"
    Construction
    The build arm tool file is shown below.

    Code:
    {
        "base_spec": "/pa/tools/engineer_build_arm/engineer_build_arm.json",
        "construction_demand": {
            "energy": 1000,
            "metal": 10
        },
        "yaw_rate": 90,
        "pitch_rate": 90
    }
    "base_spec": The filename of the inherited tool .json file.
    "construction_demand": Lists how much metal and energy is used while building
    "yaw_rate": Rate of horizontal aiming (degrees per second?)
    "pitch_rate": Rate of vertical aiming (degrees per second?)
    Last edited: June 10, 2013
    Quitch and killerkiwijuice like this.
  2. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Ammo
    Ammo files define the properties of weapon projectiles. They can be found inside the folder of specific units, or the generic base ammo files are in "PA/media/pa/ammo"

    The ammo tool file for the ant is shown below.

    Code:
    {
        "base_spec": "/pa/ammo/base_shell/base_shell.json",
        "damage": 33,
        "splash_damage": 0,
        "splash_radius": 0,
        "lifetime": 2,
        "initial_velocity": 150,
        "max_velocity": 150
    }
    "ammo_type": Accepted values:
    Code:
    "AMMO_Projectile"
    "PBAOE"
    "base_spec": The filename of the inherited tool .json file.
    "damage": Damage per hit.
    "flight_type": Accepted values:
    Code:
    "Ballistic"
    "Seeking"
    "splash_damage": Outer radius splash damage, interpolated?
    "splash_radius": Splash Radius
    "lifetime": How many seconds the projectile lasts for before disappearing.
    "initial_velocity": Starting speed
    "max_velocity": Maximum speed
    "max_range": Maximum build range
    "splash_damages_allies": true/false.
    "turn_rate": How fast the projectile can turn.

    Model
    TODO

    Physics
    The physics field contains the following properties:

    "layer": TODO
    "radius": TODO
    "push_class": TODO
    "gravity_scalar": TODO
    "air_friction": TODO
    Quitch and killerkiwijuice like this.
  3. bromanov

    bromanov New Member

    Messages:
    30
    Likes Received:
    0
    greatly appreciate all of this.

    let me know if i've taken a post you need lol
  4. theseeker2

    theseeker2 Well-Known Member

    Messages:
    1,613
    Likes Received:
    469
    Well, now I know how to mod weapons, change weapon characteristics with my modding tool.
  5. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Guess I can help here too.

    yaw_range: range of yaw motion in degrees from the weapon's default facing direction.
    pitch_range: same as above for pitch.
    firing_arc_yaw: how far off target the weapon can be. (ie a fighter does not aim a turret to fire a missile, it has a firing arc)
    firing_arc_pitch: same as above for pitch.
    arc_type: accepted values: Low, High, Both.


    Hope this helps.
    Quitch and stuart98 like this.
  6. pantsburgh

    pantsburgh Active Member

    Messages:
    151
    Likes Received:
    39
    So there is a starting velocity and a max velocity. I don't see a way to control the acceleration, though? I assume this gets controlled by "air_friction" and ???

    The unit blueprints have a separate acceleration value.
  7. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    None of the current Ammo files have an acceleration value, but it would almost certainly be present. Can't test though because it's not a client-side value :/
  8. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    accel_rate

    Currently not used yet.
    Quitch likes this.
  9. sebs303

    sebs303 New Member

    Messages:
    22
    Likes Received:
    6
    Is there a documentation of the "types" on numbers? I get it there are arc values that should be 180 or 360 maximum and non negative. Since I try to develop a validation library for all the mod files, it would be nice to add those as well. Thanks for consideration
  10. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    I think setting a weapon's yaw range to 0 and the pitch range to 0 prevents the weapon from firing at all, can someone confirm this?
  11. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    If a weapon can't find an appropriate firing angle it won't fire.
  12. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    Is there a way to make orbital-fired aa misiles homing? Because none of my attempts at fixing the issue seem to have worked...
  13. liquius

    liquius Well-Known Member

    Messages:
    731
    Likes Received:
    482
    Have you tried making it as a staged missile?
    squishypon3 likes this.
  14. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    Not yet, is there any reason that would work differently?
  15. liquius

    liquius Well-Known Member

    Messages:
    731
    Likes Received:
    482
    I am not sure how you want to implement your missile, but you can make a missile do pretty much anything with the staging system.

    What exactly do you want this missile to do? What problem are you running into?
  16. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    I have two units, one is an orbital unit that is supposed to fire homing missiles at avengers, but the missiles aren't homing. The other is an orbital anti-air sat. that is supposed to fire homing missiles at air units, but the missiles aren't homing either. Neither of these are tactical missiles, and neither of these use the staging system at the moment.
  17. mgmetal13

    mgmetal13 Active Member

    Messages:
    203
    Likes Received:
    151
    I am pretty sure the homing missiles in this game can only hit air units when they are turning. If you look closely at fighter dogfights, the missiles can't hit aircraft going full speed.
  18. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    The problem is that they aren't even trying to home in on planes in our mod...
  19. liquius

    liquius Well-Known Member

    Messages:
    731
    Likes Received:
    482
    If you share a link to your mod, people might actually be able to help you.
  20. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888

Share This Page