API ReferenceGE ExtensionsscenarioraceMarkers
Cylinder Marker
A classic race checkpoint marker consisting of a ground base ring and a tall transparent cylinder. Color-coded by checkpoint type with distance-based alpha fading.
A classic race checkpoint marker consisting of a ground base ring and a tall transparent cylinder. Color-coded by checkpoint type with distance-based alpha fading.
Class API (OOP via metatable)
| Method | Signature | Description |
|---|---|---|
C:init | (id) | Initializes state, colors, fade distances |
C:update | () | Updates alpha based on camera distance |
C:setToCheckpoint | (wp) | Positions and scales base + cylinder from waypoint |
C:setMode | (mode) | Sets color based on mode, shows/hides |
C:setVisibility | (v) | Shows/hides base and cylinder objects |
C:hide/show | () | Visibility shortcuts |
C:createMarkers | () | Creates base and cylinder TSStatic objects |
C:clearMarkers | () | Destroys all created objects |
C:createObject | (shapeName, objectName) → TSStatic | Helper to create a marker object |
Visual Modes
| Mode | Color | Description |
|---|---|---|
default | Red (1, 0.07, 0) | Standard checkpoint |
next | Gray (0.3, 0.3, 0.3) | Upcoming checkpoint |
start | Green (0.4, 1, 0.2) | Start line |
lap | Green (0.4, 1, 0.2) | Lap boundary |
recovery | Yellow (1, 0.85, 0) | Recovery point |
final | Blue (0.1, 0.3, 1) | Finish line |
branch | Orange (1, 0.6, 0) | Branching path |
Components
| Object | Shape | Scaling |
|---|---|---|
| Base | checkpoint_marker_base.dae | radius × 2 in all axes |
| Cylinder | checkpoint_marker.dae | radius in X/Y, fixed 50 in Z |
Alpha Fading
- Fade near: 0 units (fully visible when close)
- Fade far: 70 units (fully transparent beyond)
- Base alpha: 0.75 × distance factor
- Cylinder alpha: 0.95 × distance factor
- Per-waypoint
fadeNear/fadeFaroverrides supported
How It Works
- Constructor creates instance with default mode colors
createMarkers()spawns base ring and tall cylinder TSStatic objectssetToCheckpoint(wp)positions both at waypoint, scales by radiussetMode(mode)applies the mode's color tocurrentColorand updates visibilityupdate()each frame:- Calculates 3D distance from camera to marker center
- Applies inverse lerp for smooth alpha fade
- Updates instance color render data on both objects
Usage Examples
-- Create a cylinder checkpoint marker
local marker = require('scenario/raceMarkers/cylinderMarker')(1)
marker:createMarkers()
marker:setToCheckpoint({
pos = vec3(100, 200, 50),
radius = 5,
})
marker:setMode('default') -- red checkpoint
-- Each frame
marker:update()
-- Change to finish mode
marker:setMode('final') -- turns blue
-- Cleanup
marker:clearMarkers()Key Notes
- Simplest of the race marker types - just base + cylinder, no animation
- Cylinder height is fixed at 50 units regardless of radius
- Mode colors are deep-copied per instance, allowing per-marker customization
- Uses
inverseLerpfor smooth distance-based fading - Objects added to
ScenarioObjectsGroupwithcanSave = false - No bobbing, no LOS checks - purely visual with alpha fade
See Also
- Race Marker: Attention - Floating Arrow Checkpoint Marker - Related reference
- Race Marker: Crawl Marker - Arrow + Flag + Column Checkpoint - Related reference
- None Marker - Invisible Race Checkpoint Marker - Related reference
- Scenario System Guide - Guide
Crawl Marker
A feature-rich race checkpoint marker with a floating arrow, two roadside flags, and a distant visibility column. Supports multiple color modes, fade distances, line-of-sight occlusion avoidance, and
None Marker
A no-op race marker implementation. All methods exist but do nothing, making checkpoints completely invisible. Used when no visual marker is desired.