WP-021: Clickable actions: state letters, sounds and the ghost (Gen 1)

Status: ✅ Done (2026-11-14) Phase: 3 (game logic: the default object behaviour) Depends on: WP-018 ✅ (hit test, rollover cursor), WP-019 ✅ (sound), WP-020 ✅ (characters, input lock) Companion EC: none (inline checklist under Exit criteria) Estimated effort: One day Pre-flight: pre-flight-WP-021-2026-11-14


Result (2026-11-14)

Exit criterion Result
1. Every click matches ✅ At script level 3 the engine loads each room afresh for each clickable and clicks it twice. For each click it logs the state played, its step count, the sound (or -), the next state and the ticks until the object rests. An independent Python reference implements 0x401440/0x401650 on probe_art.py and probe_audio.py. The logs are identical: Showdown 192 lines (191 clicks; the chandelier pump can’t be clicked a second time), Phantom 174 clicks (MD5 6003f21c… and f5899fef…), 0 stuck.
2. Live click, state kept ✅ A real mouse click on Town Center’s OBJ_P01_TC_HOTSPOT1 played ANIM_P01_TC_HOTSPOT1A with SFX_P01_TC_HOTSPOT1A, and the object rested on …1B 54 ticks later (18 steps × 3). The gang went to Street 3 and back. Town Center then drew with a different MD5, showing …1B, and a second click played …1B with its sound and rested on …1C.
3. Live ghost ✅ ghost_chance=1, in Phantom’s Souvenir Shop. A click on OBJ_P03_SOUVENIR_STORE_HOTSPOT1 played Ghost_Appears, and each character’s Global.Scared line where the clip exists (there is none for Scooby). The ghost played its 75 ticks, and ROOM_Ghost_Spot loaded (1280×480).
4. Build and diff ✅ Scooby-only build: 0 errors, 0 warnings. Fork commits b18b5f6a53 and 4f135d3a9f stage their files by name, inside engines/scooby/, on top of WP-020’s 7e03ae779a, and are pushed.

Deviations:


Goal

Clicking a clickable object does what Scooby.exe’s default clickable does: it plays the object’s current animation once with its sound, moves the object on to its next state, and remembers that state when the room is left and entered again. Now and then a click calls the ghost instead.

Background

WP-018 shows ANIM_CURSOROPEN over a clickable and does nothing on a click. The 103 clickableobject sections in Showdown’s object.ini carry only ID=, and sometimes priority= and layer=. Their sequence= keys are all empty. Everything a click does comes from the code and from the names of the animations the room places.

Traced headless in Ghidra 12.1.4, in a scratch project of Showdown’s Scooby.exe (SHA-256 1328…7478):

Data check (scratch script over probe_art.py and probe_audio.py):

  Showdown Phantom
Clickable placements 96 87
… whose SFX_ sound exists 59 66
… whose next state is a different ANIM 40 49

Both titles have a ROOM_Ghost_Spot scene block.

Clickables without a sound are mostly ones story rooms drive (Boot Hill’s graves, the saloon keys, Gummy’s bells). By default they still play their animation and advance.

Scope

In scope (fork, engines/scooby/ only):

Out of scope:

Exit criteria

  1. For every clickable in every room of Showdown and Phantom, the engine’s simulated click matches an independent reference built on probe_art.py and probe_audio.py: the sequence, its step count, the sound (or none), the next state, and the tick the object comes to rest.
  2. Live: a click on a clickable plays its animation once and its sound, and the object rests on its next state. Leaving the room and coming back keeps that state. A second click plays the next state.
  3. Live: with the chance forced to 1 (a debug config key), a click in a Phantom ghost room shows the ghost, plays Ghost_Appears, scares the gang and loads ROOM_Ghost_Spot.
  4. Scooby-only build: 0 errors and 0 warnings. The fork diff stays inside engines/scooby/, staged by name.

Deliverables