1-- The basic worker documentation is located in /doc/sphinx/lua_tribes_workers_rst.org 2 3-- RST 4-- .. _lua_tribes_basic_workers: 5-- 6-- Workers 7-- -------- 8-- 9-- Workers of this basic type work in buildings. Their function is defined either 10-- through the :ref:`buildings' programs <productionsite_programs>`, or through their :ref:`own programs <tribes_worker_programs>`. 11-- 12-- Workers are defined in 13-- ``data/tribes/workers/<tribe name>/<worker_name>/init.lua``. 14-- The worker will also need its :ref:`help texts <lua_tribes_workers_helptexts>`, 15-- which are defined in ``data/tribes/wares/<tribe name>/<worker_name>/helptexts.lua``. 16dirname = path.dirname(__file__) 17 18animations = { 19 idle = { 20 pictures = path.list_files(dirname .. "idle_??.png"), 21 hotspot = { 10, 21 }, 22 } 23} 24add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10) 25add_directional_animation(animations, "walkload", dirname, "walkload", {8, 23}, 10) 26 27-- RST 28-- .. function:: new_worker_type{table} 29-- 30-- This function adds the definition of a worker to the engine. 31-- 32-- :arg table: This table contains all the data that the game engine will add 33-- to this worker. It contains the properties in 34-- :ref:`lua_tribes_workers_common`. 35tribes:new_worker_type { 36 msgctxt = "atlanteans_worker", 37 name = "atlanteans_armorsmith", 38 -- TRANSLATORS: This is a worker name used in lists of workers 39 descname = pgettext("atlanteans_worker", "Armorsmith"), 40 helptext_script = dirname .. "helptexts.lua", 41 icon = dirname .. "menu.png", 42 vision_range = 2, 43 44 buildcost = { 45 atlanteans_carrier = 1, 46 hammer = 1 47 }, 48 49 animations = animations, 50} 51