Crawl Flowgraph Bridge
Reference for `gameplay_crawl_flowgraphBridge`, the current bridge between the crawl system and flowgraph nodes. Exposes crawl lifecycle operations for mission flowgraphs.
Reference for gameplay_crawl_flowgraphBridge, the current bridge between the crawl system and flowgraph nodes. Exposes crawl lifecycle operations for mission flowgraphs.
Overview
This is the updated flowgraph bridge (vs. crawlFlowgraphBridge). Instead of maintaining its own state, it delegates to gameplay_crawl_general and gameplay_crawl_utils directly, querying the active crawler from shared state.
Dependencies
gameplay_crawl_saveSystem, gameplay_crawl_general, gameplay_crawl_utils, gameplay_crawl_boundary, gameplay_crawl_display
Exports
| Function | Signature | Description |
|------
| M.dependencies | table | { 'gameplay_crawl_saveSystem', 'gameplay_crawl_general', 'gameplay_crawl_utils', |----|-----------|-------------|
| loadCrawlTrail | (trailId) | Load a trail by ID |
| setupCrawl | (vehicleId, trail) | Setup crawl without starting (calls general.setupCrawl) |
| startCrawl | (vehicleId, trail) | Start or resume a crawl |
| stopCrawl | () | Stop the active crawl |
| resetCrawl | () | Reset crawler position and data |
| getCrawlEndData | () | Get completion data |
| getCrawlRuntimeData | () | Get live state data |
| getTrailInfo | (trailId) | Get trail metadata |
| isCrawlActive | () | Check if crawl is active |
| getActiveCrawlerId | () | Get active crawler vehicle ID |
| getAllTrails | () | List all trails |
| getAllStartingPositions | () | List all starting positions |
| getPlayerTrailStats | (trailId) | Get player's best scores |
| getDynamicObjectsFromPrefab | (prefabId, dynamicName) | Find dynamic objects |
| applyPenalty | (penaltyType) | Apply a penalty to the active crawler |
| getPenaltyTypes | () | Get available penalty type names |
| getLastRecoveryCheckpoint | () | Get last recovery checkpoint data |
| getLastRecoveryCheckpointIndex | () | Get last recovery checkpoint index |
| setRecoveryCheckpoint | (checkpoint) | Set a manual recovery checkpoint |
| cleanup | () | Stop crawl and clear state |
Key Differences from crawlFlowgraphBridge
| Feature | crawlFlowgraphBridge | flowgraphBridge |
|---|---|---|
| State management | Internal bridgeState | Delegates to general.activeTrail |
| Active crawler | Tracked internally | Queried from utils.getAllCrawlStates() |
| Setup/Start | Combined in configureCrawl+startCrawl | Separate setupCrawl and startCrawl |
| Resume support | No | Yes - resumes paused timer |
How It Works
-- Two-step setup: configure then start
local trail = gameplay_crawl_flowgraphBridge.loadCrawlTrail(trailId)
gameplay_crawl_flowgraphBridge.setupCrawl(vehicleId, trail)
gameplay_crawl_flowgraphBridge.startCrawl(vehicleId, trail)
-- Query live state
local data = gameplay_crawl_flowgraphBridge.getCrawlRuntimeData()
-- data.currentTime, data.points, data.isCompleted, etc.
-- Stop and cleanup
gameplay_crawl_flowgraphBridge.cleanup()Start Crawl Logic
startCrawl has three paths:
- Resume - If an active crawl exists but hasn't started its timer, resume it
- Continue - If no trail provided but
general.activeTrailexists, use that - Fresh start - Setup and start a new crawl via
general.startCrawlFlowgraph
Key Behaviors
getActiveCrawlerId()finds the first active crawler ingetAllCrawlStates()resetCrawl()teleports the vehicle to the starting position and clears state- If a crawl is already active when
setupCrawlis called, the existing crawl is stopped first - Hooks into
onCrawlStarted,onCrawlResultsShown,onCrawlPathnodeReached(currently no-op)
Module Variables
| Variable | Type | Description |
|---|---|---|
M.dependencies | table | { 'gameplay_crawl_saveSystem', 'gameplay_crawl_general', 'gameplay_crawl_utils', |
M.applyPenalty | (penaltyType) | - |
M.cleanup | () | - |
M.getActiveCrawlerId | () | - |
M.getAllStartingPositions | () | - |
M.getAllTrails | () | - |
M.getCrawlEndData | () | - |
M.getCrawlRuntimeData | () | - |
M.getDynamicObjectsFromPrefab | (prefabId, dynamicName) | - |
M.getLastRecoveryCheckpoint | () | - |
M.getLastRecoveryCheckpointIndex | () | - |
M.getPenaltyTypes | () | - |
M.getPlayerTrailStats | (trailId) | - |
M.getTrailInfo | (trailId) | - |
M.isCrawlActive | () | - |
M.loadCrawlTrail | (trailId) | - |
M.onCrawlPathnodeReached | (eventData) | - |
M.onCrawlResultsShown | (eventData) | - |
M.onCrawlStarted | () | - |
M.resetCrawl | () | - |
M.setRecoveryCheckpoint | (checkpoint) | - |
M.setupCrawl | (vehicleId, trail) | - |
M.startCrawl | (vehicleId, trail) | - |
M.stopCrawl | () | - |
See Also
- crawl/boundary - Crawl Boundary System - Related reference
- crawl/crawlFlowgraphBridge - Crawl Flowgraph Bridge (Legacy) - Related reference
- crawl/debug - Crawl Debug Window - Related reference
- Gameplay Systems Guide - Guide
Crawl UI Display
Reference for `gameplay_crawl_display`, which provides UI message functions for the crawl (rock crawling) system. Handles all player-facing notifications during crawl gameplay.
Crawl System
Reference for `gameplay_crawl_general`, the main manager for rock crawling trails. Handles trail setup, crawl lifecycle, POI registration, big map integration, activity dialogs, and score persistence.