M MY Multiplayer: Wiki
Side
Kind

setCinematicWorld

Client

Sets the weather, hour and screen fade keys the cinematic applies during playback. It replaces the earlier keys.

bool setCinematicWorld(cinematic cinematic, table world)

Parameters

NameTypeDescription
cinematiccinematicThe cinematic.
worldtableA table with the weather, clock and fades lists, all optional.

Returns

true if they were applied. false if the table is invalid, with a warning saying why.

Each list goes in order of time, the cinematic time in ms, required in every key:

  • weather: { time, name }, with a weather's name.
  • clock: { time, hour, minute }, with hour from 0 up to 24 and minute optional.
  • fades: { time, opacity, red, green, blue }, with opacity from 0 to 1 and the colour from 0 to 255, black by default.

When playback ends, the weather, hour and fade go back to what the world had.

Example

local intro = createCinematic("cinematics/intro.cine")
setCinematicWorld(intro, {
    clock = { { time = 0, hour = 19, minute = 30 } },
    fades = {
        { time = 0, opacity = 1 },
        { time = 1500, opacity = 0 },
    },
})

See also