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

summaryrefslogtreecommitdiff
path: root/doc/lua/message.md
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /doc/lua/message.md
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'doc/lua/message.md')
-rw-r--r--doc/lua/message.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/lua/message.md b/doc/lua/message.md
new file mode 100644
index 0000000..46262f3
--- /dev/null
+++ b/doc/lua/message.md
@@ -0,0 +1,21 @@
+The message table contains a single function, setHandler, which allows entities to receive messages sent using world.sendEntityMessage. Entities which can receive messages include:
+
+* monster
+* NPC
+* object
+* vehicle
+* stagehand
+* projectile
+
+Additionally, messages can be handled by a variety of script contexts that run on the player:
+
+* activeitem
+* quest
+* playercompanions
+* status
+
+---
+
+#### `void` message.setHandler(`String` messageName, `LuaFunction` handler)
+
+Messages of the specified message type received by this script context will call the specified function. The first two arguments passed to the handler function will be the `String` messageName and a `bool` indicating whether the message is from a local entity, followed by any arguments sent with the message.