How to get the list of active scenes?


(Harald Schuster) #1

Hi,

once again after many hours of fruitless search through the documentation and Google …

I have a couple of scenes that are VERY intrusive so I need to make sure that no other scene is running (imagine the Butler scolding you for dropping the newspaper on the floor while you are dangling over the pitfall trap).

So I need to check on every turn if another scene is running and strike as soon as this is not the case (and block things from retriggering).

But no matter what I tried …

let L be the list of active scenes
let L be the List of running scenes
let L be the list of scenes running

Compiler error, compiler error, compiler error … and NO hint anywhere what the syntax might be.

Is it just not possible to see what is running?


(bg) #2

Aside from the testing command SCENES, I don’t know if there’s a built-in way to access this or not.

But if you want the list, you could do this:

To decide which list of scenes is the list of active scenes: let L be a list of scenes; repeat with S running through scenes: if S is happening, add S to L; decide on L.

You can then refer to the list as “list of active scenes.”

Or, if you just want to know if any scenes are running (other than the entire game, which is always running), and you don’t need to know what they are, you could do this:

To decide if any non-entire-game scenes are active: repeat with S running through scenes: if (S is not Entire Game) and (S is happening), decide yes; decide no.

Then you could use the condition “if any non-entire-game scenes are active” in a rule.

EDIT:

Actually, this seems to work without defining anything:

list of scenes which are happening

(Harald Schuster) #3

Sometimes I could hug and kiss the Inform inventors, sometimes I cold strangle them.
Scenes that may only begin (but not start) and scenes that are “happening” and it has to be “which are happening” … And thanks to the “let’s not bore you with a complete manual where we list ALL appropriate actions and rules, let’s make it more fun by spreading information all over the place” approach … my head bangs on my desk :slight_smile:

Thanks for the reply. There’s always Entire Game running and my intrusive scene when I check this in When scene begins - so if the number if entries is > 2 I have another scene running and I have to set a global variable that defers the action and has to rely on a on turn event that is being processed when the global variable is set and checks for running scenes itself. As soon as the number of “happening” scenes is 2 I can reset the global variable and safely execute my intrusive action …

Took me longer than expected and I could not have done it without your feedback -thanks. :slight_smile:


(bg) #4

Now that you mention it, it seems like “which are” might not be necessary.

list of happening scenes

seems to compile.


(Hanon Ondricek) #5

There is a debug command SCENES which will notify you while you’re playing the game as scenes stop and start. Also, when you turn it on, it gives you a list of what scenes are running.

The other thing you can do if it’s helpful is use adjectives.

A scene can be happy or combat-enabled. Reunion is a scene. Reunion is happy. Instead of attacking someone during a happy scene...

See 10:4

So

A scene can be perilous or humdrum. Instead of the butler scolding you during a perilous scene...


(Andrew Plotkin) #6

People complain about this, but I bet no two of them would agree about what “appropriate” means for any given topic. :confused:

If you look in the index under “Scenes”, there’s a bunch of references.


(Harald Schuster) #7

Well, thanks for the feedback - I should have been more specific in asking how to evaluate the “running” scenes from within the scripts as I was aware of the scenes command.

One small notice, though, from another thread in case someone else reads htough this:

As of Inform 7 Build 6M62 using “during [property] scenes” causes a compiler error.

“while a [property] scene is running” is the workaround.

So, despite the example being in the manual:

A scene can be thrilling or dull. Train Stop is dull.
A scene has a text called cue speech. The cue speech of Train Stop is "All aboard!".

Before going north during a dull non-recurring scene, ...

will cause a compiler error. It will work if slightly reworded into:

A scene can be thrilling or dull. Train Stop is dull.
A scene has a text called cue speech. The cue speech of Train Stop is "All aboard!".

Before going north while a dull non-recurring scene is happening, ...