The scene begins when...

I’d like the scene to begin when the player examines an object. Inform ain’t havin’ none of that. Why is that? Syntax issues?

Scene is a scene. Scene begins when the player examines the rock.

Inform says there’s no condition for it to check.

I don’t see this in the documentation. I don’t see this in the examples I’ve been reading. Is there a list somewhere that tells what a scene can and cannot start with? Or am I phrasing it wrong? Do I need to just sit down and read all of the rule books? I didn’t see anything in the scene index, but since I can’t run the game, it’s not generating a new scene index for me to look through…

Grr.

I don’t think scenes can begin when an action happens.

But ‘Scene begins when the rock has been examined’ might work.

No go.

I’ll dig some more into it. There has to be a way to work around it.

I’m sure that those who know what they are doing will suggest a much better approach, but have you tried creating a truth state variable, using an “after” rule to set it to “true” after the object has been examined, and having the scene begin when that variable is true?

[code]

LookedAt is a truth state that varies. LookedAt is false.
After examining the whatchamawhozit:
Now LookedAt is true.
Newscene is a scene. Newscene begins when LookedAt is true.[/code]

Robert Rothman

Scene-x is a scene. Scene-x begins when we have examined the rock.

The history mechanism doesn’t store enough information to distinguish who did the examining (a player or NPC). Thus, the vague wording “…we have examined…”

1 Like

Oddly, neither of those solutions worked. I tied the scene start into a number I already had attached to the object, which is a perfectly acceptable work around.

Scene1 begins when the number of the rock is less than 50.

Something along those lines. That seemed to fire the scene.

If you have a rule that stops the action sequence in a failure the game will not mark the action as successfully executed. For example if you have an “Instead of examining the rock” rule, you have to add “rule succeeds” at the end for the “when we have examined the rock” to work.

That may very well have been the problem, Juhana. I’ve been taking a “learn as you go” approach to this entire process and have yet to come across a need to the “rule succeeds” bit (not counting this) and so I’m not entirely sure what it means or when to use it. I’ve been skimming through Jim Aikin’s excellent Inform Handbook and haven’t come across it yet. I’ve only today said to myself, "Self… read the friggin documentation. "

So that’s what I’ve been doing. For now, the way it’s set up is fine. Hopefully should the need arises again, I’ll remember about the rule succeeding bit.

I appreciate everyone’s input.

I don’t think anyone here is going to criticize you for not reading the documentation closely enough. Although Jim’s book seems pretty good, the built-in documentation is notoriously poor. I consider this forum to be the primary source of documentation!

Success and failure of actions takes some time to understand. Here’s a summary:

The command “stop the action” and “rule fails” are roughly equivalent. They will abort the current action whether you’re in the check, carry out, or report rulebook. Not only will the current rulebook halt, but none of the following action specific rulebooks will execute. Therefore, it is a bad idea to use these phrases in a carry out or report rule.

If you “silently try” an action, the check and carry out rulebooks will run, but the report rulebook will not.

A rulebook has a default outcome. All the action specific rulebooks have a default of “continue the action,” which means the same as “make no decision.”

The Before rulebook also defaults to “continue the action,” but the Instead and After rulebooks stop the action by default (Instead stops the action with failure, and After stops the action with success). Before, Instead, and After rulebooks can apply to multiple actions (e.g. “doing something,” “examining or touching”) - check, carry out and report rules only apply to a single action (e.g. “examining”).

This is the order of action processing rulebooks:

Before
Instead
check
carry out
After
report

An action is considered successful if it makes it through the entire check rulebook without a “stop the action” or “rule fails.” You can abort an action and call it a success by saying “rule succeeds.” Here’s a twist I discovered when playing around: an action is also considered successful if a check rule triggered a “try” that ended in success, even if the triggering rule exited with an “instead” or “stop the action.” “Rule fails” always causes the action to fail, though, and this is seems to be the default for Instead rules.

The “actions” debugging command is really useful in this kind of case - it will tell you what actions are triggered, and whether each one was successful.

One last note: “we have examined the notebook” is only true if the action was successful, but “examining the notebook” is true even if it failed. A warning, though - the latter phrase is only true if a command was parsed as the action - it won’t be true if the action was triggered by a “try” phrase.

Here’s an example:

[code]Test is a room.

A newspaper is in test.

Check touching:
instead try examining the noun.

Every turn when we have touched the newspaper:
say “You successfully touched the newspaper.”

Every turn when examining the newspaper:
say “You tried examining the newspaper.”

test me with “actions/touch newspaper/x newspaper”[/code]

Capmikee, your post was very enlightening to me! I have used the “stop the action” and the “continue the action” phrases, when I figured out that the action was being stopped, but I did not see a pattern before as to when this was happening! The “rule succeeds” phrasing is also new to me. -

THANKS!

I dont understand. Could someone please post the code for beginning the scene. Sorry.