Proper way to block an action from proceeding

hi, all. my current project is stalled due to my fundamental inability to comprehend how rules work, evidently. here’s a sample I’m working with with currently:

Check quizzing Norman about something: do norman check. instead of requesting Norman for something: do norman check. Instead of informing Norman about something: do norman check. Check saying hello to Norman: do norman check.

To do norman check:
	if the software priority of chat-app is greater than 1:
		say "You should have Chat active if you want to talk to Norman." instead;
		rule fails;
	if variable-truth-state-1 is true:
		silently try examining the PC instead;
	if variable-truth-state-2 is true:
		say "Norman is beyond reach while you're unable to click and/or type." instead;
	rule succeeds. 

current output indicates the rule does not stop the action from being performed:

>talk to norman
You should have Chat active if you want to talk to Norman.

You say hello to Norman.

YOU: Hi, Norman. Got a second?

NORMAN: yep what's up

>

I’ve read the documentation, I’ve read the Inform Handbook. this is probably elementary, but for whatever reason, this is a particularly difficult concept for me to absorb. any help would be gratefully accepted.

If you’re used to more traditional programming languages, “rule succeeds”, “rule fails”, and “make no decision” are all different ways of returning from a routine. (“Rule succeeds” and “rule fails” set an outcome variable, then return true; “make no decision” returns false.)

As a result, using them inside “do norman check” won’t return from the instead rule; it’ll return from the norman check routine. You might want something like this.

Quizzing Norman about something is Norman interaction.
Requesting Norman for something is Norman interaction.
Informing Norman about something is Norman interaction.
Saying hello to Norman is Norman interation.

Instead of Norman interaction:
    if condition 1 is met:
        say "Message here.";
        stop the action;
    otherwise if condition 2 is met:
        say "Other message.";
        try doing something else instead;
    [and so on...]
    otherwise:
        continue the action.

There is a way to call a rule and then return whatever it returns (“abide by the whatever rule”), but I think that’s overkill for this situation.

1 Like

thank you – that did it. I had something like this originally but without the continue/stop the action statements, so I made the assumption I’d chosen the wrong syntax.