For the complete documentation index, see llms.txt. This page is also available as Markdown.

Events & Exports

Server event hooks

Two public hooks fire on the server. Handlers written for older versions keep working unchanged; the names and payloads are the same.

rm_scenes:server:onSceneCreated fires when a scene is saved, and when one is copied.

AddEventHandler('rm_scenes:server:onSceneCreated', function(data)
    -- data.creatorId         number  server id of the creator
    -- data.creatorIdentifier string  identifier of the creator
    -- data.creatorName       string  name of the creator
    -- data.coords            vector3 scene position
end)

rm_scenes:server:onSceneDeleted fires when a scene is deleted from the list, bulk-deleted by an admin, or absorbed by a merge.

AddEventHandler('rm_scenes:server:onSceneDeleted', function(data)
    -- data.deleterId         number  server id of who removed it
    -- data.creatorIdentifier string  identifier of the scene's creator
    -- data.creatorName       string  name of the scene's creator
    -- data.coords            vector3 scene position
end)

Scenes removed by the automatic cleanups (expiry, deleteUnseenAfter) are pruned directly in the database at resource start and do not fire the hook.

Server exports

Both commands can be disabled (cfg.commands.create/list = false) and replaced with these, wired to an item, a menu or a job script:

openSceneCreation runs the same authorization and scene-limit checks as the command.

Discord logging

Scene creations and copies route through rm_scenes/server/discord_log.lua, an open file you can rewrite entirely. Logging is off by default: set enabled = true and your webhook URL in the file's config to turn it on, and shape the embed however you like.

The default logger attaches the scene's drawing to every creation embed, so moderators see what was drawn without joining, and lists the creator, coordinates and the picked duration. Drop the image field from the entry in discord_log.lua if you'd rather keep the logs text-only.

Last updated