PLEASE HELP ASAP Omnipresent characters/Dialog questions

Oh hey I forgot about ‘everywhere’. Cool.

Folks…
I tried the above method and came up with the following:

“if the current action is asking someone about something”

generates NO result. I tested it by asking it to print a word if the case is satisfied. Nothing came out.
However, when I test:

“if the current action is asking”

I get a positive result… the word IS printed… but placing my omnipresent character in scope FAILS. The message “You can’t see any such thing.” is generated in the game.

What am I missing?

EDIT: I expanded the demo, basically because I’ve barely ever used ‘asking about’ type actions in my games so it needed a bit of work.

Maybe just a typo or misplaced tab or punctuation? To try to help I’ve made a demo which I know works, incorporating a variation of the line you had trouble with, and which demonstrates (a) an omnipresent character for conversation purposes (who also happens to be physical and standing in one room) and (b) that she has an object which, if you want to allow actions on that from afar, you also need to tweak the accessibility rules. I don’t know if you need the latter but if you do, you’ll see how to start.

There’s no extra conversation programming in the demo. Basically you can ‘ask’ her FOR or ABOUT the object she’s carrying, her umbrella.

The thing to note in the demo code is the part where actions are defined as ‘conversational’:

To decide whether the current action is conversational: if asking, yes; if asking about something, yes; no.
At the moment, it’s just asking and asking about something. But you can add further actions to this definition they will all be classed as actions which can be performed on the omnipresent character no matter where in the game you are. So you’d add all your own conversation commands to the list in the same format, before the line which says ‘no’.

Compile the demo and then type ‘test me’:

[code]“Omnipresent Jane and HER Umbrella” by Wade Clarke

Kitchen is a room. “The dining room is to the east.”

Dining room is east of kitchen. “The kitchen is to the west.”

Omnipresent Jane is a woman in dining room. “Omnipresent Jane is here holding an umbrella.” Description is “She’s plain and omnipresent. She’s carrying an umbrella which is not omnipresent.”

Omnipresent Jane carries an umbrella. Description of umbrella is “It’s merely present. It ain’t omnipresent.”

Instead of asking Omnipresent Jane for umbrella:
if Omnipresent Jane is in location:
say “Jane says ‘Hands off!’”;
otherwise:
say “Inside your head you hear Jane say ‘Get your damn telekinetic hands off my umbrella.’”

Instead of asking someone about something:
if noun is Omnipresent Jane and topic understood matches “umbrella”:
if Omnipresent Jane is in location:
say “Jane says ‘Fetching, is it not?’”;
otherwise:
say “Inside your head you hear Jane say ‘My umbrella is quite fetching, thank you.’”;
rule succeeds;
otherwise:
say “There’s no reply.”

To decide whether the current action is conversational:
if asking, yes;
if asking about something, yes;
no.

After deciding the scope of the player:
if the current action is conversational:
place Omnipresent Jane in scope.

[Physical requirement additions below]

This is the interacting with Omnipresent Jane while reaching inside rooms rule:
if noun is Omnipresent Jane:
allow access;
rule succeeds.

The interacting with Omnipresent Jane while reaching inside rooms rule is listed before the can’t reach inside rooms rule in the reaching inside rules.

Test me with “e / x jane / x umbrella / w / ask jane about umbrella / e / ask jane about umbrella / w / ask jane for umbrella / e / ask jane for umbrella”.[/code]
Hope this’ll help out.

  • Wade

I think the culprit is “asking someone about something.” You need to have just plain “asking about something” as in Wade’s demo, or just plain “asking about” would work. I’m not exactly sure why this is, but when I changed “asking about something” to “asking someone about something” in Wade’s demo it didn’t work anymore.

I think it may be that, while you’re deciding the scope of the player, the noun hasn’t been set yet (necessarily, because it can’t be set until we figure out what’s in scope), and before the noun is set the current action is “asking nothing about nothing” or perhaps “asking nothing about “””; in any case, it doesn’t match “asking someone about something.” And on a test when I change “asking about something” to “asking nothing about something,” it still works; so I think that’s it.

[A subtlety which you may wish to ignore: The current action enters Wade’s code not in “the current action is conversational” but in “if asking” and “if asking about something.” The phrase “To decide whether the current action is conversational” defines “the current action is conversational” as an indissoluble unit that doesn’t actually refer to “the current action” as part of it. You can change it to “the flerb is conversational” wherever it appears and the code will still run. But “if asking” and “if asking about something” are effectively short for “if the current action is asking” etc., I think.]

Oh yeah! It’d be nice if I hadn’t introduced this source of unnecessary confusion :unamused: But mostly I was proud I got it all running :sunglasses:

  • Wade

Yes. You can test this by sticking a line like “say “### Scope ([current action]).”;” in the deciding-the-scope rule.

(The “ask me about dfg” command checks scope twice because it tries to match “ask me about …” It gets as far as the first noun and then fails on the preposition.)

Right. They’re not implemented in quite the same way, but they should behave the same.

Wow, you guys are great and this all fascinating! I’ve got it working now, but:

What about the case where I say…

“Omnipresent Jane, tell me about umbrella” ?

I get the impression that ", tell me about " is not defined in the standard rules, but it was a standard thing in the old Infocom adventures and I feel like it’s a convention that should be covered. Is there an implementation out there that I could use?

When that’s tackled… how does Inform parse this command? What verb would I add to the “to decide whether the current action is conversational” statement to cover this possibility?
–Jay

Check out the sections of Writing with Inform about asking other people to do things, starting in section 12.3.

The action that you perform when you say “Person, do something” is “Asking [that person] to try [action].” If you actually want the person to perform an action like picking up an object in response to your command, there’s a lot of things to worry about involving persuasion rules and the like (by default, NPCs won’t do what you ask, and you have to write rules to determine when they will). But in your case you just want to redirect the request to another action performed by the player, which isn’t so bad:

Instead of asking someone to try telling the player about something: try asking the person asked about the topic understood.

(“The person asked” is, well, the person you asked to do something; “the topic understood” is whatever bit of text got processed as your text token, so if you say “Jane, tell me about umbrella” the topic understood is “umbrella.”)

Now the problem is that this breaks the rules for talking to Jane when she’s not there, since asking Jane to try telling me about “umbrella” isn’t covered by our rule for putting Jane in scope. One issue is that Jane doesn’t understand the command “tell me about umbrella” because we aren’t in scope for her! That can be solved with an “after deciding the scope of Jane” rule. Another problem is that we need to add “telling” to the list of conversational actions.

But the bigger problem, for me at least, is that we still haven’t got whatever it is that you do when you type “Jane, tell me about umbrella” under conversational actions, which means that Inform doesn’t understand the name “Jane” in that sentence. And I’m not sure how to do that. My solution would be to put Jane in scope by default and then block attempts to interact with her non-conversationally with a specific message. I wind up with this code, with one big caveat in the comments:

[code]“Omnipresent Jane and HER Umbrella” by Wade Clarke with some bits by Matt Weiner

Kitchen is a room. “The dining room is to the east.”

Dining room is east of kitchen. “The kitchen is to the west.”

Omnipresent Jane is a woman in dining room. “Omnipresent Jane is here holding an umbrella.” Description is “She’s plain and omnipresent. She’s carrying an umbrella which is not omnipresent.”

Omnipresent Jane carries an umbrella. Description of umbrella is “It’s merely present. It ain’t omnipresent.”

Instead of asking Omnipresent Jane for umbrella:
if Omnipresent Jane is in location:
say “Jane says ‘Hands off!’”;
otherwise:
say “Inside your head you hear Jane say ‘Get your damn telekinetic hands off my umbrella.’”

Instead of asking someone about something:
if noun is Omnipresent Jane and topic understood matches “umbrella”:
if Omnipresent Jane is in location:
say “Jane says ‘Fetching, is it not?’”;
otherwise:
say “Inside your head you hear Jane say ‘My umbrella is quite fetching, thank you.’”;
rule succeeds;
otherwise:
say “There’s no reply.”

Instead of asking someone to try telling the player about something: try asking the person asked about the topic understood.

To decide whether the current action is conversational:
if the current action is asking, yes;
if the current action is asking about something, yes;
if the current action is telling, yes;
if the current action is telling about something, yes;
no.

After deciding the scope of the player:
place Omnipresent Jane in scope.

After deciding the scope of Omnipresent Jane:
place the player in scope.

Instead of doing something when the current action involves Jane: [I think this would disrupt our rule for redirecting asking Jane to try doing something, but the rule that redirects this runs first; I’m not sure, though]
if the current action is conversational or Jane is in the location: [“jane is in the location” is a bit of a kludge; if we had a rule that let you look at Jane through a window this would break it. But our scope rules and reaching inside rules ensure that “the player can touch Jane” and “the player can see Jane” grade out as true, so we can’t use them to test whether you ought to be able to reach Jane]
continue the action;
otherwise:
say “Jane isn’t actually physically present; you can only ask her things.”
[Physical requirement additions below]

This is the interacting with Omnipresent Jane while reaching inside rooms rule:
if noun is Omnipresent Jane:
allow access;
rule succeeds.

The interacting with Omnipresent Jane while reaching inside rooms rule is listed before the can’t reach inside rooms rule in the reaching inside rules.

Test me with “jane, tell me about umbrella/ x jane/ e /jane, tell me about umbrella / x jane / x umbrella / w / ask jane about umbrella / e / ask jane about umbrella / w / ask jane for umbrella / e / ask jane for umbrella”.

[/code]

I’ll note that “Jane, give me umbrella” seems to behave differently from other actions in many ways (if you turn the rules listing on, you’ll find that some of our rules don’t show up even though they’re obviously doing their work.) So there’s a lot of stuff I might be missing.

Some of the stuff above is just jargon to me–reaching inside rooms? I’ll have to read chapter 12 carefully now that it’s germane. “Turn the rules listing on?” What’s that? Regardless, I get the core of what you’re doing here. Thanks.

I’ll try this out, and if I solve any problems I’ll report back… but if I end up going too far down the rabbit hole I’ll probably just back away from the whole “Jane, tell me about” syntax and pray no players default to that construction.

“Turn the rules listing on” was just me not expressing clearly what I meant. What I meant was, you can type “rules” or “rules on” in your game when you run it in the IDE, and it will then list every rule that runs. This can be incredibly helpful. You can also type “actions” or “actions on” to get the name of every action that’s being run (this is particularly useful if, for instance, you don’t know what action is being invoked by a command like “get up.”)

The deal with “reaching inside rooms” is that there’s a rulebook that determines whether some stuff is available for you to act on. By default, if something in another room gets put in scope, you can do things that involve looking at it (like examining) but not things that involve touching it or being near it (like taking it or, in this case, asking it about something). The interacting with Omnipresent Jane rule is there so you can bypass those rules to interact with O.J. from another room. That’s in 12.16 of the docs (and it will come up even if you ditch “Jane, tell me about.”)

Holy crap! Rules On is AMAZING! Just being able to see the order of the stack is insanely useful… but being able to change the order of the stack–that could be really useful at some point. I was managing that kind of thing with “first after” and all that jazz, but this could be cleaner if I ever understand it all. Thanks again.

<The interacting with Omnipresent Jane while reaching inside rooms rule is listed before the can’t reach inside rooms rule in the reaching inside rules.>