Skip to content

Writing a discovery-style scene

Not a Hermes-specific API — this is the base game's own tag-dispatch mechanism ((location)_exit / (location)_options, refs/x-change-source/project/twee/10-systems/utility/passage tags.twee), and the pattern below is just how this mod used it for its own found-phone reveal. Any mod wanting a "player stumbles onto something" moment in an existing location can use the same technique; mall-discovery.twee and home-discovery.twee in this repo are real, shipped, working examples to read directly rather than a spec to follow blind.

The one decision that actually matters is which tag you hook, because it changes what's safe to do in response:

  • (location)_exit-tagged passages fire from a location's own dedicated "Leave" link, at the moment the player clicks it. Nothing else renders after that click, so it's safe to (cs:"your scene") immediately — mall-discovery.twee's trigger does exactly this.
  • (location)_options-tagged passages fire MID-RENDER, with real content from that screen still to come after the tag point (a Sleep link, another (display:), whatever else that location's own options screen renders below it). (cs:)-ing from here wipes all of that before it ever renders — a real bug this mod shipped and had to fix once (home-discovery.twee's own trigger comment has the full account). Append an isolated (link:) instead and defer your actual scene takeover to that link's own later click; by then the rest of the screen has already rendered and there's nothing left to wipe. One extra click to start, but nothing gets clobbered.

Beyond the trigger itself, the shape that's worked well here: split the reveal into small beats (noticing → handling → the actual reveal), each its own passage reached via (cs:), and hold off on any permanent state change (an item grant, a flag flip) until the LAST beat — not scene entry — so an interrupted first pass doesn't leave your own state half-set.

Zlib Licensed