richtext_scenarios.lua

Functions to simplify text formatting in scenarios and make it consistent. Most of these functions are simple wrapper functions for our richtext system. This file will include richtext.lua for you for additional formatting functions.

speech(img, clr, title, text)

Formats a text as spoken by one person in a scenario. Use it as follows:

function jundlina(title, text)
   return speech("map:princess.png", "2F9131", title, text)
end
Parameters:
  • img – name of the image to use for this speaker
  • clr – a valid 6 char hex color to use for the name of this speaker
  • title – Title of this text. Use empty string if you don’t want any.
  • text – The text itself.
Returns:

the formatted text.

paragraphdivider()

Closes a paragraph and opens a new paragraph. Use this when you format a string with the speech function and need to divide the speech into multiple paragraphs.

Returns:close_p() .. open_p()
objective_text(heading, body)

Provides nice formatting for objective texts.

Returns:a rich text object that contains the formatted objective text.
new_objectives(...)

Append an objective text with a header to a dialog box in a nice fashion. For displaying objectives with an extra title when an advisor is talking

Provides nice formatting for objective texts. The following arguments will be parsed:

  • number: the number of objectives described in the body
  • body: the objective text, e.g. created with function objective_text(heading, body)
Returns:a rich text object that contains the formatted objective text & title.