Capture Location

This object represents a capture location on the battlefield. A list of capture locations may be retrieved from battle_capture_location_manager object, which is itself retrieved by calling the function battle:capture_location_manager.

Loaded in Campaign Loaded in Campaign
Loaded in Battle Loaded in Battle
Loaded in Frontend Loaded in Frontend
Back to top

Functionality

capture_location:highlight([boolean show highlight])

Activates or deactivates a highlights on the capture location.

Parameters:

1

boolean

optional, default value=true

show highlight

Returns:

  1. nil

capture_location:position()

Returns the position of the capture location.

Returns:

  1. battle_vector position

capture_location:unique_id()

Returns the unique_id of the capture location.

Returns:

  1. number unique_id

capture_location:script_id()

Returns the script id of the capture location. This can be set in the terrain editor. A blank string is returned if no script id is set.

Returns:

  1. string script_id

capture_location:type()

Returns the type of the capture location, from the capture_location_types table.

Returns:

  1. string script_id

capture_location:set_enabled(boolean enable)

Enables or disables the capture location.

Parameters:

1

boolean

enable

Returns:

  1. nil

capture_location:is_enabled()

Returns whether the capture location is enabled.

Returns:

  1. boolean enabled

capture_location:set_locked(boolean lock)

Locks or unlocks the capture location.

Parameters:

1

boolean

lock

Returns:

  1. nil

capture_location:is_locked()

Returns whether the capture location is locked.

Returns:

  1. boolean locked

capture_location:contributes_to_victory()

Returns whether the capture of this capture location contributes towards victory in the battle.

Returns:

  1. boolean contributes to victory

capture_location:linked_buildings()

Returns a battle_buildings list containing any building objects linked to this capture location, if any.

Returns:

  1. battle_buildings buildings list

capture_location:change_holding_army([battle_army holding army])

Changes the army who owns the capture location to the supplied army. If no battle_army argument is supplied then the capture location is set to neutral.

Parameters:

1

battle_army

optional, default value=nil

holding army

Returns:

  1. nil

capture_location:is_held()

Returns whether the capture location is currently controlled by an alliance.

Returns:

  1. boolean is held

capture_location:holding_alliance_id()

Returns the id of the alliance who owns the capture location. If no alliance owns the capture location then 0 will be returned;

Returns:

  1. number alliance id

capture_location:holding_army()

Returns the army that owns the capture location. If no army holds the capture location then nothing is returned.

Returns:

  1. battle_army holding army

capture_location:is_contested()

Returns whether the capture location is currently being contested.

Returns:

  1. boolean is contested

capture_location:contesting_army()

Returns the army currently contesting the capture location is currently being contested. If the capture location is not being contested then nothing is returned.

Returns:

  1. boolean is contested

capture_location:contesting_alliance_id()

Returns the id of the alliance currently contesting the capture location. If no alliance is currently contesting the capture location then nothing will be returned.

Returns:

  1. number contesting alliance id

capture_location:set_income_cap_for_alliance(number alliance_id, number income_cap)

Sets income cap for the whole alliance

Parameters:

1

number

alliance_id

2

number

income_cap

Returns:

  1. nil

capture_location:set_income_cap_for_army(number army_id , number income_cap)

Sets income cap for specific army

Parameters:

1

number

army_id

2

number

income_cap

Returns:

  1. nil

Capture Location Manager

The capture location manager provides an interface to obtain battle_capture_location objects on the battlefield. A handle to the capture location manager may be obtained by calling battle:capture_location_manager.

Back to top

Functionality

capture_location_manager:capture_location_from_script_id()

Retrieves a battle_capture_location using a supplied script id. If no capture location exists with the supplied script id then nothing is returned.

Returns:

  1. battle_capture_location capture location

capture_location_manager:item()

Retrieves a battle_capture_location by numerical index. If no capture location exists at the supplied index then nothing is returned. The number of capture locations on the battlefield can be queried using capture_location_manager:count.

Returns:

  1. battle_capture_location capture location

capture_location_manager:count()

Retrieves the number of battle_capture_location objects on the battlefield. Each individual capture location can be retrieved with capture_location_manager:item.

Returns:

  1. number number of capture locations
Last updated 7/9/2024 11:45:05 AM