RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage
Directional GravityGet Cloud by IDGet FogGet GravityGet PauseGet PhotomodeGet ScatterSkyGet Time of DayPause GamePlanetRandom Time of DayBullet TimeSet Cloud by ID NodeSet Fog NodeSet Gravity NodeSet ScatterSky NodeSet Time of Day NodeSet Wind NodeSimple Planet Node

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsflowgraphnodesenvironment

Random Time of Day

- **File:** `extensions/flowgraph/nodes/environment/randomTimeOfDay.lua`

Overview

  • File: extensions/flowgraph/nodes/environment/randomTimeOfDay.lua
  • Name: Random Time of Day
  • Category: repeat_instant
  • Description: Generates a random time of day between two specified hours, outputting both a numeric value and formatted string.

Pin Schema

Input Pins

NameTypeDescription
fromHournumberStarting hour (0–23). Default: 9. Hardcoded. Slider.
toHournumberEnding hour (0–23). Default: 17. Hardcoded. Slider.
use24HourboolIf true, formats as 24-hour (HH
). If false, 12-hour with AM/PM. Default: false.

Output Pins

NameTypeDescription
timenumberTime of day on a 0–1 scale. 0.5 is midnight.
timeStringstringFormatted time string (e.g., "2
PM" or "14
").

Behavior

  • work(): Clamps input hours to 0–23. Converts hours to BeamNG's 0–1 time scale (offset by 0.5 so midnight = 0.5). Generates a uniformly random time in the specified range. Handles wrap-around (e.g., 22
    to 02
    ). Outputs both numeric and string representations.

Time Conversion

  • BeamNG time-of-day: 0 and 1 = noon, 0.5 = midnight.
  • Hour-to-TOD formula: (hour / 24 + 0.5) % 1

Notes

  • Supports wrap-around ranges (e.g., fromHour=22, toHour=6 spans midnight).
  • Both hour inputs have integer slider gizmos (0–23).

Tags

#flowgraph #node #ge #environment #timeofday #random


Additional Exports

postInit()

  • name - string - (see source)

  • icon - string - (see source)

  • description - string - (see source)

  • category - string - (see source)

  • pinSchema - table - (see source)

  • tags - table - (see source)


See Also

  • Directional Gravity - Related reference
  • Get Cloud by ID - Related reference
  • Get Fog - Related reference
  • FlowGraph Guide - Guide

Planet

- **File:** `extensions/flowgraph/nodes/environment/planet.lua`

Bullet Time

- **File:** `extensions/flowgraph/nodes/environment/setBulletTime.lua`

On this page

OverviewPin SchemaInput PinsOutput PinsBehaviorTime ConversionNotesTagsAdditional ExportspostInit()See Also