building_help.lua

This script returns a formatted entry for the ingame building help. Pass the internal tribe name and building name to the coroutine to select the building type.

dependencies_basic(images[, text = nil])

Creates a dependencies line of any length.

Parameters
  • images – images in the correct order from left to right as table (set in {}).

  • text – comment of the image.

Returns

a row of pictures connected by arrows.

dependencies_resi(resource, items[, text = nil])

Creates a dependencies line of any length for resources (that don’t have menu.png files).

Parameters
  • resource – name of the geological resource.

  • items – ware/building descriptions in the correct order from left to right as table (set in {}).

  • text – comment of the image.

Returns

a row of pictures connected by arrows.

dependencies_training_food()

Creates dependencies lines for food in training sites.

Parameters

foods – an array of arrays with food items. Outer array has “and” logic and will appear from back to front, inner arrays have “or” logic

Returns

a list of food descriptions with images

dependencies_training_weapons(weapons)

Creates a dependencies line for any number of weapons.

Parameters
  • weapons – an array of weapon names

  • tribename – the name of the tribe for filtering the buildings

Returns

a list weapons images with the producing and receiving building

building_help_general_string(tribe, building_description)

Creates the string for the general section in building help

Parameters
  • tribe – The LuaTribeDescription for the tribe that has this building.

  • building_description – The LuaBuildingDescription for the building that we are displaying this help for.

Returns

rt of the formatted text

building_help_dependencies_production(tribe, building_description)

The input and output wares of a productionsite

Parameters
  • tribe – The LuaTribeDescription for the tribe that has this building.

  • building_description – The LuaBuildingDescription for the building that we are displaying this help for.

Returns

an rt string with images describing a chain of ware/building dependencies

building_help_dependencies_training(tribe, building_description)

Shows the production dependencies for a training site.

Parameters
  • tribe – The LuaTribeDescription for the tribe that has this building.

  • building_description – The LuaBuildingDescription for the building that we are displaying this help for.

Returns

rt string with training dependencies information.

building_help_building_section(building_description)

Formats the “Building” section in the building help: Enhancing info, costs and space required

Parameters

building_description – The LuaBuildingDescription for the building that we are displaying this help for.

Returns

an rt string describing the building section

building_help_crew_string(tribe, building_description)

Displays the building’s workers with an image and the tool they use

Parameters
  • tribe – The LuaTribeDescription for the tribe that we are displaying this help for.

  • building_description – The LuaBuildingDescription for the building that we are displaying this help for.

Returns

Workers/Crew section of the help file

building_help_production_section()

Displays the production/performance section with a headline

Returns

rt for the production section

building_help(tribe, building_description)

Main function to create a building help string.

Parameters
  • tribe – The LuaTribeDescription for the tribe that has this building.

  • building_description – The LuaBuildingDescription for the building that we are displaying this help for.

Returns

rt of the formatted text