Invasion Manager
The Invasion Manager is used to create and manage scripted A.I invasions in the campaign
The primary purpose of the Invasion Manager is to created, hold and manage invasion objects
See the invasion section below for details on how to set up and begin invasions
| Loaded in Campaign |
|
| Loaded in Battle |
|
| Loaded in Frontend |
|
-
invasion_manager:new_invasion(stringkey, stringfaction_key, stringforce_list, objectspawn_location) -
Adds a new invasion to the invasion manager
Parameters:
1
stringThe key of this invasion
2
stringThe key of the faction that this invasion belongs to
3
stringThe units that will be part of this invasion
4
objectPass either a table of x/y coordinates or a string for the key of a preset location
Returns:
invasionThe new invasion object created by this function
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 30
-
invasion_manager:new_invasion_from_existing_force(stringkey, force_interfaceforce) -
Adds a new invasion to the invasion manager created from an existing force
Parameters:
1
stringThe key of this invasion
2
force_interfaceThe existing force to use with this invasion
Returns:
invasionThe new invasion object created by this function
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 103
-
invasion_manager:new_spawn_location(stringkey, numberx, numbery) -
Create a new spawn location that can be used later by referencing its key
Parameters:
1
stringThe key of this location
2
numberThe X coordinate of this location
3
numberThe Y coordinate of this location
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 170
-
invasion_manager:get_invasion(stringkey) -
Returns an invasion from the invasion manager by its key
Parameters:
1
stringThe key of the invasion object
Returns:
invasionThe invasion object with the key provided
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 252
-
invasion_manager:remove_invasion(stringkey) -
Removes an invasion from the invasion manager by its key
Parameters:
1
stringThe key of the invasion object
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 264
-
invasion_manager:kill_invasion_by_key(stringkey) -
Kills an invasion via the invasion manager, see the kill function on the invasion object for details
Parameters:
1
stringThe key of the invasion object
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 275
Invasion
-
invasion:set_target(stringtarget_type, objecttarget, stringtarget_faction_key) -
Sets the target for an invasion
Target Types: REGION, CHARACTER, LOCATION, PATROL
- REGION - Requires the target to be set as a region key
- CHARACTER - Requires the target to be set as a character's CQI
- LOCATION - Requires the target to be set as a table containing an x and y variable, e.g. {x = 5, y = 3}
- PATROL - Requires the target to be set as a table containing any number of position tables, e.g. {{x = 5, y = 3}, {x = 9, y = 2}}
Parameters:
1
stringThe type of the target
2
objectThe actual target
3
stringThe faction that is the indended target
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 306
- REGION - Requires the target to be set as a region key
-
invasion:remove_target() -
Sets this invasion to no longer have a target
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 354
-
invasion:add_aggro_radius(numberradius, tabletarget_list, numberabort_timer) -
Add an aggravation radius to this invasion in which the force will attack all specified targets that enter its aggro range
Parameters:
1
numberThe radius of the aggrevation range at which this invasion will trigger an attack
2
tableA table containing faction keys of all the factions that will trigger an attack. If nil, will target any warring factions
3
numberThe number of turns after which this invasion will give up after chasing a target
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 363
-
invasion:remove_aggro_radius() -
Removes all aggravation behaviour from this invasion
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 384
-
invasion:abort_on_target_owner_change(booleanabort) -
Sets if the Invasion will abort if the owner of the target differs to the Invasions faction target
Parameters:
1
booleanWill abort if true
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 397
-
invasion:assign_general(charactercharacter) -
Sets a General to be used when spawning this invasion
Parameters:
1
characterThe general that will be used (can optionally be a character CQI)
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 405
-
invasion:create_general(make_faction_leader
boolean,agent_subtype
string,forename
string,clan_name
string,family_name
string,other_name
string
) -
Sets up a general to be created to command this invasion force when it is spawned
Parameters:
1
booleanIf True this character will become the faction leader
2
stringThe key of this characters intended subtype
3
stringThe name key of this characters forename
4
stringThe name key of this characters clan name
5
stringThe name key of this characters family name
6
stringThe name key of this characters other name
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 416
-
invasion:set_general_immortal(booleanshould_stop) -
Sets whether the General leading this invasion should be immortal or not
Parameters:
1
booleanGeneral spawned will be immortal if True
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 437
-
invasion:should_stop_at_end(booleanshould_stop) -
Sets the Invasion should not move after completing it's objective
Parameters:
1
booleanWill stop if True
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 452
-
invasion:apply_effect(stringeffect_key, numberturns) -
Allows you to apply an effect bundle to the forces in this invasion
Parameters:
1
stringThe key of the effect bundle
2
numberThe turns the effect bundle will be applied for after the invasion is started
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 464
-
invasion:add_character_experience(numberexperience_amount, booleanby_level) -
Allows you to add experience to the general in this invasion or set their level
Parameters:
1
numberThe amount of experience to apply
2
booleanIf true the experience amount supplied will set the level of the character and not their xp
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 484
-
invasion:add_unit_experience(numberunit_experience_amount) -
Allows you to add experience to the units of the army in this invasion
Parameters:
1
numberThe amount of experience to apply
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 516
-
invasion:add_respawn(booleanrespawn, numberrespawn_count, numberrespawn_delay) -
Allow you to add a respawn to the invasion so that if it dies it will respawn a set amount of times after a set delay
Parameters:
1
booleanIf True this invasion will spawn after its force dies
2
numberThe amount of times the invasion will respawn before stopping
3
numberThe delay before respawning another time after the force respawns
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 534
-
invasion:should_maintain_army(booleanmaintain, numberrespawn_count) -
Allows you to set the invasion to maintain its army strength by adding a missing unit each turn with a percentage chance
Parameters:
1
booleanIf True this invasion will attempt to maintain it strength
2
numberThe chance per turn to add one of its missing units
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 553
-
invasion:start_invasion(maintain
function,declare_war
[boolean],invite_attacker_allies
[boolean],invite_defender_allies
[boolean],allow_diplomatic_discovery
[boolean]
) -
Starts the invasion, spawning its force if neccessary and handing control of the force over to the script instead of the A.I
Parameters:
1
functionIf True this invasion will attempt to maintain it strength
2
booleanoptional, default value=true
If True the invasion will declare war on its targets
3
booleanoptional, default value=true
If True the invasion will invite its allies when declaring war
4
booleanoptional, default value=true
If True the invasions target will invite its allies when declaring war
5
booleanoptional, default value=true
If True the invasion manager will decide whether to allow diplomatic discovery for the spawned ai force; If false there will be no diplomatic discovery occurring for the spawned ai force (this additional optional parameter is being supplied because it can create a major slowdown)
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 568
-
invasion:release() -
Releases the invasion force back to AI control
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 1172
-
invasion:kill(booleangeneral_only) -
Kills this invasions General and the whole force (or just the General)
Parameters:
1
booleanIf True only the Generate will be killed and the force will remain
Returns:
nil
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 1189
-
invasion:get_general() -
Returns the character leading this invasion force
Returns:
characterThe general of the invasions force
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 1207
-
invasion:get_commander() -
Returns the character that is the current leader of this force even if it is a colonel
Returns:
characterThe commander of the invasions force
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 1221
-
invasion:get_force() -
Returns the force interface of this invasion
Returns:
military_forceThe military force belonging to the invasion
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 1247
-
invasion:has_target() -
Checks if an invasion has a target
Returns:
booleanReturns True if the invasion has a target
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 1257
-
invasion:has_started() -
Checks if an invasion has started
Returns:
booleanReturns True if this invasion has started
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 1264
-
invasion:turn_spawned() -
Checks what turn this invasion was spawned on
Returns:
numberReturns the turn number that this invasion was started on, or 0 if it has not been
defined in ../../warhammer/working_data/script/_lib/lib_campaign_invasion_manager.lua, line 1271