Dialogue History link
Ren'Py includes a dialogue history system that stores each line of dialogue after it has been shown to the player. This stored dialogue can then be retrieved and re-shown to the player.
The dialogue history system is controlled by two variables.
config.history_length variable controls the maximum number
of history entries that are stored, and must be set to enable history
at all. The
_history variable can be used to disable and re-enable
_history_list variable stores the actual history, as
a list of HistoryEntry objects. HistoryEntry objects contain data in
their fields, as defined below.
- class HistoryEntry link
- kind link
The kind of character that created this history. Ren'Py sets this to "current" while a line of dialogue is displaying, and then to either "adv" or "nvl".
- who link
A string giving the name of the character that is speaking, or None if no such string exists.
- what link
A string giving the dialogue text.
- who_args link
A dictionary giving the properties that were supplied to the who text widget when the dialogue was originally shown.
- what_args link
A dictionary giving the properties that were supplied to the what text widget when the dialogue was originally shown.
- window_args link
A dictionary giving the properties that were supplied to the dialogue window when the dialogue was originally shown.
- show_args link
A dictionary giving the properties that were supplied to the say screen when the dialogue was originally shown.
- image_tag link
The image tag given to the
Character(), or None if no such tag was given.
- voice link
This is the object returned from
_get_voice_info(), storing information about the voice that is being played.
- rollback_identifier link
This is an identifier that can be passed to the
RollbackToIdentifier()action, to cause a rollback to the line of script that generated this history entry. The rollback only occurs if the location is still in the script log, otherwise the action is insensitive.
Once a HistoryEntry has been created, it is passed to each of the
config.history_callbacks, which allows creator-written
code to add new fields.