SoccerWorldCup
A component script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Soccer World Cup — FIFA-style exhibition match vs the CPU. One component owns the whole game: match state machine, 22-player kinematic sim, ball physics, team + goalkeeper AI, broadcast camera, zui HUD/menus, synthesized audio, and persistent progression. Controls: WASD/arrows move · Shift sprint · J pass (hold = through ball) K shoot (hold = power) · L tackle · Tab switch player · Esc pause.
resetSession( ) → void
loadProgress( ) → void
saveProgress( ) → void
clamp(v: ?, lo: ?, hi: ?) → void
| arg | type | description |
|---|---|---|
| v | ? | |
| lo | ? | |
| hi | ? |
len2(x: ?, z: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? |
norm2(x: ?, z: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? |
dist2(ax: ?, az: ?, bx: ?, bz: ?) → void
| arg | type | description |
|---|---|---|
| ax | ? | |
| az | ? | |
| bx | ? | |
| bz | ? |
expDamp(cur: ?, target: ?, rate: ?, dt: ?) → void
| arg | type | description |
|---|---|---|
| cur | ? | |
| target | ? | |
| rate | ? | |
| dt | ? |
fmtColor(c: ?) → void
| arg | type | description |
|---|---|---|
| c | ? |
pollKeys( ) → void
kPressed(k: ?) → void
| arg | type | description |
|---|---|---|
| k | ? |
kReleased(k: ?) → void
| arg | type | description |
|---|---|---|
| k | ? |
diff( ) → void
halfLen( ) → void
atkDir(team: ?) → void
attack direction (+1 = +x) for a team this half
| arg | type | description |
|---|---|---|
| team | ? |
audioEnt(slot: ?, file: ?, cfg: ?) → void
| arg | type | description |
|---|---|---|
| slot | ? | |
| file | ? | |
| cfg | ? |
sfx(file: ?, vol: ?) → void
| arg | type | description |
|---|---|---|
| file | ? | |
| vol | ? |
loopSound(name: ?, file: ?, ch: ?, vol: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| file | ? | |
| ch | ? | |
| vol | ? |
setLoopVol(name: ?, vol: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| vol | ? |
stopLoop(name: ?) → void
| arg | type | description |
|---|---|---|
| name | ? |
subtitle(text: ?, dur: ?) → void
| arg | type | description |
|---|---|---|
| text | ? | |
| dur | ? |
kitColor(team: ?) → void
| arg | type | description |
|---|---|---|
| team | ? |
applyKit(p: ?, team: ?) → void
| arg | type | description |
|---|---|---|
| p | ? | |
| team | ? |
spawnPlayers( ) → void
ensureCamera( ) → void
retint( ) → void
homePos(team: ?, i: ?) → void
formation slot in world space for this half
| arg | type | description |
|---|---|---|
| team | ? | |
| i | ? |
placeFormation(kickTeam: ?) → void
| arg | type | description |
|---|---|---|
| kickTeam | ? |
giveBall(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
stat(key: ?, team: ?) → void
| arg | type | description |
|---|---|---|
| key | ? | |
| team | ? |
kickBall(p: ?, vx: ?, vy: ?, vz: ?) → void
| arg | type | description |
|---|---|---|
| p | ? | |
| vx | ? | |
| vy | ? | |
| vz | ? |
nearestPlayer(team: ?, x: ?, z: ?, skipGK: ?) → void
| arg | type | description |
|---|---|---|
| team | ? | |
| x | ? | |
| z | ? | |
| skipGK | ? |
oppTeam(team: ?) → void
| arg | type | description |
|---|---|---|
| team | ? |
showBanner(text: ?, dur: ?) → void
| arg | type | description |
|---|---|---|
| text | ? | |
| dur | ? |
setMode(m: ?) → void
| arg | type | description |
|---|---|---|
| m | ? |
beginKickoff(kickTeam: ?) → void
| arg | type | description |
|---|---|---|
| kickTeam | ? |
displayMinute( ) → void
goalScored(scoringTeam: ?) → void
| arg | type | description |
|---|---|---|
| scoringTeam | ? |
endMatch( ) → void
doPass(p: ?, through: ?) → void
| arg | type | description |
|---|---|---|
| p | ? | |
| through | ? |
doShot(p: ?, power: ?) → void
| arg | type | description |
|---|---|---|
| p | ? | |
| power | ? |
doTackle(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
carrierAI(p: ?, dt: ?) → void
| arg | type | description |
|---|---|---|
| p | ? | |
| dt | ? |
keeperAI(p: ?, dt: ?) → void
| arg | type | description |
|---|---|---|
| p | ? | |
| dt | ? |
offBallTarget(p: ?) → void
desired position for an off-ball outfielder
| arg | type | description |
|---|---|---|
| p | ? |
movePlayer(p: ?, tx: ?, tz: ?, sprint: ?, dt: ?, isUser: ?) → void
| arg | type | description |
|---|---|---|
| p | ? | |
| tx | ? | |
| tz | ? | |
| sprint | ? | |
| dt | ? | |
| isUser | ? |
tickClipBinding(p: ?, dt: ?) → void
| arg | type | description |
|---|---|---|
| p | ? | |
| dt | ? |
pushTransforms(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
restartPlay(kind: ?, x: ?, z: ?, team: ?) → void
| arg | type | description |
|---|---|---|
| kind | ? | |
| x | ? | |
| z | ? | |
| team | ? |
applyRestart( ) → void
checkOut( ) → void
ballPhysics(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
tryPickup( ) → void
autoSwitch(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
userInput(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
aiPlayers(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
crowdDynamics(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
matchTick(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
cameraTick(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
label(text: ?, size: ?, color: ?, extra: ?) → void
| arg | type | description |
|---|---|---|
| text | ? | |
| size | ? | |
| color | ? | |
| extra | ? |
button(text: ?, id: ?, w: ?, primary: ?) → void
| arg | type | description |
|---|---|---|
| text | ? | |
| id | ? | |
| w | ? | |
| primary | ? |
flagNode(nat: ?, scale: ?) → void
| arg | type | description |
|---|---|---|
| nat | ? | |
| scale | ? |
natName(team: ?) → void
| arg | type | description |
|---|---|---|
| team | ? |
buildMenu( ) → void
buildTeamSelect( ) → void
settingRow(name: ?, value: ?, decId: ?, incId: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| value | ? | |
| decId | ? | |
| incId | ? |
buildSettings( ) → void
buildCredits( ) → void
buildPause( ) → void
buildResult( ) → void
buildHud( ) → void
buildRadar( ) → void
dot(x: ?, z: ?, size: ?, color: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? | |
| size | ? | |
| color | ? |
buildBanner( ) → void
buildPower( ) → void
buildSubtitle( ) → void
refreshStaticUI( ) → void
refreshDynamicUI(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
registerScreens( ) → void
startMatch( ) → void
quitToMenu( ) → void
onCallback(id: ?, data: ?) → void
| arg | type | description |
|---|---|---|
| id | ? | |
| data | ? |
step(field: ?, delta: ?, lo: ?, hi: ?) → void
settings steppers
| arg | type | description |
|---|---|---|
| field | ? | |
| delta | ? | |
| lo | ? | |
| hi | ? |
awake( ) → void
start( ) → void
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
editorUpdate(_dt: ?) → void
| arg | type | description |
|---|---|---|
| _dt | ? |
onDestroy( ) → void
getMatch( ) → any
Structured match snapshot for automated tests.
testStartMatch(natA: number?, natB: number?, auto: boolean?) → void
Jump straight into a match from script (used by tests). Setting the autoplay flag here, inside the live instance, cannot race the async hot-reload reconciliation the way an external proxy write can.
| arg | type | description |
|---|---|---|
| natA | number? | |
| natB | number? | |
| auto | boolean? |
testSkipToHalfEnd( ) → void
Force the clock near the end of the current half (used by tests).
testProbe( ) → any
Live positions/velocities of a sample of players (used by tests).
testGiveBallToActive(x: number?, z: number?) → void
Hand possession to the user's active player (used by tests).
| arg | type | description |
|---|---|---|
| x | number? | |
| z | number? |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
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.