Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/doc/lua
diff options
context:
space:
mode:
authorBottinator22 <59987380+Bottinator22@users.noreply.github.com>2025-02-08 13:07:01 -0800
committerGitHub <noreply@github.com>2025-02-08 13:07:01 -0800
commitbc335eb7aa391069c8e4c6ce30b54384c7261b47 (patch)
tree05d461eaecf3aba09c79f1ed192d5833d08f390e /doc/lua
parent8725f816c301a9222db1f516d3ad9a177111e977 (diff)
oSB world lua bindings in their own file (also, docs for world.callScriptContext)
Diffstat (limited to 'doc/lua')
-rw-r--r--doc/lua/openstarbound/world.md67
1 files changed, 67 insertions, 0 deletions
diff --git a/doc/lua/openstarbound/world.md b/doc/lua/openstarbound/world.md
new file mode 100644
index 0000000..b233e97
--- /dev/null
+++ b/doc/lua/openstarbound/world.md
@@ -0,0 +1,67 @@
+# World
+
+The world table now contains extra bindings.
+
+---
+
+#### `bool` world.isServer()
+
+Returns whether the script is running on the server or client.
+
+---
+
+#### `bool` world.isClient()
+
+Returns whether the script is running on the server or client.
+
+---
+
+The following additional world bindings are available only for scripts running on the client.
+
+---
+
+#### `entityId` world.mainPlayer()
+
+Returns the entity ID of the player hosting the world.
+
+---
+
+#### `Vec2F` world.entityAimPosition(`entityId` entityId)
+
+Returns the current cursor aim position of the specified entity.
+
+---
+
+#### `bool` world.inWorld()
+
+Returns whether any players are in the world.
+
+---
+
+The following additional world bindings are available only for scripts running on the server.
+
+---
+
+#### `void` world.setExpiryTime(`float` expiryTime)
+
+Sets the amount of time to persist a ephemeral world when it is inactive.
+
+---
+
+#### `string` world.id()
+
+Returns a `String` representation of the world's id.
+
+---
+
+#### `Maybe<LuaValue>` world.callScriptContext(`String` contextName, `String` function, `String` contextName, [LuaValue args ...])
+
+Calls a function in the specified world script context.
+
+---
+
+#### `?` world.sendPacket(`?` ?)
+
+?
+
+---