76 lines
4.2 KiB
Markdown
76 lines
4.2 KiB
Markdown
# Player-contact buttons and vertical doors
|
|
|
|
Static recovery and managed integration, 2026-10-24. Original executable SHA-256:
|
|
f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8.
|
|
EXE text file offsets are VA minus0x400000. Originals were only read.
|
|
|
|
## Button contact
|
|
|
|
C3DButton interface+C0 vtable493B60, enter slot40=411BB0, update slot3C4=411DE0,
|
|
activation slot28=4118B0, PostLoad slot404=411EF0. InitObject411B82 sets radius300;
|
|
PostLoad411EF8/411F09 sets authored/current radius300 again. Activation4119A7
|
|
sets150; runtime resizing after subsequent task reactivation remains to be matched.
|
|
The current player contact subset uses normal PostLoad radius300 plus Jimmy60,
|
|
strict overlap and source offsets to distinguish duplicate C3DBUTTON tags.
|
|
|
|
Enter411BC1 accepts the active player or a C3DBASEBALL. The port currently handles
|
|
only player contact. Availability at interface608 must be nonzero, cooldown7B0
|
|
must be<=0. Current definition HIUP (literal4ED9C0) selects the press branch:
|
|
set cooldown4.0 at411C35, optionally play AvailSound at411C92..A2, select DOWN
|
|
at411CAE..B5 and set material RGB(.2,.2,.2) at411CBB..FC. Existing DOWN selects
|
|
UP and original authored RGB at411D59..B1. Material pulse/tint is not yet ported.
|
|
|
|
Resolve ActivateButton through first case-insensitive tag lookup474070. If found,
|
|
call its interface428 with source Toggle (411D18..23). A button target additionally
|
|
becomes available while the caller becomes unavailable (411D29..47). Complete
|
|
generic button-to-button toggle activation is still unresolved by this consumer;
|
|
the lab targets bars, a vertical door. NewTaskState/NASound are serialized but the
|
|
traced ordinary contact path does not consume them. No task award was invented.
|
|
The special LV4B branch411C3F..8F is outside this lab implementation.
|
|
|
|
Update411E24 subtracts dt only for positive cooldown and reactivates/resets at
|
|
<=0, then stores0. Continuous contact does not generate another enter callback.
|
|
SceneMechanisms retains contact membership across cooldown reset.
|
|
|
|
## Vertical door state
|
|
|
|
C3DDoorUpDown interface+C0 vtable4993AC: activation417760, contact4178C0,
|
|
update417930, toggle428=417AC0. Source fields are ItemClosed at5FC, current
|
|
closed flag600, Next604, remaining668, DoorSpeed66C, OpenTime670, elapsed674,
|
|
OpenAmount680. DoorSpeed is used as the movement **duration**, not units/second.
|
|
Initial open state adds OpenAmount to the stored source origin at41777B..AE.
|
|
Origin getter interface164=471600 returns the saved vector atEC..F8.
|
|
|
|
Toggle ignores requests equal to current closed state. During movement it replaces
|
|
remaining with duration-minus-remaining (417AE9..F5); from rest it copies duration
|
|
and starts loop sound59 when no movement sound is active (417B11..43). Next is
|
|
dispatched before assigning closed state (417B49..C01). The current consumer
|
|
handles Next targeting3AIT; other original subclasses remain explicit unsupported.
|
|
Requested0 opens,1 closes; other values toggle (417C01..34).
|
|
|
|
Update first consumes positive remaining by dt and clamps to0. Completion stops
|
|
the movement loop and emits sound58 (417974..AE). Set vertical root to:
|
|
|
|
```text
|
|
fraction = remaining / DoorSpeed
|
|
closed: sourceY + OpenAmount*fraction
|
|
open: sourceY + OpenAmount*(1-fraction), reset open elapsed0
|
|
```
|
|
|
|
There is no leftover-dt integration. Once stationary/open, add dt to elapsed and
|
|
close only when elapsed is **strictly greater** than OpenTime (417A77..AA).
|
|
Lab bars: originY-1076.0883, duration5sec, distance500, open hold3sec, touch-disabled.
|
|
Its two authored buttons use Toggle-1. TouchActivated doors' own contact and
|
|
baseball contact paths remain outside the player-button subset.
|
|
|
|
## Runtime verification and limits
|
|
|
|
Game/SceneMechanisms runs in the same fixed-step scene loop as the director.
|
|
Application/StaticSceneVisuals displays UP/DOWN variants and door root movement.
|
|
Two source-data regression groups cover strict360 contact, four-second reset,
|
|
duplicate tags, contact persistence, five-second opening, continuous reversal,
|
|
sound-loop lifetime, exact endpoints and strict three-second hold expiration.
|
|
These checks establish port behavior from static evidence. Moving-object physics,
|
|
material pulse, sound-bank resolution, full task/reactivation behavior and original
|
|
runtime comparison are not established by these tests.
|