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 Battle |
A building script object may be sourced from the buildings
list object.
***** WARNING: at time of writing this list object is broken and, if used, will cause crashes. *****
-
building:position()
-
Returns a
battle_vector
representing 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
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1193
-
building:central_position()
-
Returns a
battle_vector
representing the centre position of the building.Returns:
centre positionbattle_vector
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1211
-
building:alliance_owner_id()
-
Returns the number of the
alliance
that owns the building. If nobody owns this building then -1 is returned.Returns:
alliance owner idnumber
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1231
-
building:name()
-
Returns the name of the building.
Returns:
namestring
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1247
-
building:health()
-
Returns the health of the building as a unary value (between 0 and 1).
Returns:
healthnumber
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1261
-
building:hide()
-
Hides the building, making it invisible.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1279
-
building:show()
-
Shows the building after it has been hidden with
building:hide
.Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1292
-
building:change_on_fire(boolean
set on fire)
-
Sets the building on fire or not (if it is able to burn).
Parameters:
1
boolean
set on fire
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1308
-
building:change_immune_to_catching_fire(boolean
is flammable)
-
Sets whether the building can burn or not.
Parameters:
1
boolean
is flammable
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1331
-
building:change_immune_to_fire_damage(boolean
takes damage)
-
Sets whether the building takes damage from burning or not.
Parameters:
1
boolean
takes damage
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1347
-
building:change_is_destructible(boolean
takes damage)
-
Sets whether the building takes damage at all.
Parameters:
1
boolean
takes damage
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1363
-
building:destroy()
-
Destroys the building.
Returns:
nil
defined in ../../common/EmpireBattle/Source/BattleScript/BattleEditorScriptInterface.cpp, line 1380