Quick question about 'get all from something'

I’m struggling to understand the actions and rule ‘get all from something’ kicks off when the ‘something’ is empty. Might be a simple one that’s addressed somewhere, but I can’t find anything.

This is the simplest code lump I can do:

The Garden is a room. 	

Bob is a person in the Garden. "Bob wanders about. His pockets are bulging".

The pocket is part of Bob. It is a container.

Which, if I do something like :

>x pocket
[Rule "declare everything initially unmentioned rule" applies.]
[examining the pocket]
[Rule "announce items from multiple object lists rule" applies.]
[Rule "set pronouns from items from multiple object lists rule" applies.]
[Rule "before stage rule" applies.]
[Rule "can't act in the dark rule" applies.]
[Rule "instead stage rule" applies.]
[Rule "investigate player's awareness before action rule" applies.]
[Rule "player aware of his own actions rule" applies.]
[Rule "check stage rule" applies.]
[Rule "carry out stage rule" applies.]
[Rule "standard examining rule" applies.]
[Rule "examine directions rule" applies.]
[Rule "examine containers rule" applies.]
The pocket is empty.

[Rule "examine supporters rule" applies.]
[Rule "examine devices rule" applies.]
[Rule "examine undescribed things rule" applies.]
[Rule "after stage rule" applies.]
[Rule "investigate player's awareness after action rule" applies.]
[Rule "report stage rule" applies.]
[Rule "report other people examining rule" applies.]
[Rule "last specific action-processing rule" applies.]
[examining the pocket - succeeded]

[Rule "A first turn sequence rule" applies.]
[Rule "every turn stage rule" applies.]
[Rule "A last turn sequence rule" applies.]
[Rule "notify score changes rule" applies.]
>

Is fine, but then if I try and ‘get all from pocket’:

>get all from pocket
The pocket is empty.

>

The IDE doesn’t show any rules or actions at all, even though they’re switched on. I have no idea why.

If I have something in the pocket, and a rule like this:

The gold coin is in the pocket.
	
Instead of taking something which is in the pocket:
	say "Bob shouts at you." instead

Then ‘get all from pocket’ works as expected - but how do I replace the actions of the special case when there’s nothing in the pocket?

Two questions :

  1. I’ve got rules and actions tracing on, why is it the inform IDE not showing any for this action?
  2. How do I replace action / rules going thru here when the pocket is empty?

Thanks in advance!

Ade

Hmmm…so, I tried adding this to my code:

Every turn:
	say "tick.".

Here’s the output :

Garden
Bob wanders about. His pockets are bulging

>x pocket
The pocket is empty.

tick.

>get all from pocket
The pocket is empty.

>x me
As good-looking as ever.

tick.

>

So is the special case of taking all from something when the thing is empty an out of world action? Even so, still not sure why IDE is not showing rules and actions and how to replace OOB behavior.

There’s a known bug or bugs involved with GET ALL FROM (SOMETHING). Good news is they have thoroughly discussed and folks have come up with workarounds/fixes you can try. Feast your royal jellies on topics such as this one:

and this one:

-Wade

3 Likes

Hah!! Nice!..Thanks Wade! Appreciated!

Heh. I had those topics in my head but I knew it’d be a pain to find them with this site’s own search. So I did it with Google. i.e. entered

site:intfiction.org “get all from”

You may know that trick already, but it’s a good one if you don’t (for finding things on this site especially, that you know are about the place but you don’t know what they’re called)

-Wade

1 Like

Not an out of world action. Not an action at all, in fact – it’s a parser error.

The reason that no rules are triggered is that no action is generated. The parser is rejecting the command and returning to a new prompt. The relevant code is in the part of the parser code labeled Parser Letter I:

if (etype == NOTHING_PE) {
	if (parser_results-->ACTION_PRES == ##Remove &&
    	parser_results-->INP2_PRES ofclass Object) {
    	noun = parser_results-->INP2_PRES; ! ensure valid for messages
        if (noun has animate) { PARSER_N_ERROR_INTERNAL_RM('C', noun); new_line; }
        else if (noun hasnt container or supporter) { PARSER_N_ERROR_INTERNAL_RM('D', noun); new_line; }
        else if (noun has container && noun hasnt open)  { PARSER_N_ERROR_INTERNAL_RM('E', noun); new_line; }
        else if (children(noun)==0) { PARSER_N_ERROR_INTERNAL_RM('F', noun); new_line; } ! <---  HERE
        else parser_results-->ACTION_PRES = 0;
    }
    if (parser_results-->ACTION_PRES ~= ##Remove) {
        if (multi_wanted==100) { PARSER_N_ERROR_INTERNAL_RM('A'); new_line; }
        else                  {  PARSER_N_ERROR_INTERNAL_RM('B'); new_line; }
    }
}

with the actual error response provided by the Standard Rules:

The parser nothing error internal rule translates into I6 as
    "PARSER_N_ERROR_INTERNAL_R" with
    "Nothing to do!" (A),
    "[There] [adapt the verb are from the third person plural] none at all available!" (B),
    "[regarding the noun][Those] [seem] to belong to [the noun]." (C),
    "[regarding the noun][Those] [can't] contain things." (D),
    "[The noun] [aren't] open." (E),
    "[The noun] [are] empty." (F). [ <--- HERE ]

It seems like you want an actual action to proceed from this command, in order to trigger the rule about Bob shouting. That’s potentially tricky, so it would be helpful to know more about what, exactly, you’re trying to achieve in terms of interaction.

1 Like

Horrible fragile hack that might be good enough:

Lab is a room.

To decide which snippet is the quoted verb:
  (- ((verb_wordnum * 100) + 1) -) .

The pocket is a container. The pocket is in the Lab.

The exact text of the player's command is a text variable.

After reading a command:
now The exact text of the player's command is the player's command;


To decide if there was an attempt to get from the empty pocket:
    if the quoted verb matches "get" and 
      the exact text of the player's command matches
      the regular expression "pocket$", yes;
    no.

The parser nothing error internal rule response (F) is
  "[if there was an attempt to get from the empty pocket]Bob shouts[else][The noun] [are] empty[end if].".
1 Like

Inform doesn’t show rules that are implemented in I6. I don’t know if that is deliberate or a bug, but it’s frustrating at times.