feat(model): a paused scene stops movement and spell visuals too

scene:SetPaused stopped only what runs on the M2 scene clock (scene
+0x0C): the animations, GetSceneTime and the scene timers. The mover
ticked on the OS clock, as the client's does, and the casts stepped by
the frame's elapsed time. A paused scene therefore still moved its
actors in a frozen pose and flew its missiles.

The scene clock is the scene's world time, so the actors now run on
it:

- The mover (Mover::Init, Mover::Tick) and the body-facing stamps
  (the catch-up turn of 0x600CD0) read the scene clock through the new
  Model::Scene::ClockMs. The spline start (b.clock) stays in the same
  base. Mover::Tick does nothing for a zero window, so a paused scene
  holds every body. On unpause the body sees only the time the scene
  ran, so nothing jumps ahead.
- Actor::Update takes the ms the scene clock moved this frame, as
  seconds, for Casts::Update (precasts, missiles, impacts, stuck
  arrows). That is 0 while paused. OnUpdate keeps the frame's elapsed
  time.
- The move marker's pulse (0x611400's sine over 0x860AE0 ms) reads the
  scene clock where the world's reads the OS clock, so it holds too.

FUN_SIMPLEMODEL_GET_SCENE (0x76CFC0) makes the scene on first use, so
a scene frame always has a clock to read. A hidden scene runs no
update, so its clock and its actors stop as before.
This commit is contained in:
Brues
2026-11-11 08:07:49 -06:00
parent edd7fb8577
commit 70a6b99bfe
4 changed files with 48 additions and 26 deletions
+15 -4
View File
@@ -19337,13 +19337,24 @@ current frame. `false` starts the animations again from the same frame.
`affectsGlobalPause` has no effect. To pause one actor, use
[`actor:SetPaused`](#actorsetpausedpaused--affectsglobalpause--actorgetpaused).
The clock of the scene ([`scene:GetSceneTime`](#scenegetscenetime)) and
the timers of the scene stop with the animations.
These also stop with the animations:
- The clock of the scene ([`scene:GetSceneTime`](#scenegetscenetime)) and
the timers of the scene.
- The movement of all the actors: walking, running, jumping, falling,
swimming and `MoveTo`. A movement command that you give while the scene is
paused starts when the scene starts again.
- The spell visuals of `PlaySpellVisual`, and missiles in flight.
- The click-to-move marker of `scene:SetMoveMarker`.
When the scene starts again, each of these continues from where it stopped.
The `OnUpdate` scripts of the actors continue to run while the scene is
paused.
### `scene:GetSceneTime()`
Returns the time on the clock of the scene, in seconds. The clock starts
at 0 when the scene is made. The actors animate by this clock.
at 0 when the scene is made. The actors animate and move by this clock.
The clock stops while the scene is paused (`scene:SetPaused`) and while
the scene is hidden. This is a ClassicAPI extension.
@@ -19701,7 +19712,7 @@ scene shows one marker. A new call moves it to the new point.
- In a scene with a WMO, the marker lies on the faces of the WMO near the
point. In a scene with no WMO, it lies flat at the height of the point.
- The marker pulses between 0.5 and 0.75 yards in size, two times each
second. It pulses also while the scene is paused.
second. It stops while the scene is paused.
- The marker stays until you call `ClearMoveMarker`. It does not go away
when an actor gets to the point.