API ReferenceGE ExtensionsgameplaydriftstuntZones
Donut Zone
Reference for the donut stunt zone class, loaded via `require("gameplay/drift/stuntZones/donut")`.
Reference for the donut stunt zone class, loaded via require("gameplay/drift/stuntZones/donut").
Overview
A circular zone where the player must accumulate 360° of drift angle while inside the circle. Returns a class factory function (not a module with M exports).
Factory
-- Returns a constructor function:
return function(data) → donutInstanceClass Methods
| Method | Signature | Description |
|---|---|---|
init | (data) | Stores zone data, calls reset |
reset | () | Resets activeData: cooldown=0, totalDriftAngle=0, completedPerc=0 |
accomplish | () | Resets angle, sets cooldown, fires onAnyStuntZoneAccomplished → onDonutDriftAccomplished |
detectStunt | () | Accumulates angleDiff from drift system; accomplishes at ≥360° |
isAvailable | () | Returns currCooldown <= 0 |
isPlayerInside | () | Distance check: vehPos:distance(pos) < scl; resets angle if outside |
onUpdate | () | Calls sendDecals |
sendDecals | () | Draws circular decal ring showing cooldown/fill progress |
Key Behaviors
- Circle is drawn with
scl * 10decal segments - Decal colors reflect state: green (ready), blue (filling), red (cooldown), white (cooldown remaining)
- Angle accumulation resets when player leaves the circle or drift ends
See Also
- drift/stuntZones/driftThrough - Drift-Through Stunt Zone - Related reference
- drift/stuntZones/hitPole - Hit Pole Stunt Zone - Related reference
- drift/stuntZones/nearPole - Near Pole Stunt Zone - Related reference
- Gameplay Systems Guide - Guide
Freeroam Drift Spots
Reference for `gameplay_drift_freeroam_driftSpots`, which manages freeroam drift zones - detecting when the player drifts through a start line, running the challenge, tracking scores/highscores, and i
Drift Through Zone
Reference for the drift-through stunt zone class, loaded via `require("gameplay/drift/stuntZones/driftThrough")`.