Fast-Forwarding Scenes w/ Eric Eve's Scene Manager

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

     execAction() { 
        mainReport('<i>Fast-Forwarding: this will take a moment... </i>'); 
        gPlayerChar.ffwing = true;

     ('ffw' ) 
     : FfwAction
     verbPhrase = 'fast-forward/fast-forwarding'

Then, for every scene you want to be fastforwardable, add this:

endsWhen = ([b][i]gPlayerChar.ffwing || [/i][/b]gRevealed('amy-n-oscar'))

I know, it seems you ought to be able to automate this, but I’m just not understanding the resulting behavior well enough.

This is the output:


You should be able to automate it by overriding sceneController’s sceneCheck method.

modify libGlobal
    ffwing = nil

modify sceneController
        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)))
            /* Check if any non-active scenes are due for activation */
            if(!cur.isActive && cur.startsWhen 
               && (cur.isRecurring || cur.timesActive == 0))            

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.

Thanks for the thoughts and the code, Ben!

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.

I’ll take your code for a spin later today.



That code works like a charm.


Glad to hear it. :slight_smile: