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
| Name | Type | Description |
|---|---|---|
| cinematic | cinematic | The cinematic. |
| world | table | A 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 }, withhourfrom 0 up to 24 andminuteoptional.fades:{ time, opacity, red, green, blue }, withopacityfrom 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 },
},
})