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 |
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
-
alliance:armies()
-
Creates and returns a
armies
object listing all armies in the alliance.Returns:
armies listarmies
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:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 6607
-
alliance:is_attacker()
-
Returns whether this alliance is attacking in the battle.
Returns:
is attackerboolean
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:
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 ascript_ai_planner
instead of calling this function directly.Returns:
ai plannerai_planner
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 6675