Developer
Overview
ML MasterVideo provides client exports for accessing scene data and controlling the HUD, server exports for initialization status, and handler hooks in the open/ folder.
Client Exports
lua
1local sceneManager = exports.ml_mastervideo:GetSceneManager()
2local playback = exports.ml_mastervideo:GetPlaybackModule()
3local scene = exports.ml_mastervideo:GetSceneById(sceneId)
4local current = exports.ml_mastervideo:GetCurrentSceneData()
5local synced = exports.ml_mastervideo:GetSyncedScenesModule()
6exports.ml_mastervideo:SetHudActive(false)
7local active = exports.ml_mastervideo:IsHudActive()GetSceneManager(): Returns the SceneManager module for direct entity controlGetPlaybackModule(): Returns the Playback module for starting scenes programmaticallyGetSceneById(sceneId): Returns scene data by IDGetCurrentSceneData(): Returns the currently loaded sceneGetSyncedScenesModule(): Returns the SyncedScenes moduleSetHudActive(active): Show/hide the editor HUDIsHudActive(): Returnstrueif the HUD is visible
Server Exports
lua
1local ready = exports.ml_mastervideo:IsInitialized()
2local count = exports.ml_mastervideo:GetSceneCount()IsInitialized(): Returnstruewhen the database is readyGetSceneCount(): Returns the number of stored scenes
Server Handlers
Located in open/server.lua.
open/server.lua
1function OpenServer.BeforeGiveItem(src, item, amount)
2 return true
3end
4
5function OpenServer.OnActionComplete(src, actionType, data)
6endClient Handlers
Located in open/client.lua.
open/client.lua
1function OpenClient.BeforeOpenUI(data)
2 return true -- return false to block
3end
4
5function OpenClient.Notify(message, type)
6 Bridge.Notify(message, type)
7endShared Handlers
Located in open/shared.lua.
open/shared.lua
1function OpenHandlers.OnPlayerAction(src, data)
2 return true
3end
4
5function OpenHandlers.ValidateAction(src, actionType)
6 return true
7endScene Data Structure
Each scene contains entities, camera tracks, and a timeline:
- Entities: Peds, vehicles, and props with position, appearance, and behavior (idle, animation, scenario, driving, recorded path)
- Camera Tracks: Named tracks with keyframes (position, rotation, FOV, interpolation mode: linear/smooth/ease_in_out)
- Timeline: Clips per entity with start time, duration, animation/scenario/recording references
Examples
your_script/client.lua
1local playback = exports.ml_mastervideo:GetPlaybackModule()
2playback.StartScene('my_scene_id', { countdown = 0 })your_script/client.lua
1exports.ml_mastervideo:SetHudActive(false)
2-- ... run cutscene ...
3exports.ml_mastervideo:SetHudActive(true)