File: store_variables.rst

package info (click to toggle)
renpy 7.1.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 107,352 kB
  • sloc: python: 42,124; ansic: 4,781; makefile: 43; sh: 14
file content (155 lines) | stat: -rw-r--r-- 5,151 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
Store Variables
===============

Ren'Py has a number of store variables that control its function. Store
variables may be changed at any time. If a store variable is changed after
the game has started, it will be be saved and loaded by the save system,
and rolled-back when rollback occurs.

.. var:: adv = Character(...)

    This is a template ADV-mode character, and the default character kind
    that is used when :func:`Character` is called.

.. var:: _confirm_quit = True

    This determines if quitting the game asks for confirmation. It is
    set to False during the splashscreen, and is ignored when in the main
    menu.

.. var:: _dismiss_pause = True

    If True, the player can dismiss pauses and transitions.

.. var:: _game_menu_screen = "save"

    This is the screen that is displayed when entering the game menu with no
    more specific screen selected. (For example, when right-clicking, pressing
    escape, or when :func:`ShowMenu` is not given an argument.) If None, entry
    to the game menu is disallowed.

    This is set to None at the start of the splashscreen, and restored to its
    original value when the splashscreen ends.

.. var:: _history = True

    If true, Ren'Py will record dialogue history when a line is shown. (Note
    that :var:`config.history_list_length` must be set as well.)

.. var:: _history_list = [ ]

    This is a list of history objects, corresponding to each line of history
    from oldest to newest. See the :ref:`History <history>` section for more
    information.

.. var:: _ignore_action = None

    When this is not None, it's an action that is run after clicking Ignore
    on the error handling screen. The action is usually :func:`Jump`, to jump
    the game to a place that can recover from an error. If None, control
    continues with the next Ren'Py statement.

.. var:: main_menu = False

    Ren'Py sets this variable to True while in the main menu. This can be used
    to have screens display differently while in the main menu.

.. var:: _menu = False

    Ren'Py sets this variable to True when entering a main menu or game menu
    context.

.. var:: menu = renpy.display_menu

    The function that's called to display the in-gamemenu. It should take the same
    arguments as :func:`renpy.display_menu`. Assigning :func:`nvl_menu` to this
    will display an nvl-mode menu.

.. var:: mouse_visible = True

    Controls if the mouse is visible. This is automatically set to true when
    entering the standard game menus.

.. var:: name_only = Character(...)

    This is a template character that is used when a string is given as the
    character name in a say statement. This::

        "Eileen" "Hello, world."

    is equivalent to::

        $ temp_char = Character("Eileen", kind=name_only)
        temp_char "Hello, world."

    except that the ``temp_char`` variable is not used.

.. var:: narrator = Character(...)

    This is the character that speaks narration (say statements that do not
    give a character or character name). This::

        "Hello, world."

    is equivalent to::

        narrator "Hello, world."

.. var:: _quit_slot = None

    If not None, this should be a string giving the name of a file slot.
    When Ren'Py quits, the game will be saved in this slot.

.. var:: _rollback = True

    Controls if rollback is allowed.

.. var:: say = ...

    A function that is called by Ren'Py to display dialogue. This is called
    with three arguments. The first argument (`who`) is the character saying the
    dialogue (or None for the narrator). The second argument (`what`) is what dialogue
    is being said.

    The third argument must be a keyword argument named `interact` and defaulting
    to True. If true, the say function will wait for a click. If false, it will
    immediately return with the dialogue displayed on the screen.

    It's rare to call this function directly, as one can simply call a character
    with dialogue. This variable mostly exists to be redefined, as a way of
    hooking the say statement.

.. var:: save_name = ""

    A save name that is included with saves.

.. var:: _skipping = True

    Controls of if skipping is allowed.

.. var:: _version = ...

    This is set to :var:`config.version` when a new game is started. It can be
    use by the ``after_load`` label or :var:`config.after_load_callbacks` to
    determine which upgrades need to be done.

    This is only set once, upon the initial start. After that, the game is
    responsible for updating _version as necessary.

.. var:: _window = False

    This set by the ``window show`` and ``window hide`` statements, and indirectly
    by ``window auto``. If true, the dialogue window is shown during non-dialogue
    statements.

.. var:: _window_auto = False

    This is set to true by ``window auto`` and to false by ``window show`` and
    ``window hide``. If true, the window auto behavior occurs.

.. var:: _window_subtitle = ''

    This is appended to :var:`config.window_title` to produce the caption for the game
    window. This is automatically set to :var:`config.menu_window_subtitle` while in
    the game menu.