# Viability of concept for Forced Action Sequences?!

Hi,

first let me define “forced action sequence”:

During a forced action sequence many “normal” options may not be available to the player. The player can still do (or try to) a couple of commands, though. The player, however, is REQUIRED to do something within a certain time limit. Now, a typical scene might be:

Player is at home and suddely there is a stranger in the room who happens to point a gun at the player. Forced action sequence begins.
If the player is carrying a gun, it must be dropped
the player has to put everything he carries into a container (makes picking things up more easily later)
the player has to kneel to be frisked
the player has to sit on a chair and will be bound to it
the player has to tell the man about “the loot” or something other
After that the stranger leaves and the forced action sequence ends

The player is now faced with a timed escape puzzle before the enraged stranger returns, having found out he has been lied to about the loot’s location …

During the forced action sequence the player will not be left in doubt what he is supposed to do as the stranger issues clear commands. During each step in the sequence a “patience” counter runs down and at one point the command will be repeated. Once the pointer reaches 0 the player will be subjected to a bit of zapping. Which fast forwards the action to the last sequence in the scene - usually an interrogation scene. The “patience” is reset every step in the sequences.

Now - this can be more or less easily handled with scenes where each scene begins as soon as the last stops and a scene stops once the player does as told. The problem with that approach is that you cannot have “kind of scene” and so you’d need a global variable to write the check, before and instead of rules. But that’s manageable. “now forcedaction is 1” for the first scene, for example or you have another scene that runs from start to finish and sequence specific scenes (see example below).

Let us assume, however, that the commands are a bit on the random side. So the player might not be told to sit on the chair. He might be told to kneel on the floor, lie down on the floor, sit on the chair, lair down on the bed, at random, making things a bit more difficult but that can probably be solved by tying the scene to a global variable and checks with after rules to see if what the player did is actually what he was supposed to do. Like, you know that in this step the player is supposed to enter a supporter. Randomize the supporter and store it in a variable. Do an every turn check during this sequence and check if the player is on the right supporter. If so set global variable stage_number_complete to 1. Have the scene tied to the value of this variable.

The problem I haven’t found a good solution for so far, though, is this: How do I prevent the player undoing steps in the sequence at a later time. So, if the player is supposed to drop the gun in step 1, causing scene 1 to stop and scene 2 to start - if the player picks the gun back up in step 2+ … meh.

The only solution I have been able to come up with so far is to disallow certain commands based on a stage counter:

``````instead of taking the gun when stage_number_complete > 1:
Say "You've been told to drop it and you value your health too much to disregard that request." instead``````
``````instead of taking anything when stage_number_complete > 2:
Say "You were told in no uncertain terms to drop everything you carried into the bag. Surely that was not an offer to restock your inventory again!" instead;``````

And so on …

Sample Scenario - no patience counter, no randomized commands:

``````"ForcedAction-Test" by Harald Schuster

Hereandnow is a room.

the gun is a wearable thing in the hereandnow.
the chair is an enterable supporter in the hereandnow. it is fixed in place.

stage_complete is a number that varies. stage_complete is 0;

ForcedAction is a scene.
ForcedAction begins when the player carries the gun.

Stage1 is a scene. Stage1 begins when ForcedAction begins.
Stage1 ends when the player does not enclose the gun.
When Stage1 begins:
Say "A voice sounds: 'Drop that gun!'"

Stage2 is a scene. Stage2 begins when Stage1 ends.
Stage2 ends when the player is enclosed by the chair.
When Stage2 begins:
Say "The voice says: well done, that player! Now ... kindly get on that chair!";
Now stage_complete is 1;

Stage3 is a scene. Stage3 begins when Stage2 ends.
When stage3 begins:
Say "Quite obedient![line break]Unfortunately there's no more code so you're stuck here, I'm sorry for the inconvenience.";
Now stage_complete is 2;

Instead of taking something when the player is enclosed by the chair:
Say "The stuff is too far away for you to pick it up. Get your butt off the chair first!" instead;

Instead of taking the gun during ForcedAction:
if stage_complete > 0:
Say "You've been told to drop it and you value your health too much to disregard that request." instead;

Instead of wearing the gun during ForcedAction:
Say "The voice warns you: Don's even think of it!" instead;

Say "In your panic you try to flee but bump into a wall." instead``````

Now, I’ve done some initial tests (see example) and this seems to work out. My question to the more experienced folks out there … is this viable, is there a better way, is there perhaps an extension/framework that handles things like that?

If the set of allowed commands is considerably smaller than the set of disallowed commands, you can create a kind of action based on the allowed commands and then create a blanket blocker that handles everything except those.

[code]Looking is allowed. Examining something is allowed. Dropping the gun is allowed. Entering the chair is allowed.

Instead of doing something when the current action is not allowed, say “The intruder waggles his gun. ‘Uh-uh. You do what I tell you, nothing more.’”[/code]

Yes, I ran across that in in an example but I didn’t use it here. The general idea is to uase a “instead of doing anything other than …” to fire a general block message at the player and some more detailed ones (like panic when trying to move) for other disallowed actions that warrant a reason why something is not allowed.

In a house, for example, moving WOULD be allowed (how else to do Now, let’s get to the basement, shall we?) but leaving the house via entrance or porch would be blocked. Once in the basement movement could be blocked completely. I’d just have to make sure the scene does not start when the player is in the basement to avoid the strange chain of events of the player being allowed to leave only to return a few steps later. The joys of something as dynamic as IF in Inform.

A scene is a kind, so I believe you are allowed to have “kinds of scenes”, or at least categorize them with adjectives.

From the documentation 10:4

Since you’re basically wanting a restrictive cutscene, you could also just ask the player yes/no questions “Do you want to sit in the chair like Mugsy told you to?” using “If the player consents” instead of making them guess-the-verb.

But you’re bang right on the property thing which I completely overlooked and which should work very, very nicely.

Although, sigh …

“During a restricted scene” should work but doesn’t; I’m pretty sure this is a bug that has been reported. However, you can say

``Instead of going when a restricted scene is happening:``

…which does the same thing.

Thank God there is an alternative that works - thanks for that. Yep, seems the way it is supposed to be defined is bugged.

Yes, this has been reported. Issue 1823 in the bug tracker.