Dismantle Sites¶
The dismantlesite is a special building. It is a building site where a building is being dismantled. Just like the constructionsite, it is defined only once for all tribes.
The dismantlesite is defined in
buildings/partially_finished/dismantlesite/init.lua
.
The building will also need its help texts,
which are defined in data/tribes/initialization/<tribe_name>/units.lua
- new_dismantlesite_type{table}
This function adds the definition of the dismantle site building to the engine.
- Parameters:
table – This table contains all the data that the game engine will add to this building. It only contains Common Building Properties.
For making the UI texts translateable, we also need to push/pop the correct textdomain.
Example:
push_textdomain("tribes")
dirname = path.dirname(__file__)
wl.Descriptions():new_dismantlesite_type {
name = "dismantlesite",
descname = pgettext("building", "Dismantle Site"),
animation_directory = dirname,
icon = dirname .. "menu.png",
vision_range = 2,
animations = {
idle = {
hotspot = { 5, 5 },
},
},
aihints = {},
}
pop_textdomain()