API

The command, shortcuts, pause menu event, replaceable functions, Discord log, scene files and database tables of the Scene Director.

The Scene Director is an editor that players use in the game, so it offers no exports and no custom events that other scripts must call. This page lists everything you can use or adapt around it: the command and the key commands, the pause menu event that the editor triggers, the functions in cl_config.lua that connect it to your clothing and weather scripts, the Discord log, the scene files and the database tables.

Only the groups set in MS.Admin in sv_config.lua can open the editor, and only one person can direct at a time. Command names and keys are set in cl_config.lua. Restart the resource after a change.

/director command

Opens and closes the editor. The name is MS.Director.command in cl_config.lua, and a default key can be set in MS.Director.key. Without a default key every player binds one under Settings, Key Bindings, FiveM. If someone else is already directing, the player gets the in-use message. Without permission the player gets the no-permission message, and the refusal can be logged to Discord.

commandstringrequired

The word after the slash that opens and closes the editor. Rename it in MS.Director.command.

keystringrequired

A default key for the same action, for example F5. Empty means no key is bound.

Key commands

Every shortcut of the editor is a registered command with a key mapping, so players see it under Settings, Key Bindings, FiveM and can rebind it. The commands and default keys are the entries of MS.Keys in cl_config.lua. Typing in a field never triggers a shortcut.

director_ commandscommandrequired

One press is one action. The actions are look, help, stop, ground, delete, cancel, nudgeLeft, nudgeRight, nudgeUp, nudgeDown, nudgeRaise, nudgeLower, record, copy, paste, duplicate, undo, redo, play, in, out, event, dock, hide, bars, marker, keyframe, cameraView and render, for example director_record or director_render. Copy, paste, duplicate, undo and redo need Ctrl held.

+director_ commandsheld commandrequired

Works while the key is held, with a - command that is called on release. The actions are gizmo, space, select (a mouse button), lower, raise, frameBack and frameForward, for example +director_gizmo. frameBack and frameForward repeat while held; with Ctrl they jump to the previous or next mark.

Pause menu event

When the editor opens, the Scene Director triggers the client event more_lib::client:pauseMenu with true. When it closes the event is triggered with false. HUD scripts that listen to this event of more_lib hide themselves while the editor is open, which is why QBCore needs more_hud. If another HUD or script stays on the screen, let it listen to the same event, or hide it with the U key that hides the editor surface.

pausedbooleanrequired

true when the editor opens, false when it closes.

scopelocal client eventrequired

It is triggered only on the client of the player who directs. Other players do not receive it.

Functions you can adapt (cl_config.lua)

These client functions are the places where the Scene Director meets other scripts. Their default bodies work with illenium-appearance, qb-weathersync, cd_easytime and the animation list of the resource. If you use other scripts, replace the body of the function and keep its parameters and the kind of value it returns. The other settings are on the Configuration page.

MS.GetAppearance(ped)returns tablerequired

Returns the look of a ped, stored as it is (at most 16 KB as JSON). Uses illenium-appearance when it is started, otherwise the clothes, props and freemode face of the ped itself.

MS.SetAppearance(ped, look)no returnrequired

Puts a look from MS.GetAppearance or the editor on a ped. Replace it together with GetAppearance when you use another clothing script.

MS.OpenAppearanceEditor(ped, onDone)calls onDonerequired

Opens the clothing editor for an actor and calls onDone(look) with the new look, or onDone(nil) when the player cancels. Without illenium-appearance it calls onDone(nil, true), which tells the editor that no clothing editor is available.

MS.GetPlayerAnim(ped)returns table or nildefault

Returns the animation the ped plays now as dict, clip and flags, so an emote can be recorded in a take. By default it checks every animation in MS.Animations. Replace it if your emote script plays other animations.

MS.PauseWorldSync(paused)no returndefault

Called with true when the editor takes over the weather and the time, and with false when it gives them back. By default it pauses qb-weathersync and cd_easytime. Add your own weather or time script here.

Discord log: MS.DiscordLog

Defined in sv_config.lua and called by the server with the event (open, denied, delete, export or import), the server ID of the player and a detail such as the scene name or the reason for a refusal. It sends a message only when MS.Discord.enabled is true, a webhook is set and the event is switched on in MS.Discord.events. The headlines are in MS.DiscordTitles. Replace the body of the function to send the log to your own log system instead.

Scene files: export and import

A scene can be exported from the editor to a JSON file in the exports folder of more_scenedirector, and a scene can be created from a file in that folder: the export notification names the file, and you type that name in the import dialog. Copy a file to the exports folder of another server to move the scene there. Keep the folder, because FiveM does not create it. Files larger than MS.Export.max_mb are refused (20 MB by default), and an import is also refused when the file is not a Scene Director scene, comes from a newer Scene Director, or holds more entries or takes than a scene may hold.

Database tables

The resource keeps its data in six tables, created by backend/[SQL]/sql.sql: more_scenedirector_scenes (a scene with its name, In and Out frames, markers, camera track and creator), more_scenedirector_entries (the actors, vehicles, props, effects, lights and texts of a scene), more_scenedirector_takes (the takes of a scene), more_scenedirector_tracks (the recorded movement of one entry in one take), more_scenedirector_folders (the folders of the casting library) and more_scenedirector_peds (the saved peds with their look and weapon). Deleting a scene also deletes its entries, takes and tracks. Do not edit these tables by hand. After an update, run the update files in backend/[SQL] (update_ followed by the version) for the versions newer than yours.

Last updated