DOCS/man/input: note that properties can be unavailable on init

It comes up often in IRC and issues that users don't understand why the
path property is initially unavailable, so link the section that
mentions it from the Properties section, and expand on how to get these
properties.
This commit is contained in:
Guido Cella 2024-10-30 19:35:37 +01:00 committed by Kacper Michajłow
parent 6085261146
commit 4def28ad0d
2 changed files with 5 additions and 1 deletions

View File

@ -1940,6 +1940,9 @@ If an option is referenced, the property will normally take/return exactly the
same values as the option. In these cases, properties are merely a way to change
an option at runtime.
Note that many properties are unavailable at startup. See `Details on the script
initialization and lifecycle`_.
Property list
-------------

View File

@ -86,7 +86,8 @@ own event handlers which you have registered with ``mp.register_event``, or
timers added with ``mp.add_timeout`` or similar. Note that since the
script starts execution concurrently with player initialization, some properties
may not be populated with meaningful values until the relevant subsystems have
initialized.
initialized. Rather than retrieving these properties at the top of scripts, you
should use ``mp.observe_property`` or read them within event handlers.
When the player quits, all scripts will be asked to terminate. This happens via
a ``shutdown`` event, which by default will make the event loop return. If your