im fully aware of bitd clocks (which is why my interest was piqued)! i am wondering if (like bitd) there could be lost progress in a plot/clock or competing plots/clocks between pcs and npcs
I’m not 100% sure I provided a way to reverse progress but it would be a trivial modification. And you could certainly run competing @plots.
I could see for example having a @quest listen to one or more @plots and update its own status accordingly.
It wasn’t a use-case I had anticipated but the next version of Rez will include revert API for @plot clocks.
Both @plot and @quest support subscribers that receive events when they change state. This makes it easy to wire them together.
For example you might have a @quest to deliver a cargo and have a @plot tracking customs suspicion. The plot notifies the quest that customs have identified the player, and the quest automatically botches (also notifying its subscribers).
I was asked for a demo of this scenario, so here it is: the customs demo.
It’s rather rough & ready, but… you get to accept the quest and try to smuggle cargos.
There is a plot for smuggled cargo and customs interception. Each time we roll 1d6 on a 1-2 the customs intercept, on a 3-6 you succeed. If you get caught 2 times you fail the quest, if you smuggle 5 cargos you succeed and get a reward.
The @quest listens to the two @plot elements for their status. If the customs plot completes progress it botches the quest. If the smuggling plot completes the quest is marked as achieved.
Just to toot my own horn a little I love that I can make these games self-documenting by using @pragma(after_process_ast) source_explorer that creates an HTML page including all the source and bundles it into the game distribution. I still think this is really cool.
The UI was so ugly, even for a quick demo, so I’ve tidied that up.
You might reasonably ask the question: couldn’t we just have cargo, inspections, and smuggling as variables on the game? Why do we need all this @plot and @quest malarky and for such a simple example?
If this was all you had in your game you’d be right, it would be overkill. However, this separation of concerns, is what keeps things manageable once you grow past a handful of each.