intfiction.org

The Interactive Fiction Community Forum
It is currently Wed Jul 18, 2018 8:47 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Mar 17, 2018 1:19 pm 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 42
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?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Mar 17, 2018 2:01 pm 
Offline

Joined: Thu Oct 30, 2014 12:10 pm
Posts: 627
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:
Code:
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:

Code:
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:

Code:
list of scenes which are happening


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Mar 17, 2018 2:54 pm 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 42
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 :)

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. :)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Mar 17, 2018 3:09 pm 
Offline

Joined: Thu Oct 30, 2014 12:10 pm
Posts: 627
Harald Schuster wrote:
and it has to be "which are happening"


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

Code:
list of happening scenes


seems to compile.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Mar 17, 2018 8:12 pm 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2516
Location: US - Central
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.

Quote:
>scenes
Scene 'Entire Game' playing (for 0 mins now)
(Scene monitoring now switched on. Type "scenes off" to switch it off again.)

The other thing you can do if it's helpful is use adjectives.
Code:
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
Quote:
The kind of value "scene" is one which is allowed to have properties - it has a tick in the "properties" column in the chart on the Kinds index page - and this can be very useful in describing scenes. For instance, we could write:

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!".

Inform has the adjectives "recurring", "non-recurring" and "happening" all built in to describe scenes, and the above would add "thrilling" and "dull". Moreover, the "during" clause of a rule can give a description of a scene as easily as a specific scene name. For instance:

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

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

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Mar 18, 2018 11:01 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5693
Quote:
let's not bore you with a complete manual where we list ALL appropriate actions and rules


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

If you look in the index under "Scenes", there's a bunch of references.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Mar 21, 2018 11:26 am 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 42
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:

Code:
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:

Code:
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, ...


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group