Building
A building script object represents a single building on the battlefield. This might be something as big as a garrisonable building or a section of wall fortification, or it could be as small as a crate or a barrel. Building script objects can be used to query or modify the subject building, and can also be passed to certain functions that take a building as an argument.
| Loaded in Campaign |
|
| Loaded in Battle |
|
| Loaded in Frontend |
|
A building script object may be sourced from the battle_buildings list object.
-
battle_building:position() -
Returns a
battle_vectorrepresenting the position of the building. The vector will be positioned at the pivot point of the building, which is not necessarily at its centre.Returns:
building positionbattle_vector
-
battle_building:central_position() -
Returns a
battle_vectorrepresenting the centre position of the building.Returns:
centre positionbattle_vector
-
battle_building:orientation() -
Returns the orientation of the building in degrees.
Returns:
orientationnumber
-
battle_building:has_gate() -
Returns whether this building contains a gate or not.
Returns:
contains gateboolean
-
battle_building:is_fort_wall() -
Returns whether this building is a fort wall or not.
Returns:
is fort wallboolean
-
battle_building:is_fort_tower() -
Returns whether this building is a fort tower or not.
Returns:
is fort towerboolean
-
battle_building:is_selectable() -
Returns whether this building is selectable or not. Qualifying buildings can be selected and issued orders, such as certain towers.
Returns:
is selectableboolean
-
battle_building:next() -
Returns the next fort wall building, if this building is part of a wall. If this building is not part of a wall then nil is returned.
Returns:
next buildingbattle_building
-
battle_building:previous() -
Returns the previous fort wall building, if this building is part of a wall. If this building is not part of a wall then nil is returned.
Returns:
previous buildingbattle_building
-
battle_building:alliance_owner_id() -
Returns the number of the
battle_alliancethat owns the building. If nobody owns this building then -1 is returned.Returns:
alliance owner idnumber
-
battle_building:name() -
Returns the name of the building.
Returns:
namestring
-
battle_building:category() -
Returns the category of this building, from the
battlefield_building_categoriesdatabase table.Returns:
building categorystring
-
battle_building:health() -
Returns the health of the building as a unary value (between 0 and 1).
Returns:
healthnumber
-
battle_building:hide() -
Hides the building, making it invisible.
Returns:
nil
-
battle_building:show() -
Shows the building after it has been hidden with
battle_building:hide.Returns:
nil
-
battle_building:set_on_fire(set on fireboolean) -
Sets the building on fire or not (if it is able to burn).
Parameters:
1
set on fire
Returns:
nil
-
battle_building:is_on_fire() -
Returns whether the building is currently on fire.
Returns:
is on fireboolean
-
battle_building:set_immune_to_catching_fire(booleanis flammable) -
Sets whether the building can burn or not.
Parameters:
1
booleanis flammable
Returns:
nil
-
battle_building:is_immune_to_catching_fire() -
Returns whether the building is currently immune to catching fire.
Returns:
is immune to catching fireboolean
-
battle_building:set_immune_to_fire_damage(booleantakes damage) -
Sets whether the building takes damage from burning or not.
Parameters:
1
booleantakes damage
Returns:
nil
-
battle_building:is_immune_to_fire_damage() -
Returns whether the building is currently immune to fire damage.
Returns:
is immune to catching fireboolean
-
battle_building:set_is_destructible(booleantakes damage) -
Sets whether the building takes damage at all.
Parameters:
1
booleantakes damage
Returns:
nil
-
battle_building:is_destructible() -
Returns whether the building can currently take damage.
Returns:
is destructibleboolean
-
battle_building:destroy() -
Destroys the building.
Returns:
nil