api
The front door of trophyKit: `local Trophy = require("trophyKit.api")`.
api
The front door of trophyKit: local Trophy = require("trophyKit.api").
Trophy.spawn(tier, look, opts)spawns a trophy entity.tieris 1, 2, 3 or "gold", "silver", "bronze";lookis one ofTrophy.looks(); opts takeposition,rotation,scale(1 is about 0.55 m tall),spin(default true),spinSpeed(degrees per second),parent,syncedandname. Answers the entity.Trophy.podium(look, opts)spawns a three-step podium (2-1-3) and answers the entity plus the world positions of the three step tops. opts takeposition,rotation,scale,parent,synced,numbersandname.Trophy.celebrate(opts)spawns confetti and sparkles:position,radius,height,count,mode("rain" or "burst"),palette("party", "gold", "silver", "bronze"),synced.Trophy.ceremony(opts)does all three at once and answers{ podium, tops, trophies, celebration }.Trophy.looks(),Trophy.podiumLooks(),Trophy.catalog(tag?),Trophy.tier(t),Trophy.stepTops(podium),Trophy.material(key).Trophy.buildTrophy(parent, look, tier)andTrophy.buildPodium(parent, look, numbers)build the parts as local children of any entity; the components call these.
local Trophy = require("trophyKit.api")
local stage, tops = Trophy.podium("classic", { position = { 0, 0, 0 } })
Trophy.spawn(1, "crystal", { position = tops[1], scale = 2 })
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
tier(t: any) → TierInfo
The tier record for 1/2/3, "gold"/"silver"/"bronze" or "1st"/"2nd"/"3rd"; gold for anything else.
| arg | type | description |
|---|---|---|
| t | any |
material(key: string) → any
The material for a material key (gold, marble, glowCyan, ...), or nil.
| arg | type | description |
|---|---|---|
| key | string |
looks( ) → void
Every trophy look name, in gallery order.
podiumLooks( ) → void
Every podium look name, in gallery order.
catalog(tag: string?) → void
The tagged catalog: every trophy and podium look with its label, tags and a sentence about it. Pass a tag (e.g. "cartoon", "retro", "sci-fi", "realistic") to keep only the looks carrying it.
| arg | type | description |
|---|---|---|
| tag | string? |
add(kind: string, look: string, d: any) → void
| arg | type | description |
|---|---|---|
| kind | string | |
| look | string | |
| d | any |
isLook(look: string) → boolean
Whether `look` is a trophy look.
| arg | type | description |
|---|---|---|
| look | string |
isPodiumLook(look: string) → boolean
Whether `look` is a podium look.
| arg | type | description |
|---|---|---|
| look | string |
partsFor(kind: string, look: string) → void
| arg | type | description |
|---|---|---|
| kind | string | |
| look | string |
slotMaterial(slot: string, ti: TierInfo) → any
| arg | type | description |
|---|---|---|
| slot | string | |
| ti | TierInfo |
buildTrophy(parent: any, look: string, tier: any) → void
Builds the parts of a trophy look in tier `tier` under `parent` (temporary, local to this peer). Answers the spawned child entities. Used by the Trophy component; call it directly for a purely local trophy.
| arg | type | description |
|---|---|---|
| parent | any | |
| look | string | |
| tier | any |
text3d(parent: any, content: string, pos: { number }, h: number, col: { number }, outline: number, outlineCol: { number }) → any
| arg | type | description |
|---|---|---|
| parent | any | |
| content | string | |
| pos | { number } | |
| h | number | |
| col | { number } | |
| outline | number | |
| outlineCol | { number } |
buildPodium(parent: any, look: string, numbers: boolean?) → void
Builds a podium look under `parent` (temporary, local to this peer), with place numbers on the step fronts unless `numbers` is false. Answers the spawned children and { steps = { [place] = local top centre } }.
| arg | type | description |
|---|---|---|
| parent | any | |
| look | string | |
| numbers | boolean? |
qrot(q: any, v: vector) → vector
quaternion rotate, for turning local step tops into world positions
| arg | type | description |
|---|---|---|
| q | any | |
| v | vector |
vec(p: any) → vector
| arg | type | description |
|---|---|---|
| p | any |
stepTops(podium: any) → void
The world positions of the three step tops of a podium entity, { [1] = 1st, [2] = 2nd, [3] = 3rd }, read from its current transform.
| arg | type | description |
|---|---|---|
| podium | any |
place(e: any, o: any) → void
| arg | type | description |
|---|---|---|
| e | any | |
| o | any |
spawn(tier: any, look: string?, opts: SpawnOpts?) → any
Spawns a trophy: `tier` is 1/2/3 or "gold"/"silver"/"bronze", `look` one of Trophy.looks(). opts: position, rotation, scale (1 = about 0.55 m tall), spin (default true, turns in play), spinSpeed (degrees per second, default 40), parent, synced (replicate the entity so every player sees it), name. Answers the trophy entity.
| arg | type | description |
|---|---|---|
| tier | any | |
| look | string? | |
| opts | SpawnOpts? |
examples
local cup = Trophy.spawn(1, "classic", { position = { 0, 1.3, 0 }, scale = 2 })podium(look: string?, opts: PodiumOpts?) → void
Spawns a three-step podium (2-1-3 from the left as seen from its front, +Z) in `look`, one of Trophy.podiumLooks(). Each step top is 3.1 m wide and 2.7 m deep, room for a 2 m by 1.5 m kart. opts: position, rotation, scale, parent, synced, numbers (default true), name. Answers the podium entity and the world positions of the step tops { [1], [2], [3] }.
| arg | type | description |
|---|---|---|
| look | string? | |
| opts | PodiumOpts? |
examples
local stage, tops = Trophy.podium("classic", { position = { 0, 0, 0 } }); kart.position = tops[1]celebrate(opts: CelebrateOpts?) → any
Spawns a confetti and sparkle celebration: opts position (the floor point under the shower), parent, radius (metres, default 2.5), height (metres the confetti falls from, default 6), count (pieces, default 220), mode ("rain" keeps falling, "burst" fires once from the floor), palette ("party", "gold", "silver", "bronze"), synced. Answers the entity; call `entity.component.get("Celebration"):burst()` for another burst.
| arg | type | description |
|---|---|---|
| opts | CelebrateOpts? |
examples
Trophy.celebrate({ position = tops[1], palette = "gold" })ceremony(opts: any?) → any
A whole prize ceremony in one call: a podium, a trophy of each tier hovering over its step and confetti over the winner. opts: podium (look), trophy (look), position, rotation, scale (podium), trophyScale (default 1.6), celebrate (default true), synced. Answers { podium, tops, trophies = { [place] = entity }, celebration }.
| arg | type | description |
|---|---|---|
| opts | any? |
examples
local c = Trophy.ceremony({ podium = "classic", trophy = "classic", position = { 0, 0, 0 } })TierInfo = { place: number, name: string, label: string, metal: string, glass: string, modern: string, colour: { number } }CatalogEntry = { kind: string, look: string, label: string, tags: { string }, about: string }SpawnOpts = { position: any?, rotation: any?, scale: number?, spin: boolean?, spinSpeed: number?, parent: any?, synced: boolean?, name: string? }PodiumOpts = { position: any?, rotation: any?, scale: number?, parent: any?, synced: boolean?, numbers: boolean?, name: string? }CelebrateOpts = { position: any?, parent: any?, radius: number?, height: number?, count: number?, mode: string?, palette: string?, synced: boolean? }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.