Construction Sites

The constructionsite is a special building. It is a building site where a building is being constructed. Just like the dismantlesite, it is defined only once for all tribes.

The constructionsite is defined in buildings/partially_finished/constructionsite/init.lua. The building will also need its help texts, which are defined in data/tribes/initialization/<tribe_name>/units.lua

new_constructionsite_type{table}

This function adds the definition of the construction 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_constructionsite_type {
   name = "constructionsite",
   descname = pgettext("building", "Construction Site"),
   animation_directory = dirname,
   icon = dirname .. "menu.png",
   vision_range = 2,

   animations = {
      idle = {
         hotspot = { 5, 5 },
      },
      idle_with_worker = {
         hotspot = { 33, 36 },
      }
   },

   aihints = {},
}

pop_textdomain()