Alliance

Alliance objects represent logical alliances taking part in a battle. One or more armies fight together in an alliance to contest a battle. There are always exactly two alliances.

Alliance objects are derived from the battle_hierarchy, from the alliances collection object which is in turn sourced from the battle object.

Loaded in Battle loaded in battle
Back to top

Usage

Once a handle to an alliance object is obtained, functions may be called on it to query or modify its state in the following form.

Example - Specification:

<object_name>:<function_name>(<args>)

Example - Creation and Usage:

local alliance_player = bm:alliances():item(1)

-- calling a function on the object once created
bm:out("number of armies on the player's side: " .. alliance_player:armies():count())
number of armies on the player's side: 2
Back to top

Methods

alliance:armies()

Creates and returns a armies object listing all armies in the alliance.

Returns:

  1. armies armies list

defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 6594

alliance:force_ai_plan_type_attack()

Forces any AI in this alliance to prioritise attacking behaviour.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 6607

alliance:is_attacker()

Returns whether this alliance is attacking in the battle.

Returns:

  1. boolean is attacker

defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 6623

alliance:force_ai_plan_type_defend()

Forces any AI in this alliance to prioritise defensive behaviour.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 6658

alliance:create_ai_unit_planner()

Creates and returns an ai_planner object attached to this alliance. Consider creating a script_ai_planner instead of calling this function directly.

Returns:

  1. ai_planner ai planner

defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 6675

Last updated 25/08/2021 12:07:50