>give the hat to the man
>man, give me the hat
>man, take the hat from me
>take the hat from the man
This all works except the last example, "take the hat from the man",
which internally is really "remove the hat from the man". I
accomplish this with the following code:
[Code]
A person can be obedient. A person is usually not obedient.
[...]
A procedural rule:
if the person asked is obedient or the noun is obedient or the
second noun is obedient:
ignore the block giving rule;
ignore the can't remove from people rule;
ignore the can't take people's possessions rule.
[/Code]
The reason it fails on "take the hat from the man" is because of the
"convert remove to take rule", which removes the reference to the NPC
and turns the user's command into "take hat". It therefore fails on
the procedrual rule's condition because the NPC is no longer
referenced in the command.
I have the feeling I'm going about this the wrong way. Any thoughts?
Thanks,
Pete
I figured out a way to do it, but I don't promise that it won't have
undesired side effects. For one thing, I had to make the player
obedient. But here's a test swatch that seems to respond to all four
commands you want:
[code]
A person can be obedient. A person is usually not obedient. The
player is obedient.
A procedural rule:
if the person asked is obedient or the noun is obedient or the
second noun is obedient:
ignore the block giving rule;
ignore the can't remove from people rule;
ignore the can't take people's possessions rule.
The tall man is a man in the Lab. The tall man is obedient.
Persuasion rule for asking an obedient man to try doing something:
persuasion succeeds.
Check an actor taking (this is the new can't take people's possessions
rule):
let the local ceiling be the common ancestor of the actor with the
noun;
let H be the not-counting-parts holder of the noun;
while H is not nothing and H is not the local ceiling:
if H is a person and the person is not obedient, stop the action
with library message taking action
number 6 for H;
let H be the not-counting-parts holder of H.
The new can't take people's possessions rule is listed instead of the
can't take people's possessions rule in the check taking rulebook.
The player carries a hat.
Test me with "give hat to man / man, give me the hat / man, take the
hat from me / take the hat from the man".
[end code]
What I did was add "and the person is not obedient" to the library
rule. (Maybe that should be "and H is not obedient", but it works as
written.) Hope that helps!
--JA
Once again, you've provided a very useful answer. Thanks, Jim!
One question -- and I know I'm showing my profound ignorance here --
but is there a place where someone like me can view the standard rules
and learn how to duplicate them with modifications, such as in your
example above? I can't seem to locate the source in the standard
documentation.
Again, thanks.
> One question -- and I know I'm showing my profound ignorance here --
> but is there a place where someone like me can view the standard rules
> and learn how to duplicate them with modifications, such as in your
> example above? I can't seem to locate the source in the standard
> documentation.
Absolutely. To see the source of the Standard Rules, open the extension
from the Extensions menu (it's under the File menu on the Mac; probably
the same on the Windows version). Alternatively, you can read an annotated
version of the Standard Rules here:
http://inform7.com/sources/src/stdrules/Woven/index.html
You can either browse it in HTML or download a PDF.
--Erik
Very cool. Thanks!
How about just changing the condition on your procedural rule to:
if the person asked is obedient or the noun is obedient or the
second noun is obedient or taking something enclosed by an obedient
person
vw
Here's a round about way to do it for the 4th one.
Starter is a room.
Joe is a man in starter.
Joe wears a hat.
takefromming is an action applying to two things.
understand "take [something] from [something]" as takefromming.
instead of takefromming,
try removing the hat from Joe.
instead of removing the hat from Joe:
now the hat is carried by the player;
say "You remove the hat from Joe and are now holding it.".
I tested this, and it works! Thanks, VW! Jim's suggestion was handy
because it revealed some of the low-level things one can do with the
system, but I think I'll try going with this one because it's simpler
and I don't have to make the player 'obedient'.
- Pete
Proof that Inform 7 is a very flexible development language. This is
the third suggestion to my request that works. Thanks, Al!