Skip to content

Instantly share code, notes, and snippets.

@sebs
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save sebs/8835282 to your computer and use it in GitHub Desktop.

Select an option

Save sebs/8835282 to your computer and use it in GitHub Desktop.
pa json docs

Unit Blueprints

Alpha Disclaimer: This information is still being compiled, but is currently based on PA Build 50256 and may change

See PA Modding Changes for any changes that may have been made after this build.

Units in PA are defined in .json files. Each unit has it's own folder, which is located in /PA/media/pa/units//.

All available units are listed in the file PA\media\pa\units\unit_list.json. The unit must be in this list for it to be present in-game.

Viewing the .json files can be difficult due to the formatting, but using a json parser can help, such as JSONLint, or see this thread for a tool to re-format all .json files.

As an example, below is the .json file for the Ant - named tank_light_laser.json in the data files, (renamed to .txt in order to upload):

Client-Side/Server-Side attributes

While the Unit blueprints can be edited freely, the Planetary annihilation server ultimately dictates most of the units attributes. This means most attributes effectively cannot be changed. Some are only for the benefit of the client (such as "display_name"), and these can be modified freely. Many attributes marked "Server Only" wont have any material effect on the game if changed, but can be altered to change the visual appearance of the client. These include content such as models and textures.

Server Only attributes are marked in Blue. (Assumed) Client-Side attributes are marked in Green

Attributes

General

Below is a list of attributes for units. Not all units will have all of these; any missing values may inherit from a base class (see base_spec)

  • "audio": See Audio section, below.
  • "base_spec": String. File path to inherited blueprint. Any values not present in a blueprint will use the values in the blueprint defined in base_spec (See [REFERENCE] Unit Blueprint Inheritance).
  • "build_metal_cost": Integer. The metal cost of the unit.
  • "buildable_types": String. Defines what units this unit can build. This is specified by combining unit types (without the UNITTYPE_ prefix) with & (and) and | (or) to logically allow/disallow construction. For example, the fabrication bot has the following: Code:
  • "Land & Structure & Tech1 | Factory & Tech1 | Factory & Tech2 & Bot & Land" This lets it build units that have the Land, Structure AND Tech1 types, OR the Factory AND Tech1 types, OR the Factory, Tech2, Bot AND land types.
  • "building_skirt": 2D Array(Integers). Defines the length and width of a building.
  • "command_caps": Array (Strings). Defines what commands this unit has. Accepted values (leading "ORDER_" is optional):
  • "ORDER_Assist"
  • "ORDER_Attack"
  • "ORDER_Build"
  • "ORDER_FactoryBuild"
  • "ORDER_Move"
  • "ORDER_Patrol"
  • "ORDER_Reclaim"
  • "ORDER_Repair"
  • "consumption": -> "energy": Integer. Ongoing energy usage of the unit.
  • "consumption": -> "metal": Integer. Ongoing metal usage of the unit.
  • "death": See Death section, below.
  • "description": String. The description of the unit in-game
  • "display_group": Integer. Determines the order this unit will appear in build menus (Higher numbers first).
  • "display_index": Integer. Determines the display order of strategic icons (Icons with higher numbers will appear above lower ones)
  • "display_name": String. The name of the unit in-game.
  • "events": See Events section, below.
  • "fx_offsets": See FX Offsets section, below.
  • "guard_radius": Integer. The radius the unit uses for acquiring targets. The unit will use it's max weapon range instead if it is larger.
  • "guard_layer": String. The layer on which the unit will attempt to look for targets. Accepted values:
  • "WL_Air"
  • "WL_AnySurface"
  • "WL_Land"
  • "headlights": See Headlights section, below.
  • "max_health": Integer. The health of the unit.
  • "mesh_bounds": TODO
  • "model": See Model section, below.
  • "navigation": See Navigation section, below.
  • "physics": See Physics section, below.
  • "placement_size: 2D Array(Integers). Defines the length and width of a building footprint[/color]
  • "production": -> "energy": Integer. How much energy the unit produces.
  • "production": -> "metal": Integer. How much metal the unit produces. "recon": See Recon section, below. "storage": -> "energy": Integer. How much energy storage the unit has. "storage": -> "metal": Integer. How much metal storage the unit has. "TEMP_texelinfo": Float. See this post. "tools": See Tools section, below. "si_name": String. An alternate name to use when performing a Strategic Icon lookup (See [REFERENCE] Strategic Icons & Build Pictures). "unit_name": String. Internal unit name. Unsure if this is used anywhere. "unit_types": Array (Strings) A list of flags indicating what type of unit this is. Used by buildable_types (and probably in many other places). Accepted Values: "UNITTYPE_Air" "UNITTYPE_Bomber" "UNITTYPE_Bot" "UNITTYPE_CmdBuild" "UNITTYPE_Commander" "UNITTYPE_Construction" "UNITTYPE_Defense" "UNITTYPE_EnergyProduction" "UNITTYPE_Fabber" "UNITTYPE_Factory" "UNITTYPE_Fighter" "UNITTYPE_Land" "UNITTYPE_MetalProduction" "UNITTYPE_Mobile" "UNITTYPE_Naval" "UNITTYPE_Orbital" "UNITTYPE_Scout" "UNITTYPE_Structure" "UNITTYPE_Tank" "UNITTYPE_Tech1" "UNITTYPE_Tech2" "wait_to_rolloff_time": Integer. How long a factory waits before telling a completed unit to move away, in seconds.

Audio The audio field ("audio":) firstly contains a list of looping sounds, under "loops":. Within that are a series of entries for different sounds to be played. Each entry has the following properties:

"cue": String. A soundback reference path (See [REFERENCE] Audio). "flag": String. Unsure. Accepted values: "build_target_changed" "vel_changed" "should_start_func": String. When to start the sound. Accepted values: "has_build_target" "no_build_target" "is_moving" "is_not_moving" "should_stop_func": String. When to stop the sound. Accepted values: "has_build_target" "no_build_target" "is_not_moving" "is_moving"

Example, from PA\media\pa\units\commanders\base_commander\base_commander.json:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment