objects: snap to floor follows the engine's cell rule (cell tiles, swap models, then neighbours), alligator, alligator spawner and cow guard spawner schemas with box checks, every way of adding a box walker gives it a box, guard info names the objects that set its event bit, new and moved player starts carry their start camera node (no camera in the llama's head), edit and delete type in the object palettes' context menu

This commit is contained in:
MineTec committed 2026-11-07 13:51:12 +01:00
1 parent 01208aa36f
commit 6a76cac69f
34 files changed
+1302 -203

No files matched your search

+49 -3
View File
@@ -63,7 +63,7 @@ values only.
| RubyIdol | p0 falls, p1 snap | – |
| Secret (high) | p0 box mode (player inside the box of the 2 nodes, op 0x178) | box (2 nodes) |
| CoinLine / CoinCircle (low) | count (counted down), spacing / radius | – |
| Llama | p0 spawns a helper, p1 unused, p2 camera mode (global 107) | first node = camera start |
| Llama | p0 spawns a helper, p1 unused, p2 camera mode (global 107) | camera starts: first node within 2.5 cells of the llama (see "Start camera") |
| CheckPointPost (high) | p0 collision radius (+0xD2, 0.2) | 1 node = respawn position + yaw (98 of 102) |
| LevelDoor (high) | tribe, world, chapter of the next level (7,7,7 = world finished); fires on material-16 floor of a tile in its cell (any height; often only in the swap model a RubyIdolDoor/other door object switches to when it opens) | – |
| CameraSide | p0 height (g48), p1 distance (g47), p2 yaw mode (1 node yaw, 2 node yaw or ±180°), p3 only below node y, p4 flag 0x10000, p10 several boxes, p11 height offset, p12/p13 alt. height/distance | box pairs, node 0 yaw = camera yaw |
@@ -100,7 +100,53 @@ info for p2 > 0; the Inspector shows the state plus a **Box around it** button (
`Setups.guardBox`). Verified in game: CityGuard with its box on a new level (base village 2)
appears and attacks the llama; a second one with a 4-node "square path" next to it never appears.
The rest (~150 placed types) shows raw values with the original statistics. Next candidates:
Alligator (also box pairs: "Forcing alligator inside first WP box"), PressurePadDoor (bit field), TargetRopePlatform, CataSwingingBlade (speeds/angles), RiverLog.
### Other box walkers (2026-11-07, objs2)
Same pair scan, kind-specific rules (`Guards`, model list `editor.model.WaypointBoxes`):
* **CowGuardSpawned** (spawned by CowGuardSpawner, same guard code): p0 view, p1 chase, p2 event
bit (spawner passes 0), p3 not read (overwritten by the box scan). Box rule as guards (unk2 = 0).
* **CowGuardSpawner** (6 params, t1l8m005 ×8): `spawn<4,…>(v0, v1, 0, v5, CowGuardSpawned)` at its
own position with its chain, then `wait(v3·30)` until the player is > 1.5 cells away and fewer
than v2 of its guards live (the guard does `parent.v6 −= 1` when it dies). So p0 = view range,
p1 = chase range, p2 = max guards, p3 = interval (s), p4 not read, p5 = guard p3 (unused). The
spawner must stand in a box with unk2 = 0 or each guard is removed at once – 1 of 8 originals
(t1l8m005 strat 82) stands 0.12 outside (warning, not verified in game).
* **Alligator** (no params; v0–v6 are locals), **SpawnedAlligator**: odd node count → "Odd number
of WPs!" + remove; outside every box → "Forcing alligator inside first WP box", clamped into the
first box. No unk2 rule. Bites only when `|player.floorHeight − y| < 0.2` and inside its boxes.
* **AlligatorSpawner** (t1l6m003 ×2): p0 max alive (`v3 < v0`, `parent.v3 −= 1` on death), p1
interval s, p2 → spawned `collisionOn 0x8400` when set. The spawned alligator (spawner's chain)
walks straight ahead (`moveForwardQ`, spawner yaw) with a fade-in until it is inside the
*first* box – both originals stand outside it, facing it. Check: warning if the ray misses.
Placement (every path through `Edits.placeStrat`): one 4×4 box around the object, unk2 = 0, guards
event bit 0. In game (TestLevel 6 on t1l4m002): an Alligator added this way appears and snaps at
the llama (`img/editor/obj_game_alligator.jpg`).
### Event bits (global 95)
Setters found by a sweep over the strat code of all 31 levels (`g95 = g95 | (1 << (v − 1))`),
v = parameter: TipoVillage p6, ChacaVillage p6, SmashStatueSmall/Big/Door p0, RiverCrocGame p1,
RiverTriggerBox p0, KidOnCanoe p4, YzmaRiver p2 and p6, Condor p2 (also clears it), GoldIdol p1,
CityWall p4, NakedPeacock p0, LabSlidingDoor p5, LabSlidingDoorJamie p5, LabBigCutscene p1, LabWall
p4, EndGameTriggerBox p0 (`EventBits`). No native code touches global 95. Check: lab level
t1l8m001 – LizardGuardNoCoin bit 8 ← LabBigCutscene p1 = 8, GorillaGuard bit 30 ← LabWall p4 = 30;
CowGuard bit 20 and CowGuardNoCoin bit 1 have no setter in the level (they never appear in the
original either). `ObjectChecks` adds this to the guard info, naming the setter types of the base.
### Start camera (Llama waypoints)
Camera strat (spawned by the Llama with `self.hasWaypoints`), case g0 = 4 at level start, L_1330:
walks the Llama's chain; the first node with `playerDistToWp < 2.5` becomes the camera position,
yaw = angle to the player; if the node's wpParam (unk2) ≠ 0, also g47 = x/z distance and g48 =
height difference, and g43 = 3 blocks the approach to the normal distance until the llama moves.
The defaults are g47 = 1.0, g48 = 0.5 (Camera params from the Llama spawn). Originals: one node per
entry door (unk2 4096 on some), none within 2.5 of the village starts. The old editor setup (and
levelbuild) copied the prototype chain onto the llama: village 2's node 2 has unk2 = 4096 → camera
in the llama's head until it moves (seen in game). Fix: `PlayerStart` (one node 2 behind, unk2 0;
moving keeps door nodes). Village fly-by: CutSceneTrigger on the start, radius² 0.5; p6 bit 1 makes
it (L_0148) rewrite its last path node to a point behind the player – set when the start moves.
The rest (~145 placed types) shows raw values with the original statistics. Next candidates:
PressurePadDoor (bit field), TargetRopePlatform, CataSwingingBlade (speeds/angles), RiverLog.
Tooling used (not in the repo): Ghidra script decompiling the handler table, a Python sweep
disassembler with an op-name table, "parameter use" context dumps per type.