help.lua

This script contains functions that are used both in the Tribal Encyclopedia and the Editor help. To get descriptions see: wl.Descriptions.

include "scripting/help.lua"
linkify_encyclopedia_object(descr)

Return the localized name of the given unit description as a hyperlink pointing to its encyclopedia entry.

Parameters

descr – The unit description to linkify.

Returns

Richtext markup for the hyperlink.

tree_affinity_list(terrain_description)

Returns list of trees that is most likely to grow on the given terrain, sorted in descending order by probability.

Parameters

terrain_description (TerrainDescription) – The terrain type that we want the information for.

Returns

list of ImmovableDescription that have the attribute “tree” and probabilities.

terrain_affinity_list(immovable_description)

Returns list of terrains that the given immovable is most likely to grow on, sorted in descending order by probability.

Parameters

immovable_description (ImmovableDescription) – The immovable type that we want the information for.

Returns

list of TerrainDescription and probabilities.

terrain_affinity_help(immovable_description)

Returns a formatted help string for the terrains that the given immovable is most likely to grow on.

Parameters

immovable_description (ImmovableDescription) – The immovable type that we want the information for.

Returns

a richtext-formatted list of terrain images, terrain names and probabilities.