API Reference GE Extensions flowgraph nodes util Load Level (Flowgraph Node) - **Node Name:** `Load Level`
Node Name: Load Level
Category: (custom state machine)
File: extensions/flowgraph/nodes/util/loadLevel.lua
Loads a level by path. The path is relative to levels/ and automatically appends /info.json. Supports optional vehicle model/config spawning and custom loading screens.
Pin Type Description flowflow Inflow trigger levelPathstring Path relative to levels/ (e.g., gridmap_v2) modelstring (hidden) Spawn with a specific vehicle model configstring (hidden) Spawn with a specific vehicle config
Pin Type Description flowflow Fires when level loading is complete
Method Description init()Sets defaults: prevent player spawning, force level load, no custom loading screen _executionStarted()Resets state machine to state 1 postInit()Populates level path dropdown with getAllLevelIdentifiers() onLoadingScreenFadeout(missionFile)Callback when loading screen fades; transitions to state 3 work()Runs the state machine each frame drawMiddle(builder, style)Shows current state number
State Description 1 Check - if level already loaded (and not forcing), skip to state 4. Otherwise start loading (state 2).2 Loading - core_levels.startLevel() has been called; waiting for completion callback.3 Buffer - loading done, counts down delayBufferFrames, then fires hooks and transitions to 4.4 Complete - sets flow output to true.
Property Default Description preventPlayerSpawningtruePrevents automatic player vehicle spawn forceLevelLoadtrueForces reload even if the level is already loaded delayBufferFrames0Extra frames to wait after loading before completing stopRunningOnClientEndMissionfalseWhether to stop the flowgraph when the mission ends noLoadInEdittrueSkip loading when in editor mode customLoadingScreenfalseIf true, uses a delayed callback so you can manually hide the loading screen
State 1: Checks if the requested level is already the active mission. If so (and not forcing), jumps to complete. Otherwise calls core_levels.startLevel().
When customLoadingScreen is enabled, a callback is passed to startLevel() that transitions to state 3 instead of auto-fading.
State 3: Waits for delayBufferFrames countdown, then fires onClientPostStartMission and onClientStartMission hooks, calls map.assureLoad(), and moves to state 4.
Optionally spawns a vehicle with the specified model/config via sanitizeVehicleSpawnOptions().
-- Simple level load:
-- [Button] → flow → [Load Level] levelPath="west_coast_usa"
-- → flow → [Spawn Vehicle]
-- Custom loading screen workflow:
-- [Load Level] levelPath="italy" customLoadingScreen=true
-- → (waits for manual hide)
-- [Do Setup] → [Hide Loading Screen] → finished → [Continue]
core_levels.startLevel() - engine function to load a level
getMissionFilename() - returns the current level's mission file
getAllLevelIdentifiers() - lists available levels
spawn.preventPlayerSpawning - controls automatic vehicle spawning
map.assureLoad() - ensures map data is refreshed after level switch