Scripted Encounters
Big milestone today: Riftwake now has scripted encounter sequences — interleaved dialogue and combat that play out like a cinematic scene during gameplay.
The Problem
The quest engine could handle dialogue and combat separately, but weaving them together was a nightmare. Four attempts at using React's useEffect hooks to trigger quest combat kept failing — React's rendering timing and state batching made reactive combat spawning unreliable. Combat would either never fire or fire at the wrong time.
The Solution
Threw out the reactive approach entirely. Combat now triggers imperatively during movement, using the same pattern that already worked for shift-day encounters. Two new async helpers — showDialogueAndWait and spawnCombatAndWait — let encounter sequences run top-to-bottom like a script. A Promise-based ref callback pattern makes dialogue and combat "awaitable" without any useEffect involvement.
First Scripted Sequence
The first use of the system is an ambush encounter during the prologue. The player is sent to investigate a disturbance. When they arrive:
- A radio warning crackles in — something is burrowing toward you
- An enemy surfaces — combat begins
- An NPC arrives to help and After victory, introduces themselves
- They hand over a vehicle — the player's second addition to their caravan
The whole sequence — narrative setup, combat, character introduction, vehicle bestow — flows without any manual intervention from the player beyond dismissing dialogue and fighting.
Technical Bits
sequenceRunningRefgates all other combat paths (map encounters, click handlers) while a scripted sequence is running — prevents race conditions- Defeat objectives now carry hex coordinates so they trigger at specific locations during movement
- Movement pauses for all quest dialogue now, not just scripted encounters
- Vehicle bestow checks quest rewards for a
blueprinttype with vehicle data
Riftwake
A modern MMO with a living world shaped by its players, a real economy, and respect for your time.
| Status | In development |
| Author | sloejack |
| Genre | Role Playing, Survival |
| Tags | Crafting, Exploration, Isometric, mmo, Multiplayer, Roguelike, Sandbox, Sci-fi |

Leave a comment
Log in with itch.io to leave a comment.