Create or update an NPC template
dos2_put_npc_templateCreate or update a saved NPC template in a GM campaign by copying and adjusting a base NPC's stats, skills, and items; omitted fields keep the base values.
Instructions
Creates a saved NPC template in the campaign (the Game Master's "Creatures and Items" panel), or changes the one that already has this name. The usual way is to copy a ready NPC with base and adjust it: name, level, alignment, GM stat edits, skills, items. Parameters you omit keep the base's values.
Writes Eggs.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
The template only defines what the GM can place: it does not put a character into a scene (place it in the game,
or use dos2_live_spawn). Returns created (true for a new template), the resulting template in full and the
backup id. For item templates use dos2_put_item_template.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"campaign": "<campaign>",
"name": "<name>"
},
"name": "dos2_put_npc_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Template to copy from: "Campaign:Name", or just a name that is unique across all campaigns (find one with dos2_find_templates). Omit to change the existing template called name in place. | |
| name | Yes | Template name. An existing template with this name in the campaign is updated or replaced. | |
| bonus | No | GM additions to the base stats, e.g. {"Constitution": 4, "Strength": 2}. A value of 0 removes that edit. | |
| items | No | The complete item list; replaces the items. Each entry: {"stats_id", "template_id", "amount", "slot", "level", "name"}. slot is a number or one of weapon, shield, helmet, breast, leggings, boots, gloves, belt, amulet, ring, ring2; backpack when omitted. | |
| level | No | NPC level. Omit to keep the base's. | |
| skills | No | The complete skill list, e.g. ["Target_SingleHandedAttack", "Shout_EnemyTaunt"]. Replaces the skills and fills the skill bar in this order. | |
| trader | No | Whether the NPC offers trade. Omit to keep. | |
| talents | No | Talents to add, by their Script Extender names, e.g. ["Executioner", "Leech"]. | |
| campaign | Yes | The campaign to work on: its name, its folder name, its UUID, or a unique part of any of them. dos2_status lists the campaigns. | |
| alignment | No | Attitude towards the party: "Neutral NPC", "Evil NPC" (hostile) or "Good NPC" (ally). | |
| archetype | No | AI archetype name that drives combat behaviour, copied verbatim into the template. Omit to keep. | |
| stat_name | No | Stats entry that gives the base stats, e.g. GEN_HumanCitizen. Omit to keep the base's. | |
| items_from | No | "Campaign:Name" of a template whose items are copied as they are, including generated stats. | |
| reset_bonus | No | First drop every GM edit inherited from the base (stats, abilities, talents), then apply yours. Default false. | |
| template_id | No | Root template GUID: the model, race and gender. Omit to keep the base's. | |
| display_name | No | Name shown above the character's head, when it should differ from the template name. | |
| ability_bonus | No | GM additions to abilities, e.g. {"TwoHanded": 3, "WarriorLore": 2}. 0 removes the edit. | |
| allow_running | No | Keep false. Set true only after the user has confirmed that the running game sits in the main menu: a write into a campaign that is loaded in the game gets lost or damages it. | |
| remove_talents | No | Talents to remove, by the same names. |