Inform7: scenes which have happened

Hi all

I find during testing that the documentation appears to be not quite correct in explaining how scene conditions work (or maybe I am just misinterpreting things here?).

Referring to 10.4. During scenes (ganelson.github.io):

if (scene) has happened:
This condition is true if the given scene has both begun and ended.
if (scene) has not happened:
This condition is true if the given scene has not ended (or never started).

that is what the docs state… but what I observe is actually that this condition becomes true when the scene is started, not when it ended…

So should I read “has happened” to actually mean “has started at least once
and “has not happened” to actually mean “has never started”?

I think you are interpreting things correctly. Perhaps the wording in the docs needs amendment?

I tried a simple test which seems to back up your theory.

The lab is a room. "A dreary lab.". Understand "icy/cold" as wind.

The wind is a backdrop in the lab. "[if the window is open]You feel the icy chill of the December air gusting through the open window[else]There is a faint chill in the air from the December winds outside[end if]."

There is a window in the lab. The window can be openable. The window can be open or closed. The window is openable. The window is closed. The window is fixed in place.

[The wind blows scene has to be recurring otherwise the scene will only 'fire' once]

The wind blows is a recurring scene. 

The wind blows begins when the window is open.

The wind blows ends when the window is closed.

When the wind blows begins:
	say "A huge gust of icy wind blows through the open wind."
	
When the wind blows ends:
	say "You get some respite from the icy wind by closing the window."

Every turn:
	if the wind blows has not happened:
		say "The wind blows has not happened is true.";
	else:
		say "The window blows has not happened is false.";
	if the wind blows has happened:
		say "The wind blows has happened is true.";
	else:
		say "The wind blows has happened is false.".
		
Test all with "Scenes/Look/open window/close window/Look"

I just tested with 10.1, 6M62 and 6G60, and they all do the same thing. The documentation also says the following, which is always true when a scene is happening.

We need to be a bit careful: it’s possible to set things up so that the Train Stop scene will play out more than once, so “Train Stop is happening” and “Train Stop has happened” might both be true at once.

The whole “has happened” and “has ended” conditions are less useful than they seem; for recurring scenes “has ended” and “is happening” can both be true at once!

1 Like

In normal operation, yes.

Under the hood at the I6 level, the array scene_endings tracks the ending status of each scene. Each word in the array corresponds to a scene. For each word:

  • when the corresponding scene begins, bit 1 (least significant) is set
  • when the corresponding scene ends, bit 2 (second least significant) is set

These are one-way transitions; once the bit is set it stays set (under normal operation).

The relevant phrases from the Standard Rules (with translation comments) are:

Section SR5/5/5 - Model world - Scenes

[true if any bit is set for the scene]
[true if at some point scene has begun, scene has ended, or scene has both begun and ended]
To decide if (sc - scene) has happened
	(documented at ph_hashappened):
	(- (scene_endings-->({sc}-1)) -).


[true if no bit is set for the scene]
[true if scene has at no point either begun or ended]
To decide if (sc - scene) has not happened
	(documented at ph_hasnothappened):
	(- (scene_endings-->({sc}-1) == 0) -).

[true if at least one bit above the least significant is set for the scene]
[true if scene has at some point ended]
To decide if (sc - scene) has ended
	(documented at ph_hasended):
	(- (scene_endings-->({sc}-1) > 1) -).


[true if no bit above the least significant is set for the scene]
[true if scene has at no point ended]
To decide if (sc - scene) has not ended
	(documented at ph_hasnotended):
	(- (scene_endings-->({sc}-1) <= 1) -).

In practical terms (for normal operation), has happened is synonymous with “has begun at least once”, while has not happened is synonymous with “has never begun”. For a recurring scene, has happened can be different than is happening.

To build some functionality that better fits the description of has happened in WWI 10.4 During scenes, you can try:

To decide if (sc - scene) has concluded:
	(- (scene_endings-->({sc}-1) & $$11 == $$11) -).
To decide if (sc - scene) has not concluded:
	(- (scene_endings-->({sc}-1) & $$11 < $$10) -).

This winds up being the same in practice as “has ended” / “has not ended”, right? Since state $10 is normally impossible.

1 Like

There is (as you’ve doubtless noticed) another I6 flag scene_latest_ending–>({sc}-1) which starts off as 0 then flips to 1 whenever a scene ends and back to 0 whenever a scene starts-> it’s an indicator that the last start/end of the scene was an end. This seems a redundant convenience, since in normal operation (((scene_status–>({sc}-1))&1)==0 )&&((scene_endings–>({sc}-1))==3) == scene_latest_ending–>({sc}-1).

EDIT the I7 equivalent is MyScene is not happening and MyScene has ended

Yeah. So ‘has happened’ means ‘has at some point, at least once, started’ and ‘has ended’ means 'has at some point, at least once, ended.

Although the documentation states incorrectly that ‘has happened’ means ‘has both started and ended’, that meaning itself (which could be provided in practice by 'MyScene has happened and MyScene has ended) is unhelpfully redundant, being equivalent simply to ‘MyScene has ended’.

1 Like

Yes, I think so. I wrote them that way to be a direct translation of the way that the happened phrases are defined in WWI 10.4, but it does look as though in normal operation they would mean the same thing as the built-in ended phrases.

If a scene has multiple named outcomes, this array also records which one it was. So it’s only redundant for scenes that don’t have multiple outcomes.

2 Likes