NPC Classes and Templates - massif-press/lancer-data GitHub Wiki

Overview

The COMP/CON NPC data specification is open to the public as of v3, but NPC core book data still requires the purchase of the Lancer core book and downloading the NPC LCP.

File Structure

NPC LCPs may contain: (library style)

  • npc_classes.json
  • npc_features.json
  • npc_templates.json

OR, files named in the following patterns: (collection style)

  • npcc_CLASS-NAME
  • npct_TEMPLATE-NAME

The collection style is preferred for v3 and later.

Collection

A collection is a single NPC Class or NPC Template containing an the following:

[
  {
    /* One NPC Class or Template Data */
  },
  {
    /* A number of NPC Traits */
  },
];

The features in each collection will be linked to their class or templated when loaded into COMP/CON.

Library

A library can contain one or more NPC Class or NPC Template (npc_classes.json and npc_templates.json, respectively). In order for them to be furnished with features, they must contain the following properties in their class/template data:

{
  ...
  "base_features": [
    // feature IDs from features.json
  ],
  "optional_features": [
    // feature IDs from features.json
  ],
}

Collection imports can take these properties as well, in order to pull features from other classes or content packs.

NPC Class

Definition

{
 "id": string,
 "name": string,
 "role": string,
 "info": {
    "flavor": string,
    "tactics": string,
    "terse": string
 },
 "stats": {
    "armor": number | number[],
    "hp": number | number[],
    "evade": number | number[],
    "edef": number | number[],
    "heatcap": number | number[],
    "speed": number | number[],
    "sensor": number | number[],
    "save": number | number[],
    "hull": number | number[],
    "agility": number | number[],
    "systems": number | number[],
    "engineering": number | number[],
    "size": number | number[][], //see below
    "activations": number | number[]
  },
 "optionalClassMin"?: number,
 "optionalClassMax"?: number,
 "optionalClassPerTier"?: number
 "active_effects"?: IActiveEffects[];
},

Required Fields

id

Internal identifier. This must be globally unique. See Item ID Guidelines for more information.

name

The display name of the item

role

NPC combat role, can be one of "artillery" | "controller" | "defender" | "striker" | "support" | "tank". COMP/CON does not support multi-role NPC Classes at this time.

info

info is an object containing three string fields:

  • flavor, the Compendium fluff text for the item
  • tactics, a GM-facing strategy note, and
  • terse should be a GM-facing overview of the class in as few characters as possible

stats

All stats numbers are either a single integer or an array of three integers, one value per NPC tier. If only one number is supplied, that is equivalent to an array of [ N, N, N ]. The exception is size, where an NPC can have a single size or a selection of sizes per tier. This is always an array of arrays (Number[][]). Valid sizes are as follows:

"size": 1,
"size": [1], [2], [3](/massif-press/lancer-data/wiki/1],-[2],-[3)
"size": [0.5, 1],[0.5, 1],[0.5, 1, 2](/massif-press/lancer-data/wiki/0.5,-1],[0.5,-1],[0.5,-1,-2)

size values must be: 0.5 | 1 | 2 | 3. Values higher than 3 are not supporter (but should not cause a crash). Values below 0.5 or other fractional values may.

Optional Fields

optionalClassMin

Used to condition class feature selections. This works like its equivalent Template property. But this value restricts selections to class features. Defaults to 0.

optionalClassMax

Used to condition class feature selections. This works like its equivalent Template property. But this value restricts selections to class features.

optionalClassPerTier

Used to condition class feature selections. This works like its equivalent Template property. But this value restricts selections to class features.

active_effects

An array of Effect Objects scoped to the NPC. See Effect Objects

NPC Templates

{
  "id": string,
  "template": true, // see below
  "name": string,
  "description": string,
  "forceTag"?: string;
  "prohibitTemplates"?: string[];
  "optionalMin"?: number;
  "optionalMax"?: number;
  "optionalPerTier"?: number;
  "optionalClassMin"?: number;
  "optionalClassMax"?: number;
  "optionalClassPerTier"?: number;
  "caveat"?: string;
  "active_effects"?: IActiveEffects[];
},

Required Fields

id

Internal identifier. This must be globally unique. See Item ID Guidelines for more information.

template

"template": true is required and is used in safety checking when loading class and template data for collection formats.

name

The display name of the item

description

Flavor text for Compendium and expanded item cards. HTML syntax is allowed.

Optional Fields

forceTag

forceTag is an optional parameter that takes one of the following strings (case dependent): Mech | Ship | Vehicle | Biological | Squad | Other This locks the NPC tag to the supplied tag and prevents it from being modified by the user.

prohibitTemplates

prohibitTemplates is an optional array of template IDs that prevent the mutual application of other templates with the base template. Grunt, for example, prohibits Ultra, Veteran and Elite.

optionalMin

Used to condition feature selections. Please note that these values do not restrict selections to template features, but any valid feature selection for the NPC.

optionalMin sets the minimum number of optional feature selections. This defaults to 0.

optionalMax

Used to condition feature selections. Please note that these values do not restrict selections to template features, but any valid feature selection for the NPC.

optionalMax sets the maximum number of optional feature selections.

optionalPerTier

Used to condition feature selections. Please note that these values do not restrict selections to template features, but any valid feature selection for the NPC.

optionalPerTier sets the number of optional class feature selections per tier. The total number of feature selections is NPC Tier * optionalPerTiervalue.

If optionalMin and optionalMax values are present, optionalClassPerTier will be added to the selection values. For example, if an NPC Class had:

optionalMin: 3,
optionalMax: 4,
optionalPerTier: 1

At Tier 2 the NPC would make between 5 (3 + (1 _ 2)) and 6 (4 + (1 _ 2)) Feature selections.

caveat

caveat is a space for special rules that are not mechanically tracked by COMP/CON (eg. Commander traits not tracked if the unit is Jammed)

active_effects

An array of Effect Objects scoped to the NPC. See Effect Objects