313 entries found
Declares an event handler. The on keyword prefixes event names to create blocks that execute when the event fires. This is the core of FluxScript event-driven architecture.
on eventName(parameters) { code }
Declares a custom function. Functions are reusable code blocks that accept parameters and optionally return a value. Unlike event handlers (on), functions must be called explicitly.
func name(parameters) { code; return value }
Declares a mutable variable. Variables can be reassigned after declaration. Use var for values that change during gameplay (score, health, position).
var name = value
Declares an immutable constant. Constants cannot be reassigned after declaration. Use const for configuration values, limits, and named numbers that never change.
const NAME = value
Fires a custom event that other scripts can listen for with on event(). This is the primary mechanism for cross-script communication in FluxScript. Events decouple scripts.
emit("eventName"[, data])
Exits a function and optionally sends a value back to the caller. return also exits event handlers early. Use return to short-circuit logic when conditions are not met.
return [value]
Conditional statement that executes a block only if a condition is true. Supports else if and else branches. if is the fundamental control flow construct.
if condition { code } else if condition2 { code } else { code }
Defines the fallback branch of an if statement. Executes when all preceding if and else if conditions are false.
if condition { code } else { fallback code }
Creates a chained conditional. Checks an additional condition only if the preceding if was false.
if c1 { code } else if c2 { code } else { code }
Multi-way branch statement. Compares a value against multiple cases and executes the matching block. More efficient than long else-if chains.
switch value { case v1: { code } case v2: { code } default: { code } }
Loop that iterates a fixed number of times. Counts from a start value to an end value (inclusive).
for var = start to end { code } // or: for var = start to end step increment { code }
Iterates over the keys/elements of an array or dictionary. Cleaner than index-based for loops.
for item in collection { code }
Loop that repeats while a condition is true. Use while for unknown iteration counts. Beware of infinite loops.
while condition { code }
Exits the nearest enclosing loop immediately. Use break when a condition is met and further iteration is unnecessary.
break
Skips the rest of the current loop iteration and jumps to the next.
continue
Pauses execution for a specified duration. wait yields to the game loop, allowing other scripts and rendering to continue.
wait seconds
Boolean literal representing true.
true
Boolean literal representing false.
false
Represents no value. Functions that find objects return null if not found. Always check for null before accessing properties.
null
Assigns a value to a variable.
variable = value
Adds a value to a variable and assigns the result.
variable += value
Subtracts a value from a variable and assigns the result.
variable -= value
Multiplies a variable by a value and assigns the result.
variable *= value
Divides a variable by a value and assigns the result.
variable /= value
Adds two numbers or concatenates two strings. For vectors, adds component-wise.
a + b
Subtracts the second value from the first. For vectors, subtracts component-wise.
a - b
Multiplies two numbers. For vectors, scalar multiplication scales each component.
a * b
Divides the first value by the second. Always check for division by zero.
a / b
Returns the remainder of division. Use for cycling values, even/odd checks, and wrapping.
a % b
Compares two values for equality. Returns true if equal.
a == b
Compares two values for inequality. Returns true if different.
a != b
Returns true if the left value is greater than the right.
a > b
Returns true if the left value is less than the right.
a < b
Returns true if left is greater than or equal to right.
a >= b
Returns true if left is less than or equal to right.
a <= b
Returns true if both operands are true. Short-circuits: if left is false, right is not evaluated.
a && b
Returns true if either operand is true. Short-circuits: if left is true, right is not evaluated.
a || b
Inverts a boolean. true becomes false, false becomes true.
!value
Inline conditional. Returns one of two values based on a condition.
condition ? valueIfTrue : valueIfFalse
Fires once when the scene loads. Use for initialization: setting player stats, spawning objects, starting audio, showing UI.
on start { code }
Fires every frame with delta time (dt). Use for per-frame logic: movement, input, timers, animation updates. This is the most frequently called handler.
on update(dt) { code }
Fires when this object physically collides with another. Provides the other object as a parameter. Use for damage, pickups, and triggers.
on collision(other) { code }
Fires when an object enters a trigger volume (non-physical collider). Use for checkpoints, area detection, and zone entry.
on triggerEnter(other) { code }
Fires when an object leaves a trigger volume. Use for exiting zones, ending area effects.
on triggerExit(other) { code }
Fires when emit() is called with the matching event name. Use for cross-script communication. The data parameter carries the payload sent by emit.
on event("eventName", data) { code }
Fires when a named timer completes. Use timer.start() to schedule. Timers can fire once or repeatedly.
on timer("timerName") { code }
Fires when an animation event triggers. Animation events are markers on the animation timeline that fire at specific frames. Use for syncing sounds and effects to animations.
on animEvent(animName, eventName) { code }
Fires when a UI button is clicked. Provides the button ID. Use for menu navigation, shop purchases, and settings.
on uiClick("buttonId") { code }
Fires when a UI element value changes (sliders, dropdowns, text inputs). Provides the element ID and new value.
on uiChange("elementId", value) { code }
Fires when a network message is received. Use for multiplayer communication between clients and host.
on networkEvent("eventName", data) { code }
Fires when a player joins a multiplayer session. Provides the player object. Use for spawning player avatars and sending initial state.
on playerJoined(player) { code }
Fires when a player leaves a multiplayer session. Use for cleanup: removing avatars, saving state.
on playerLeft(player) { code }
Fires when a specific input is pressed. Provides the input name. Alternative to polling with input() in on update.
on input("key") { code }
Fires when the player's health reaches zero. Use for death effects, respawning, and game-over transitions.
When Player Died { code }
Fires when the player levels up via Add XP. Use for level-up effects, stat increases, and UI notifications.
When Level Up { code }
Fires when a status effect is applied to any entity. Use for visual feedback and status-specific logic.
When Status Effect Added { code }
Fires when a cutscene finishes playing. Use to restore player control and transition back to gameplay.
When Cutscene End { code }
Fires when the day/night cycle transitions. Use for lighting changes, NPC schedules, and ambient audio.
When Day/Night Change { code }
Fires when the weather changes. Use for visual effects, audio, and gameplay adjustments.
When Weather Change { code }
Fires when the score crosses a threshold. Use for milestone notifications and difficulty scaling.
When Score Threshold { code }
Fires when the player's currency changes. Use for shop UI updates and economy tracking.
When Currency Change { code }
Fires when a crafting recipe completes. Use for item creation effects and inventory updates.
When Craft Complete { code }
Fires when a skill is unlocked via skill points. Use for skill tree UI and ability grants.
When Skill Unlocked { code }
Represents numeric values (integers and floats). FluxScript uses 64-bit floating point for all numbers. There is no separate integer type.
var x = 42; var pi = 3.14159; var negative = -10
Represents text. Strings are immutable — operations create new strings. Use double quotes for string literals.
var text = "Hello World"
Represents true or false. Used in conditions, flags, and state tracking.
var flag = true; var isDead = false
Represents a 3D vector (x, y, z). Used for positions, directions, velocities, and forces. The most common type in 3D games.
var pos = vec3(x, y, z)
Represents a 2D vector (x, y). Used for UV coordinates, screen positions, and 2D game mechanics.
var uv = vec2(x, y)
Represents an RGBA color. Values are 0-255 for RGB, 0-1 for alpha. Used for materials, UI, and particle effects.
color(r, g, b[, a])
Ordered collection of values. Arrays are 0-indexed. Use for lists of objects, enemies, items, waypoints.
var arr = [val1, val2, val3]; arr[0] = val1
Key-value collection. Keys are strings. Use for named data: configs, stats, save data, item definitions.
var dict = { key: value, key2: value2 }; dict["key"] = value
A scene object — the fundamental entity in the game world. Objects have transforms, materials, colliders, and scripts. Returned by scene.find(), world.spawn(), etc.
var obj = scene.find("name")
Represents the absence of a value. Functions return null when they cannot find or produce a result.
var x = null
Functions are first-class values in FluxScript. You can assign functions to variables, pass them as parameters, and store them in data structures.
var fn = func(x) { return x * 2 }; fn(5) // 10
Outputs a message to the console and debug log. Essential for debugging and diagnostics.
print(message)
Returns the absolute (non-negative) value of a number.
math.abs(value)
Returns the smaller of two values.
math.min(a, b)
Returns the larger of two values.
math.max(a, b)
Clamps a value between a minimum and maximum. Ensures values stay within bounds.
math.clamp(value, min, max)
Rounds down to the nearest integer.
math.floor(value)
Rounds up to the nearest integer.
math.ceil(value)
Rounds to the nearest integer (0.5 rounds up).
math.round(value)
Returns the square root of a number.
math.sqrt(value)
Returns base raised to the power of exponent.
math.pow(base, exponent)
Returns the sine of an angle (in radians). Used for wave motion, oscillation, and circular movement.
math.sin(radians)
Returns the cosine of an angle (in radians). Used for circular movement and wave motion.
math.cos(radians)
Returns the tangent of an angle (in radians).
math.tan(radians)
Returns the angle (in radians) between the positive X axis and the point (y, x). Use for calculating angles from directions.
math.atan2(y, x)
Returns a random number. With no args: 0-1. With one arg: 0 to arg. With two args: arg1 to arg2.
math.random() // 0-1 math.random(max) // 0-max math.random(min, max) // min-max
Linearly interpolates between two values by a factor (0-1). The core of smooth animations and transitions.
math.lerp(from, to, factor)
Interpolates between two angles, taking the shortest path around the circle. Use for smooth rotation.
math.lerpAngle(fromAngle, toAngle, factor)
Returns the Euclidean distance between two 3D points. The most common distance check in games.
math.distance(pos1, pos2)
Returns a unit vector (length 1) in the same direction as the input. Essential for direction calculations.
math.normalize(vector)
Returns the magnitude (length) of a vector.
math.length(vector)
Returns the dot product of two vectors. Used for angle checks, facing direction, and lighting calculations.
math.dot(v1, v2)
Returns the cross product of two vectors. Produces a vector perpendicular to both inputs. Used for surface normals and torque.
math.cross(v1, v2)
Returns the angle in radians between two vectors.
math.angle(v1, v2)
Returns Perlin noise value (-1 to 1) at the given coordinates. Used for procedural terrain, textures, and organic randomness.
noise.perlin(x, y[, z])
Returns Simplex noise value (-1 to 1). Faster than Perlin for 3D and produces fewer directional artifacts.
noise.simplex(x, y[, z])
Sets the random number generator seed. Same seed produces same random sequence. Use for deterministic generation.
math.seed(seedValue)
Converts a string to uppercase.
string.upper(text)
Converts a string to lowercase.
string.lower(text)
Splits a string by a delimiter into an array of substrings.
string.split(text, delimiter)
Joins an array of strings into one string with a separator.
string.join(array, separator)
Extracts a portion of a string from start index to end index.
string.substring(text, start[, end])
Replaces all occurrences of a substring with another.
string.replace(text, search, replacement)
Returns true if the string contains the search string.
string.contains(text, search)
Returns true if the string starts with the search string.
string.startsWith(text, search)
Returns true if the string ends with the search string.
string.endsWith(text, search)
Adds an element to the end of an array. Returns the new length.
array.push(arr, value) or arr.push(value)
Removes and returns the last element of an array.
array.pop(arr) or arr.pop()
Removes and returns the first element of an array. All other elements shift down.
array.shift(arr) or arr.shift()
Adds an element to the beginning of an array. All existing elements shift up.
array.unshift(arr, value) or arr.unshift(value)
Returns the number of elements in an array.
arr.length
Returns the index of the first occurrence of a value. Returns -1 if not found.
arr.indexOf(value)
Returns true if the array contains the value.
arr.contains(value)
Sorts the array in place. Accepts an optional comparison function.
arr.sort([compareFn])
Reverses the array in place.
arr.reverse()
Returns a new array with elements from start to end index.
arr.slice([start[, end]])
Executes a function for each element. Alternative to for-in loops.
arr.forEach(callback)
Returns an array of all keys in the dictionary.
dict.keys(dictionary) or Object.keys(dict)
Returns an array of all values in the dictionary.
dict.values(dictionary)
Returns true if the dictionary contains the key.
dict.has(dictionary, key)
Removes a key-value pair from the dictionary.
dict.remove(dictionary, key)
Sets the player movement speed in units per second.
player.setSpeed(speed)
Returns the current player movement speed.
player.getSpeed()
Sets the player health to an absolute value.
player.setHealth(health)
Reduces player health by the damage amount. Triggers damage events and effects.
player.takeDamage(amount)
Increases player health by the heal amount, clamped to maxHealth.
player.heal(amount)
Moves the player in a direction by a distance. Always multiply by dt for frame-rate independence.
player.move(direction, distance)
Applies an upward velocity to jump. Requires the player to be grounded.
player.jump([force])
Returns true if the player is standing on a surface. Checked via downward raycast.
player.isGrounded
Teleports the player to a position. Does not interpolate.
player.setPosition(x, y, z)
Returns the player current position as a vec3.
player.position
Triggers the player death sequence: plays animation, disables input, emits died event.
player.die()
Returns the player forward direction as a normalized vec3.
player.forward
Creates a new object in the scene at the specified position. Returns the spawned object.
world.spawn(type, x, y, z)
Returns an array of all objects with the specified type or tag.
world.findAll(type)
Returns the first object with the specified name. Returns null if not found.
world.find(name)
Loads a 3D model from a file URL and returns the model object.
world.loadModel(url)
Sets the global gravity vector. Default is downward at 9.81 m/s2.
world.setGravity(x, y, z)
Sets the in-game time of day (24-hour format). Affects lighting if day/night is configured.
world.setTime(hours)
Returns the current in-game time as a float (0-24).
world.getTime()
Sets the simulation time scale. 1 = normal, 0 = paused, 0.5 = slow motion, 2 = fast forward.
world.setTimeScale(scale)
Sets the global weather preset. Affects particles, lighting, and fog.
world.setWeather(weatherType)
Sets the global wind strength. Affects particles, grass, trees, and cloth.
world.setWind(strength)
Creates an empty object (no mesh). Use as a container, group, or marker.
world.createEmpty(name)
Casts a ray from a position in a direction. Returns the first hit object or null.
physics.raycast(origin, direction, maxDistance)
Casts a sphere along a direction. Use for thick raycasts and character avoidance.
physics.sphereCast(origin, radius, direction, maxDistance)
Sets the global gravity vector for the physics simulation.
physics.setGravity(vec3)
Sets the physics simulation timestep. 0.0167 = 60Hz, 0.02 = 50Hz.
physics.setFixedTimestep(seconds)
Sets the physics solver iterations. Higher = more stable stacks, more CPU. Default 4-6.
physics.setSolverIterations(count)
Creates a physics material with friction and bounciness properties.
physics.createMaterial(name, { friction, bounce })
Returns all rigidbodies within a sphere around a position. Use for explosions.
physics.getRigidbodiesInRange(position, radius)
Configures whether two collision layers interact. Use for filtering.
physics.setCollision(layerA, layerB, shouldCollide)
Sets the camera position in world space.
camera.setPosition(x, y, z)
Moves the camera in a direction by a distance. Use for fly-mode navigation.
camera.move(direction, distance)
Sets the camera field of view in degrees. 60 is standard, 90 is wide, 30 is telephoto.
camera.setFOV(degrees)
Sets the camera mode: first_person, third_person, top_down, or fixed.
camera.setMode(mode)
Sets the object the camera follows.
camera.setFollowTarget(object)
Sets the offset from the follow target.
camera.setFollowOffset(x, y, z)
Orients the camera to look at a target position.
camera.lookAt(position)
Frames the specified object in the viewport. Smoothly moves and rotates.
camera.focus(object[, duration])
Sets the camera follow damping. Higher = smoother but laggy. Lower = responsive.
camera.setDamping(factor)
Shows a UI element by its ID. The element becomes visible.
ui.show(elementId)
Hides a UI element by its ID.
ui.hide(elementId)
Sets the text content of a UI text element.
ui.setText(elementId, text)
Sets the fill ratio of a UI bar (health bar, progress bar). Value is 0-1.
ui.setBar(barId, ratio)
Sets the color of a UI bar. Use for health state (green/yellow/red).
ui.setBarColor(barId, color)
Flashes a UI element (damage vignette, screen flash) for a duration.
ui.flash(elementId, duration)
Shows a temporary notification toast that auto-dismisses.
ui.toast(message)
Adds a selectable choice button to a dialogue or menu UI.
ui.addChoice(text, callback)
Removes all choice buttons from the dialogue UI.
ui.clearChoices()
Opens the shop interface with the specified shop inventory.
ui.openShop(shopId)
Spawns floating text (damage numbers, notifications) at a world position.
ui.spawnFloatingText({ position, text, color, lifetime, velocity })
Plays a sound by ID. Optional config for volume, pitch, loop, and 3D position.
audio.play(soundId[, options])
Stops a playing sound by ID.
audio.stop(soundId)
Sets the volume of a playing sound. 0 = silent, 1 = full volume.
audio.setVolume(soundId, volume)
Sets the pitch of a playing sound. 1 = normal, 0.5 = lower, 2 = higher.
audio.setPitch(soundId, pitch)
Gradually increases volume from 0 to target over a duration.
audio.fadeIn(soundId, duration)
Gradually decreases volume to 0 over a duration, then stops.
audio.fadeOut(soundId, duration)
Sets the volume of an entire audio channel (master, music, sfx, voice, ambient).
audio.setChannelVolume(channel, volume)
Loads an animation clip from a file. The clip can then be played.
obj.loadAnimation(name, url)
Plays a loaded animation clip. Optional blend time for smooth transitions.
obj.playAnimation(name[, options])
Stops the currently playing animation.
obj.stopAnimation()
Configures an animation state machine with states and transition rules.
obj.setStateMachine({ default, states, transitions })
Sets a parameter used by animation state machine transitions. The state machine reads these to decide transitions.
obj.setAnimParam(paramName, value)
Creates a particle system with configuration. Returns the system object.
effects.create(name, { emitter, emissionRate, lifetime, startColor, endColor, ... })
Emits a burst of particles at a position. Use for explosions, impacts, one-time effects.
effects.burst(name, position, { count, lifetime, speed, ... })
Spawns a pre-configured effect at a position. Lighter than create() for common effects.
effects.spawn(effectName, position[, options])
Sends a message to a specific client. Use for targeted communication (private messages, host-to-client).
network.send(clientId, eventName, data)
Sends a message to all connected clients. Use for global events (chat, weather changes).
network.broadcast(eventName, data)
Remote procedure call. Executes a function on all clients. Use for synchronized effects.
network.rpc(eventName, data)
Returns true if this client is the host (server-authoritative). Hosts run simulation logic.
network.isHost
Returns true if this object is controlled by the local client. Use to gate input handling.
network.isLocalPlayer
Finds an object by name in the current scene. Returns null if not found.
scene.find(name)
Returns all objects matching a type or tag.
scene.findAll(type)
Loads a new scene by name. Used for level transitions and menu navigation.
scene.load(sceneName)
Unloads a scene. Used for multi-scene additive loading.
scene.unload(sceneName)
Reloads the current scene. Use for restart and respawn.
scene.reload()
Creates a new object with a mesh in the scene.
scene.create(type)
Creates an empty object (no mesh). Use for containers, markers, and groups.
scene.createEmpty(name)
Stores a value in cloud save data. Persists across sessions.
save.set(key, value)
Retrieves a value from cloud save data. Returns null if the key does not exist.
save.get(key)
Forces immediate upload of all pending save data to cloud. Returns a promise.
save.flush()
Returns true if a save key exists.
save.has(key)
Returns true if a key is currently held down. Use for continuous input (movement).
input(key)
Returns true only on the frame the key was pressed. Use for single-press actions (jump, interact).
input.pressed(key)
Returns true if a mouse button is held. 0 = left, 1 = right, 2 = middle.
input.getMouseButton(button)
Returns the scroll wheel delta. Positive = up, negative = down.
input.getScroll()
Returns the mouse movement delta as a vec2. Use for camera rotation and aiming.
input.getMouseDelta()
Rebinds an action to a new key. Use for settings menu control rebinding.
input.rebind(action, key)
Returns the current time in seconds since the game started. Use for timestamps and durations.
time.now()
Returns the time since the last frame. Same as the dt parameter in on update.
time.deltaTime
Logs a message to the debug console. Same as print but tagged as debug.
debug.log(message)
Draws a debug line in the viewport. Only visible in edit mode or when debug is enabled.
debug.drawLine(start, end, color)
Draws a debug sphere wireframe in the viewport.
debug.drawSphere(position, radius, color)
Draws debug text at a world position in the viewport.
debug.drawText(position, text, color)
Sets the world position of any object.
obj.setPosition(x, y, z)
Sets the world rotation of any object in degrees.
obj.setRotation(x, y, z)
Sets the scale of any object. 1 = original size.
obj.setScale(x, y, z)
Destroys the object, removing it from the scene and freeing memory.
obj.destroy()
Creates a new material with configurable properties.
materials.create(name)
Sets the base color (albedo) of a material.
mat.setColor(r, g, b[, a])
Assigns a texture to a material slot (albedo, normal, roughness, metallic).
mat.setTexture(slot, textureUrl)
Sets the metallic property (0 = non-metal, 1 = metal).
mat.setMetallic(value)
Sets the roughness property (0 = smooth/shiny, 1 = rough/matte).
mat.setRoughness(value)
Sets the material opacity (0 = transparent, 1 = opaque). Use for glass and ghost effects.
mat.setOpacity(value)
Sets the texture tiling (repeat count). Higher = more repeats across the surface.
mat.setTiling(x, y)
Adds a light to the scene. Types: directional, point, spot, ambient.
lighting.add(type)
Sets the light brightness. 0 = off, 1 = normal, 2 = bright.
light.setIntensity(value)
Sets the light color.
light.setColor(r, g, b)
Enables shadow casting for the light. Configure quality and distance.
light.setShadows(enabled[, { quality, distance }])
Sets the ambient light color and intensity. Ambient fills shadows.
scene.setAmbient(color, intensity)
Sets the height at a terrain grid coordinate. Used for procedural terrain generation.
terrain.setHeight(x, z, height)
Returns the height at a terrain grid coordinate.
terrain.getHeight(x, z)
Paints a texture layer at a terrain coordinate.
terrain.paintTexture(x, z, layerName, opacity, brushSize)
Scatters objects (trees, rocks) on the terrain with density and placement rules.
terrain.scatter(objectType, { density, scale, slopeLimit, ... })
Rebuilds the terrain mesh after height or texture changes. Required for visual and collision updates.
terrain.rebuild()
Finds a path between two positions using the navigation mesh. Returns an array of waypoints.
navmesh.findPath(start, end)
Generates the navigation mesh from scene geometry. Required before findPath works.
navmesh.bake()
Smoothly interpolate an object's position to a target over a duration. Non-blocking — the tween runs in the background.
Tween Position [target] to [x] [y] [z] over [n] Seconds
Smoothly interpolate an object's rotation to target Euler angles over a duration.
Tween Rotation [target] to [x] [y] [z] over [n] Seconds
Smoothly interpolate an object's scale to a target over a duration.
Tween Scale [target] to [x] [y] [z] over [n] Seconds
Smoothly interpolate an object's material color to a target hex color over a duration.
Tween Color [target] to #[hex] over [n] Seconds
Smoothly interpolate the camera's field of view to a target angle over a duration. Great for zoom effects.
Tween Camera FOV to [degrees] over [n] Seconds
Sets the movement speed of an AI agent while pathfinding to a target.
Set Navigation Speed [target] to [n]
Returns true if the target is currently following a navigation path.
if [target] Is Pathfinding { ... }
Returns the remaining distance to the navigation target.
Set Variable [name] = Get Remaining Distance [target]
Sets the destination position for an AI agent to pathfind toward.
Set Navigation Target [target] to [x] [y] [z]
Enables or disables obstacle avoidance for a navigating agent.
Set Avoidance [target] to [true/false]
Sets the master audio volume (0.0 to 1.0). Affects all audio channels.
Set Master Volume to [n]
Sets the sound effects channel volume (0.0 to 1.0). Does not affect music.
Set SFX Volume to [n]
Sets the music channel volume (0.0 to 1.0). Does not affect SFX.
Set Music Volume to [n]
Fades the music channel in or out over a duration.
Fade Music [In/Out] over [n] Seconds
Plays a sound at a specific 3D position with spatial attenuation.
Play 3D Sound [name] at [x] [y] [z]
Awards experience points to the player. Fires On Level Up when the threshold is crossed.
Add XP [n]
Returns the player's current level.
Set Variable [name] = Get Level
Returns the player's unspent skill points.
Set Variable [name] = Get Skill Points
Grants skill points to the player.
Award Skill Points [n]
Directly sets the player's level, bypassing XP. Use for debugging or scripted level-ups.
Set Player Level to [n]
Applies a status effect (poison, stun, burn, freeze, etc.) to a target for a duration. Fires On Status Effect Added.
Add Status Effect [target] [effect] for [n] Seconds
Returns true if the target currently has the specified status effect active.
if [target] Has Status Effect [name] { ... }
Returns the remaining duration (in seconds) of a status effect on the target.
Set Variable [name] = Get Status Duration [target] [effect]
Removes a status effect from the target immediately.
Remove Status Effect [target] [effect]
Removes all status effects from the target.
Clear All Status Effects [target]
Starts a named cutscene. Disables player input and plays the cutscene's camera sequence.
Start Cutscene "[name]"
Stops the active cutscene and restores player control.
Stop Cutscene
Plays a pre-authored camera path (a sequence of waypoints). Used within cutscenes.
Play Camera Path "[name]"
Sets the look-at target for the camera during a cutscene or gameplay.
Set Camera Target to [target]
Disables player input and movement. Use during cutscenes or scripted moments.
Freeze Player
Procedurally generates a dungeon layout with the given dimensions.
Generate Dungeon [width] [height]
Procedurally generates a maze with the given dimensions.
Generate Maze [width] [height]
Generates a Perlin/simplex noise value at the given coordinates. Useful for terrain and organic placement.
Set Variable [name] = Generate Noise [x] [y]
Scatters a number of objects of the given type randomly across the scene.
Scatter Objects [type] [count]
Generates a loot table with a given name and item count. Rolls random loot drops.
Generate Loot Table "[name]" [count]
Shows a tooltip with the given text. Useful for interaction prompts.
Show Tooltip "[text]"
Hides the currently visible tooltip.
Hide Tooltip
Shows the minimap overlay. Useful for open-world and arena games.
Show Minimap
Hides the minimap overlay.
Hide Minimap
Sets the mouse cursor style (default, crosshair, pointer, hidden).
Set Cursor to [style]
Set Variable [name] = Tan [angle]
Set Variable [name] = Sqrt [n]
Set Variable [name] = Pow [base] [exponent]
Rounds a number down to the nearest integer.
Set Variable [name] = Floor [n]
Rounds a number up to the nearest integer.
Set Variable [name] = Ceil [n]
Returns the smaller of two numbers.
Set Variable [name] = Min [a] [b]
Returns the larger of two numbers.
Set Variable [name] = Max [a] [b]
Returns the arctangent of y/x, in radians. Useful for calculating angles.
Set Variable [name] = Atan2 [y] [x]
Returns the distance between two entities.
Set Variable [name] = Distance [entity1] [entity2]
Linearly interpolates between two angles, taking the shortest path.
Set Variable [name] = Lerp Angle [a] [b] [t]
Replaces all occurrences of a substring with another string.
Set Variable [name] = Replace "[str]" "[find]" "[replace]"
Removes leading and trailing whitespace from a string.
Set Variable [name] = Trim "[str]"
Returns true if a string starts with the given prefix.
if "[str]" Starts With "[prefix]" { ... }
Returns true if a string ends with the given suffix.
if "[str]" Ends With "[suffix]" { ... }
Converts a string to a number. Returns 0 if the string is not numeric.
Set Variable [name] = To Number "[str]"
Finds the first element in an array matching a condition.
Set Variable [name] = Find Array "[arr]" [condition]
Returns a new array with only elements matching a condition.
Set Variable [name] = Filter Array "[arr]" [condition]
Sorts an array in ascending order.
Set Variable [name] = Sort Array "[arr]"
Reverses the order of elements in an array.
Set Variable [name] = Reverse Array "[arr]"
Randomly shuffles the elements of an array.
Set Variable [name] = Shuffle Array "[arr]"
Merges two dictionaries into a new one. Values in the second dict override the first.
Set Variable [name] = Merge Dict "[a]" "[b]"
Returns an array of all values in a dictionary.
Set Variable [name] = Dict Values "[dict]"
Returns the number of keys in a dictionary.
Set Variable [name] = Dict Size "[dict]"
Removes a key from a dictionary.
Remove From Dict "[dict]" key "[key]"
Vibrates the device for a duration (mobile only). No effect on desktop.
Vibrate Device [seconds]
Returns the device accelerometer reading as X, Y, Z values.
Set Variable [name] = Get Accelerometer
Returns the device orientation (portrait, landscape).
Set Variable [name] = Get Device Orientation
Captures the current screen and saves it.
Take Screenshot
Opens the native share dialog with a link to the game.
Share Game
Stores an arbitrary value in the player's persistent data. Survives across sessions.
Set Player Data "[key]" [value]
Reads a value from the player's persistent data. Returns 0/null if the key doesn't exist.
Set Variable [name] = Get Player Data "[key]"
Deletes a key from the player's persistent data.
Delete Player Data "[key]"