Vai al contenuto
Timecycle Editor

Timecycle Editor

Edit a GTA V timecycle modifier parameter by parameter in the browser, see it on the real Los Santos world, and download a FiveM resource that ships it.

Per ora questa documentazione è in inglese.

Open the tool Last updated

The Timecycle Editor builds one timecycle modifier: the thing SetTimecycleModifier takes. You start from one of the game’s own 1,101 modifiers or from an empty one, move the values, watch the real Los Santos world change, and download a resource you can drop into resources.

Quick start

  1. On the Start tab, search for a modifier close to what you want and click it. underwater, NG_filmic01 and the hud_ ones are good places to begin. Or press Empty modifier to build from nothing.
  2. On Parameters, use the search box to find what you want to change, and drag.
  3. Hold the Hold to compare button under the preview to see the world without the modifier.
  4. On Diff, check what you actually changed against the vanilla modifier.
  5. On Export, set the name and press Download.
  6. Unzip into resources, add ensure <your resource> to server.cfg, restart, and rejoin.

The tabs

Start

Three ways in.

  • Search the game’s 1,101 modifiers. Click one to copy it. The name you get is fivemad_<the original>, so you never overwrite a vanilla modifier by accident. Change it to the original name if overwriting is what you want.
  • Empty modifier. No parameters at all. Add them from the search box on the Parameters tab.
  • Open a file. Any timecycle_mods XML, including one from another mod or an older version of your own server. Every modifier in the file is listed and you pick one. The file is read in your browser and never uploaded.

The arrow next to a modifier opens it in the Screen Effects Browser, which has a rendered before and after of every one of them.

Parameters

One row per parameter the modifier sets, grouped the way the game groups them: lighting, fog and haze, tone mapping, colour grade, screen effects, blur and depth of field, shadows and occlusion, reflections, water, night vision, detail and streaming, weather and particles.

  • The control fits the parameter. A colour is one swatch that writes the three _r _g _b parameters together, with its _a as a separate slider underneath. A parameter the game only ever writes as 0 or 1 gets a switch. Everything else gets a slider.
  • The slider range is the range the game itself uses. It runs from the smallest to the largest value any of the 1,101 stock modifiers writes for that parameter, widened to take in zero and the value the base timecycle already holds. The three numbers under a slider are that minimum, the base value and that maximum. You can always type a value outside the range in the box.
  • base under a slider is what the game’s clear weather cycle holds at noon. A parameter you set to its base value changes nothing at noon on a clear day.
  • (not drawn) next to a parameter means the preview has nothing to show for it. It is still written into the file. Tick Only what the preview draws to hide those while you are working on the look.
  • The amber dot means that parameter differs from the modifier you copied.
  • The bin icon removes a parameter from the modifier. Removing is not the same as setting it to zero: a modifier only overrides what it lists.
  • Typing in the search box also offers parameters this modifier does not set, under “Not set by this modifier”. Press Add and it starts at its base value.

Diff

What you changed against the modifier you copied, split into changed, added and removed, with the old and new value side by side. This is the list worth reading before you ship, and the list to paste when somebody asks what your look does.

A modifier built from nothing has no vanilla to compare with, so everything shows as new.

Export

  • Modifier name is what SetTimecycleModifier takes. Letters, digits and underscore, 2 to 128 characters.
  • Resource folder is the folder name in resources.
  • How it reaches the game is the important choice. See below.
  • Slot: the main slot is one modifier at a time. The extra slot (SetExtraTimecycleModifier) stacks on top of whatever is already running, which is how the game layers things like a tunnel on top of a weather look.
  • When it is applied: on resource start, on a chat command, or only when another resource calls the export.
  • Strength is SetTimecycleModifierStrength. It blends the whole modifier back towards the plain look, and the preview follows it. 0 to 1 is what everyone uses and what the preview assumes, but the native’s range is not actually documented.
  • Fade in switches the generated code to SetTransitionTimecycleModifier, which eases into the modifier instead of snapping to it, and SetTransitionOutOfTimecycleModifier to leave. Main slot only: there is no transition native for the extra slot. The unit of that second argument is not documented either (the Cfx reference guesses at half seconds and says so), so check it in game.
  • userFlags is an integer the file carries per modifier. The game’s own files use 0, 1, 2, 4, 6, 8 and 16.

Streamed file or built in code

Both work. They fail differently, which is why the choice is yours.

Streamed file

The resource carries a timecycle_mods XML and a data_file 'TIMECYCLEMOD_FILE' line that mounts it. This is the same route the game’s own DLC packs use, so from then on your modifier is part of the game’s set like any other.

  • Anything can call it by name, including resources that started before yours.
  • Mounted files merge. They do not replace the set. The game proves this itself: mpchristmas2017 ships 391 modifiers and update.rpf ships 647, and the 259 names only update.rpf has keep working after the DLC mounts.
  • It survives a client reconnect, because the file mounts again on every join.
  • Give your modifier its own name. Which copy wins when two mounted files use the same name is not documented, so overriding a vanilla name is not something to build on.
  • A data file only mounts when a client connects, so players already on the server will not have it until they rejoin.

Built in code

No data file. If you started from a vanilla modifier the script clones it with CloneTimecycleModifier and writes only what you changed, which turns a 115 parameter copy into three lines. Otherwise it calls CreateTimecycleModifier and writes every parameter with SetTimecycleModifierVar.

  • Live on an ensure, no rejoin.
  • Easy to change: restart the resource and the new values are in.
  • It survives a resource restart but not a disconnect: FiveM throws away every runtime modifier when the client leaves a server, so the script has to run again on each join. The generated script does that for you.
  • It only exists on clients that ran the script.
  • Anything that looks the name up before your script runs will not find it.

If you are not sure, take the streamed file. If you are iterating on a live server, take the code one while you work and switch at the end.

One thing you cannot do either way

You cannot invent a variable name. The game keeps its own table of timecycle variables and rejects anything that is not in it, so the parameter list here is the list you get. GetTimecycleVarCount and GetTimecycleVarNameByIndex print the real table on a running client, and the Export tab has that snippet ready.

The two floats

Every parameter in a timecycle_mods file holds two numbers, not one:

XML
<light_dir_col_r>0.004 0.900</light_dir_col_r>

The first is the value. It is what this page draws, what the Screen Effects Browser shows and what every guide means when it talks about a parameter’s value.

The second is not documented anywhere. Not in the game files, not in the Cfx native reference (which only says “the second value of variable”), not in the FiveM source, whose header comments every other field of the structure and leaves m_value1 and m_value2 bare. This page does not invent a meaning for it. It carries the number through untouched, so a modifier you open and save comes back out the same.

Turn on Second float above the parameter list if you need to edit it. When you add a parameter it starts at the number the game’s own modifiers use most often for that one.

What is measurable, over all 1,101 stock modifiers:

  • 66.9% of entries have it at exactly 0, 27.1% at exactly 1. Only 6% are anything else.
  • 253 of the 325 parameters the stock modifiers use have it at 0 in every modifier that sets them.
  • For every one of the 3,462 colour triples in the game’s files the three channels carry the same second float, while the first floats differ in three quarters of them. So it is never a second colour.
  • A handful of fog parameters and far_clip carry a real second number in their own units, usually equal to the first.

SetTimecycleModifierVar takes both floats, so the generated code carries both as well.

What the preview shows

The 3D view is the real Los Santos world with the same screen pass the Screen Effects Browser renders its previews with. It moves for light direction and colour, ambient and interior light, fog and haze, the far clip, exposure, the filmic tone map, colour correction and shift, desaturation, the colour gradient, vignette, noise, scanlines, chromatic aberration, lens distortion, bloom, depth of field and the night vision block.

It does not move for shadows, SSAO, reflections, water, heat haze, god rays, lens flares, sun and moon direction, motion blur, streaming distances or the weather and particle switches.

It is an approximation, not the game’s renderer. Judge the broad strokes here and check the fine ones in game.

Things worth knowing

  • A modifier is an override list, not a whole look. It only touches the parameters it lists, on top of whatever the weather and the time of day already give you. A look that reads well at noon can read badly at 3am because the base underneath it moved.
  • Test at more than one time of day. SetTimecycleModifier does not pin the clock.
  • The main slot holds one. If another resource sets a modifier, the last call wins. Use the extra slot, or PushTimecycleModifier and PopTimecycleModifier around a short scene so whatever was running comes back.
  • Strength is not a fade. It blends every parameter at once and stays where you put it. Use the Fade in setting if you want an ease, which is a different native.
  • Do not point RemoveTimecycleModifier at a vanilla name. It has no guard, and a game modifier deleted that way is not restored until the player reconnects.
  • Removing a parameter is a real edit. A parameter the modifier does not list is left at whatever the timecycle already had, which is usually what you want for the ones you never meant to touch.
  • Colours are 0 to 1, not 0 to 255. The swatch handles that for you.
  • Your work autosaves in this browser. Copy link puts the whole modifier in the page address as the difference against the vanilla one you started from, so a link stays short. The zip carries that link in its README.
  • Open a modifier directly by putting its name in the address: /tools/timecycle-editor?from=underwater.

What this page will not do

It does not edit the base timecycle, the w_clear.xml family. Those are a different shape: a timecycle_keyframe_data file holding one cycle with two regions, GLOBAL and URBAN, and inside each region 423 parameters that each carry 13 numbers, one per time of day sample with the last repeating the first so the day wraps. That is 10,998 numbers in w_clear.xml alone, and the game ships one file per weather type. Editing curves across every parameter, region and weather is a different tool, and a half built version of it here would be worse than none.

For most of what people want from “the server should look colder”, a modifier is the right answer anyway, and that is what this page builds.

It also does not preview animpostfx effects, which are timed stacks of modifiers rather than modifiers themselves. The Screen Effects Browser lists all 252 of those with their layers and timings.