Ideally, no one will want to fast-forward your scenes. But this may be useful as a debugging command, as well as for players who might otherwise complain about the pages being glued together.
EDIT: Last version of the code had an amazingly weird bug that has produced seemingly impossible output I simply cannot comprehend. This version does not … but is not automated: it involves an extra step in game production.
In your Verbs file, this bit:
///////////////////////////// ** FFW ** ///////////////////////////////////
modify Actor
ffwing = nil
;
DefineIAction(Ffw)
execAction() {
mainReport('<i>Fast-Forwarding: this will take a moment... </i>');
gPlayerChar.ffwing = true;
}
;
VerbRule(Ffw)
('ffw' )
: FfwAction
verbPhrase = 'fast-forward/fast-forwarding'
;
Then, for every scene you want to be fastforwardable, add this:
You should be able to automate it by overriding sceneController’s sceneCheck method.
modify libGlobal
ffwing = nil
;
modify sceneController
sceneCheck()
{
local how = nil;
foreach(local cur in sceneList)
{
/* Check if any active scenes are ready to be ended */
if(cur.isActive && (libGlobal.ffwing || ((how = cur.endsWhen) != nil)))
cur.deactivate(how);
/* Check if any non-active scenes are due for activation */
if(!cur.isActive && cur.startsWhen
&& (cur.isRecurring || cur.timesActive == 0))
cur.activate();
}
}
;
It’s probably also a good idea to store ffwing in libGlobal, rather than gPlayerChar, in case you have a scene that changes the player character upon deactivation. Or in case the player turns on fast forward and then switches to a different actor.
Not sure how you want the player to turn it off, either. A good place would be in sceneCheck, right after deactivating the current scene.
FFW should work like tapping the >> key on your DVD player, and advance to the next scene. Currently, if a scene uses it, the FFWing flag is reset to nil.
I tried to set up a fuse inside the execute action verb method, to handle the case in which a turn has passed and no scene was operative to FFW (and deflag). Couldn’t get that one off the ground. Fuses are hard.