skyfall
The skyfallKit front door: `local Skyfall = require("skyfallKit.skyfall")`. Defines kinds of falling things (`defineKind`, on every peer), creates or finds the synced director that is the one authority for a play area (`director`), spawns single objects and whole waves on the aut…
skyfall
The skyfallKit front door: local Skyfall = require("skyfallKit.skyfall"). Defines kinds of falling things (defineKind, on every peer), creates or finds the synced director that is the one authority for a play area (director), spawns single objects and whole waves on the authority (spawn, wave), runs schedules that ramp along a difficulty curve (run, stopAll), removes objects (remove, forwarded to the authority from other peers; clear), reads what is in play on any peer (alive, positionOf, infoOf, isObject, area), and fires spawned, escaped and removed on every peer (on). Style lists: looks, motions, patterns, entries, warnings, curves, shapes; setLook and configure change the current director. The package README documents every call.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
exists(id: string?) → boolean
| arg | type | description |
|---|---|---|
| id | string? |
ownsId(eid: string) → boolean
| arg | type | description |
|---|---|---|
| eid | string |
nameOf(id: string) → string
| arg | type | description |
|---|---|---|
| id | string |
findDirector(name: string?) → void
| arg | type | description |
|---|---|---|
| name | string? |
currentDirector( ) → void
applyOpts(pub: any, o: any) → void
| arg | type | description |
|---|---|---|
| pub | any | |
| o | any |
handle(name: string) → DirectorHandle
| arg | type | description |
|---|---|---|
| name | string |
id(_self: any) → string
| arg | type | description |
|---|---|---|
| _self | any |
entity(_self: any) → any
| arg | type | description |
|---|---|---|
| _self | any |
isAuthority(_self: any) → boolean
| arg | type | description |
|---|---|---|
| _self | any |
fields(_self: any) → any
| arg | type | description |
|---|---|---|
| _self | any |
director(opts: any?) → DirectorHandle
Create (authority) or find (any peer) the synced director for a play area, and make it current.
| arg | type | description |
|---|---|---|
| opts | any? | { name?, area = { center, width, height, depth, down, across? }, look?, warning?, entry?, curve?, pattern?, motion?, maxAlive?, speedScale?, kinds?, autoRun? } |
examples
local dir = Skyfall.director({ area = { center = {0,6,0}, width = 14, height = 10, depth = 2, down = {0,-1,0} }, look = "pastel" })authorityDirector( ) → void
isAuthority( ) → boolean
Whether this peer is the authority (owns the current director; the host when there is none yet).
defineKind(name: string, def: any?) → void
Define (or replace) a kind of falling thing. Call on EVERY peer (module scope / entrypoint).
| arg | type | description |
|---|---|---|
| name | string | The kind's name. |
| def | any? | { build = function(entity, look) end?, model?, material?, tint?, shape?, motion?, speed?, radius?, data? } |
examples
Skyfall.defineKind("star", { motion = "float", speed = 2, radius = 0.6, data = { points = 10 } })kind(name: string) → any
A kind's definition (or nil).
| arg | type | description |
|---|---|---|
| name | string |
spawn(kind: string, opts: any?) → any
Spawn one object now (authority only; nil elsewhere or when maxAlive is reached).
| arg | type | description |
|---|---|---|
| kind | string | A kind name. |
| opts | any? | { motion?, x? (0..1 across), y? (0..1 up), vx?, speed?, delay?, data?, look?, radius? } |
wave(spec: any?) → void
Run one wave now (authority only). Returns the entities spawned (empty elsewhere).
| arg | type | description |
|---|---|---|
| spec | any? | { pattern?, kinds?, kind?, count?, gap?, motion?, speed?, lanes?, data?, delay? } |
examples
Skyfall.wave({ pattern = "vee", kinds = { "star" }, count = 7, gap = 0.2 })run(schedule: any, opts: any?) → boolean
Start a schedule (authority only). Either a list of waves with `at` times, or a round { seconds, waves, curve, every, loop } that ramps count / speed / pace along the curve.
| arg | type | description |
|---|---|---|
| schedule | any | |
| opts | any? |
examples
Skyfall.run({ seconds = 90, curve = "easeIn", every = 3, waves = { { pattern = "rain", kinds = {"star"}, count = 5 } } })stopAll( ) → void
Stop the running schedule (authority). Objects already in play keep going.
running( ) → boolean
Whether a schedule is running on the current director (any peer).
objectComp(e: any) → any
| arg | type | description |
|---|---|---|
| e | any |
sendRemove(id: string, reason: string) → void
| arg | type | description |
|---|---|---|
| id | string | |
| reason | string |
remove(e: any, reason: string?) → boolean
Remove one object now (e.g. it was caught). On the authority it ends at once; elsewhere the request is forwarded to the authority. Fires `removed` on every peer.
| arg | type | description |
|---|---|---|
| e | any | The object's entity (or id). |
| reason | string? | Optional reason carried in the event (default "removed"). |
onRemoteRemove(id: any, reason: any) → void
Forwarded removals arrive here on the owner.
| arg | type | description |
|---|---|---|
| id | any | |
| reason | any |
clear( ) → number
Despawn everything in play (authority). Each fires `removed` with reason "cleared".
alive( ) → void
Every object in play on this peer, as entity proxies.
positionOf(e: any) → void
This peer's computed world position of an object now ({x, y, z}), or nil.
| arg | type | description |
|---|---|---|
| e | any |
infoOf(e: any) → any
What an object is: { kind, data, motion, look, appearsAt, ended } (any peer), or nil.
| arg | type | description |
|---|---|---|
| e | any |
isObject(e: any) → boolean
Whether an entity is a Skyfall object (in play or ending).
| arg | type | description |
|---|---|---|
| e | any |
on(name: string, fn: (...any) → void
Listen to "spawned", "escaped", "removed" (or "*"). Fires on every peer; ev = { entity, id, kind, data, position, motion, reason?, edge? }.
| arg | type | description |
|---|---|---|
| name | string | |
| fn | (...any |
examples
Skyfall.on("escaped", function(ev) lives -= 1 end)stats( ) → any
Counts of events fired on this peer and objects in play.
setLook(name: string) → boolean
Switch the look of the current director and every object in play (authority).
| arg | type | description |
|---|---|---|
| name | string |
configure(opts: any) → boolean
Change the current director's settings (authority): area, look, warning, entry, curve, pattern, motion, maxAlive, speedScale, kinds...
| arg | type | description |
|---|---|---|
| opts | any |
area( ) → Core
The play-area frame of the current director: { c, ax, up, dz, w, h, d } (any peer), or nil.
looks( ) → void
motions( ) → void
patterns( ) → void
entries( ) → void
warnings( ) → void
curves( ) → void
shapes( ) → void
DirectorHandle = {The skyfallKit API: kinds, the synced director, spawn, wave, run, remove, alive, positionOf and the spawned / escaped / removed events.Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.