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.
- item_image(mapobject)¶
Creates Richtext image code for the given map object.
- Parameters:
mapobject – the mapobject to represent
- Returns:
richtext code for displaying the mapobject as an image, preferable using its menu icon
- find_resource_indicator(tribe, resource)¶
Returns the biggest resource indicator available.
- Parameters:
tribe – the tribe to use for getting a tribe-specific indicator
resource – a map resource description
- Returns:
a resource indicator immovable description
- find_created_collected_matches(creator, collector)¶
Returns a table of map objects that link the two given production sites
- Parameters:
creator – a productionsite description that creates bobs, immovables and/or resources
collector – a productionsite description that collects bobs, immovables and/or resources
- Returns:
a list of all bob, immovable and resource descriptions that matches both
- dependencies_collects(tribe, building_description)¶
Assemble dependency help for a building that collects bobs, immovables and/or resources
- Parameters:
tribe – the tribe for which to display this help
building_description – a production site that collects bobs, immovables and/or resources from the map
- Returns:
a richtext-formatted
p()
- dependencies_creates(tribe, building_description)¶
Assemble dependency help for a building that places bobs, immovables and/or resources on the map
- Parameters:
tribe – the tribe for which to display this help
building_description – a production site that creates bobs, immovables and/or resources
- Returns:
a richtext-formatted
p()
- building_help_general_string(tribe, building_description)¶
Creates the string for the general section in building help
- Parameters:
tribe – The
wl.map.TribeDescription
for the tribe that has this building.building_description – The
wl.map.BuildingDescription
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
wl.map.TribeDescription
for the tribe that has this building.building_description – The
wl.map.BuildingDescription
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_building_section(building_description)¶
Formats the “Building” section in the building help: Enhancing info, costs and space required
- Parameters:
building_description – The
wl.map.BuildingDescription
for the building that we are displaying this help for.- Returns:
an rt string describing the building section
- building_help_crew_section(tribe, building_description)¶
Displays the building’s workers with an image and the tool they use
- Parameters:
tribe – The
wl.map.TribeDescription
for the tribe that we are displaying this help for.building_description – The
wl.map.BuildingDescription
for the building that we are displaying this help for.
- Returns:
Workers/Crew section of the help file
- building_help_production_section(tribe, building_description)¶
Displays the production/performance section with a headline
- Parameters:
tribe – The
wl.map.TribeDescription
for the tribe that has this building.building_description – The
wl.map.BuildingDescription
for the building that we are displaying this help for.
- Returns:
rt for the production section
- building_help(tribe, building_description)¶
Main function to create a building help string.
- Parameters:
tribe – The
wl.map.TribeDescription
for the tribe that has this building.building_description – The
wl.map.BuildingDescription
for the building that we are displaying this help for.
- Returns:
rt of the formatted text