Category:Parties and party templates

Parties are extremely important element of single-player modding, because they are the only object which can be present on the world map. Each party is a semi-independent object with it's own behavior. Note that you cannot control party's behavior directly, instead you can change various factors which affect party behavior (including party AI settings).

There are two things of importance when dealing with parties. First, parties can be attached to each other, this allows you, for example, to stack a number of armies inside a single city. Second, parties may encounter each other. When two AI parties are in encounter, it usually means they are fighting. Player's encounter with an AI party is usually much more complex and may involve pretty much anything, which is why player's encounters are covered in a separate section of the file.

Each party consists of troop stacks. Each troop stack is either a single hero (troop defined as tf_hero in module_troops.py file) or a number of regular troops (their number may vary from 1 and above). Each party has two sets of troop stacks: members (or companions) set of stacks, and prisoners set of stacks. Many operations will only affect members, others may only affect prisoners, and there are even operations to switch their roles.

Another important concept is a party template. It's definition looks very similar to a party. Templates are used when there's a need to create a number of parties with similar set of members, parameters or flags. Also templates can be easily used to differentiate parties from each other, so they are akin to a "party_type" in the game.

Note that parties are the only game object which is persistent (i.e. it will be saved to the savegame file and restored on load), has slots and can be created during runtime. This makes parties ideal candidates for dynamic information storage of unlimited volume, which the game otherwise lacks.