summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mikheev <ptmikheev@gmail.com>2022-01-29 23:18:41 +0000
committerPetr Mikheev <ptmikheev@gmail.com>2022-01-29 23:18:41 +0000
commit2e0b95bbd4eb7d2282b2281c51e942687e01d7df (patch)
tree8276c2e558c27b4579ac5fc96909a41d182fc505
parent81af49341279cf15b1ebc2cfc49d2debb2977f85 (diff)
Update docs/source/reference/lua-scripting/engine_handlers.rst, docs/source/reference/lua-scripting/overview.rstptmikheev-master-patch-38354
-rw-r--r--docs/source/reference/lua-scripting/engine_handlers.rst3
-rw-r--r--docs/source/reference/lua-scripting/overview.rst4
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/source/reference/lua-scripting/engine_handlers.rst b/docs/source/reference/lua-scripting/engine_handlers.rst
index 4f5f99965a..46e648d620 100644
--- a/docs/source/reference/lua-scripting/engine_handlers.rst
+++ b/docs/source/reference/lua-scripting/engine_handlers.rst
@@ -19,6 +19,9 @@ Engine handler is a function defined by a script, that can be called by the engi
| onLoad(savedData, initData) | | Called on loading with the data previosly returned by |
| | | onSave. During loading the object is always inactive. initData is |
| | | the same as in onInit. |
+| | | Note that onLoad means loading a script rather than loading a game.|
+| | | If a script did not exist when a game was saved onLoad will not be |
+| | | called, but onInit will. |
+----------------------------------+----------------------------------------------------------------------+
| onInterfaceOverride(base) | | Called if the current script has an interface and overrides an |
| | | interface (``base``) of another script. |
diff --git a/docs/source/reference/lua-scripting/overview.rst b/docs/source/reference/lua-scripting/overview.rst
index fe8082a1a1..1bfdf33c42 100644
--- a/docs/source/reference/lua-scripting/overview.rst
+++ b/docs/source/reference/lua-scripting/overview.rst
@@ -251,8 +251,8 @@ The value that `onSave` returns will be passed to `onLoad` when the game is load
It is the only way to save the internal state of a script. All other script variables will be lost after closing the game.
The saved state must be :ref:`serializable <Serializable data>`.
-Note that `onLoad` means loading a script rather than loading a game. During loading a game `onLoad` works only for the scripts that were already existed when the game was saved (i.e. present in the save file).
-If a completely new script was started (for example if it is a script of a newly installed mod) then the `onInit` handler is used even if it happened when loading a saved game.
+Note that `onLoad` means loading a script rather than loading a game.
+If a script did not exist when a game was saved then `onLoad` will not be called, but `onInit` will.
`onSave` and `onLoad` can be called even for objects in inactive state, so it shouldn't use `openmw.nearby`.