update doc/*/scripting/builtins/libapp.md

This commit is contained in:
MihailRis 2026-08-02 18:27:19 +03:00
parent 8de3c0de57
commit 466f515ea9
2 changed files with 35 additions and 1 deletions

View file

@ -191,3 +191,20 @@ app.reset_content_sources()
```
Resets content sources.
## Sub-instances
```lua
-- Creates a headless engine instance with the current project and the specified application script.
-- Returns the instance ID. The number of active sub-instances is currently limited to one.
app.start_background_instance(
-- script file
app_script: string,
-- log file
output_file: string | nil
) -> int
-- Stops the engine sub-instance.
-- Returns true if the instance was alive at the time of the call.
app.terminate(handle: int) -> boolean
```

View file

@ -142,4 +142,21 @@ app.set_content_sources(sources: table<string>)
-- Сбрасывает список источников контента.
app.reset_content_sources()
```
```
## Под-экземпляры
```lua
-- Создаёт headless-экземпляр движка с текущим проектом и указанным сценарием.
-- Возвращает id экземпляра. Число живых под-экземпляров, на данный момент, ограничено одним.
app.start_background_instance(
-- файл сценария
app_script: string,
-- файл лога
output_file: string | nil
) -> int
-- Останавливает под-экземпляр движка.
-- Возвращает true если экземпляр был жив в момент вызова.
app.terminate(handle: int) -> boolean
```