This is exactly what Scenario was designed for, and of course it's an official part of the Sphere now thanks to me.
The last standalone version of Scenario (3.8.1) actually included scenelets for moving persons around the map, but I removed them from the miniSphere version since the map engine is eventually going to be phased out. There's nothing stopping you from implementing them yourself, though. Anyway, how your example would look in Scenario is:
import { Scene } from 'sphere-runtime';
new Scene()
.move('scott', 'north', 3 * 16)
.move('lauren', 'south', 3 * 16)
.talk("maggie", "I'M HUNGRY!!! *munch*")
.pause(5.0);
.talk("Lauren", "You know Scott, pigz r dum!")
.fork() // fork the timeline
.move('scott', 'north', 10 * 16)
.end()
.move('lauren', 'north', 10 * 16)
.resync() // ensure forks have finished
.run(false); // false = non-blocking, return immediately
And a
.move scenelet might look like this:
Scene.defineAction('move',
{
start(scene, person, direction, steps) {
this.name = person;
// TODO: figure out commandID to send based on direction parameter
for (let i = 0; i < steps; ++i) {
QueuePersonCommand(person, commandID, false);
}
},
update(scene) {
// return true to continue, false to finish
return !IsCommandQueueEmpty(this.name);
}
});
Note that the resync in the above example scene is actually redundant, since there's an implicit sync point at the end of a timeline (= the timeline won't end until all its forks have). I only put it there to illustrate its purpose.