Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I7 - modifying the name of an object based on user input

6 views
Skip to first unread message

weevil

unread,
Oct 2, 2009, 8:45:20 PM10/2/09
to
Hey gang,
I am trying to create a 'paper' object that changes its name to 'a
drawing of *foo* ' when the player uses a 'draw *foo* on paper'
command. I found the notebook example in the documentation that writes
text to an external-file, but was wondering if changing an object name
in play was possible.

Jim Aikin

unread,
Oct 3, 2009, 12:31:12 AM10/3/09
to

You can't change the internal name of an object (the name used to refer
to it in code). But you can change its printed name. Something like
this, perhaps:

[code]
The drawable-paper is a privately-named thing. The player carries the
drawable-paper. The printed name of the drawable-paper is "[if drawn
upon]drawing of foo[otherwise]piece of paper". Understand "piece",
"paper", and "piece of paper" as the drawable-paper. The drawable-paper
can be drawn upon. The drawable-paper is not drawn upon. Understand
"drawing", "foo", and "drawing of foo" as the drawable-paper when the
drawable-paper is drawn upon.

Drawing on is an action applying to one thing and requiring light.
Understand "draw on [something]" as drawing on.

Check drawing on:
say "That's not something you can draw on."

Instead of drawing on the drawable-paper:
now the drawable-paper is drawn upon;
say "You sketch a foo on the piece of paper."
[end code]

If you want the player to be able to draw ANYTHING on the piece of
paper, you have a more complex problem.

You might want to look at my Notepad extension. It allows the player to
write anything on a piece of paper -- but the words written on the paper
don't change its vocabulary words or printed name.

Hope this helps.

--JA

weevil

unread,
Oct 3, 2009, 1:30:26 AM10/3/09
to
Yeah, I want to let the player be creative and draw anything they
want, and then use that as a reoccurring joke, like the reappearing
error message in Hitchhikers guide: "so and so holds up your drawing
of *foo* and says grimly, 'Did you draw this *foo*?'"
If I can't change the name to whatever the player writes assuming he
has the freedom to write whatever he wants, can I add whatever the
player draws to the description?

I'll take a look at the notepad extension...

Jay

unread,
Oct 3, 2009, 6:22:13 AM10/3/09
to
Not tested, but could you do something like:

The drawable-paper has a stored text called doodle. The doodle of
drawable paper is "nothing".

After drawing something (called scribble) on the drawable-paper: [of
course you need to set this up as an action]
now the doodle of the drawable paper is scribble. [?]

The printed name of drawable-paper is "[if doodle is nothing]A blank
sheet of paper.[otherwise]A stunningly lifelike interpretation of
[doodle]."

Every turn when the Vogon Guard holds the drawable-paper, say "The
guard holds the paper to the light, thoughtfully critiquing your
rendition of [doodle]."

---
I'm sure I've done something weird with nouns and text, but in
principle, shouldn't that type of structure work?

Jim Aikin

unread,
Oct 3, 2009, 11:10:10 AM10/3/09
to
weevil wrote:
> Yeah, I want to let the player be creative and draw anything they
> want, and then use that as a reoccurring joke, like the reappearing
> error message in Hitchhikers guide: "so and so holds up your drawing
> of *foo* and says grimly, 'Did you draw this *foo*?'"

I think you can do that. What you may not be able to do is allow "*foo*"
to be used as vocabulary for the paper. Maybe Ron or Jesse will be able
to suggest a way to do this, though.

Take a look at page 2.3 in the Recipe Book. It shows various ways to use
the player's input. None of them is quite what you're looking for, but
they may suggest something.

Here's a revised version of the code I sent yesterday. It's still not
perfect. In particular, if the player draws Helen on the paper, Inform
will report that the paper is "a drawing of a helen". But it's a start.

[code]
The drawable-paper is a privately-named thing. The player carries the

drawable-paper. The drawable-paper has some indexed text called the
drawing. The drawing of the drawable-paper is usually "blank". The
description of the drawable-paper is "[if drawn upon]On the paper you
have drawn a [drawing of the drawable-paper][otherwise]The paper is
blank[end if]."

The printed name of the drawable-paper is "[if drawn upon]drawing of a
[drawing of the drawable-paper][otherwise]piece of paper". Understand

"piece", "paper", and "piece of paper" as the drawable-paper. The
drawable-paper can be drawn upon. The drawable-paper is not drawn upon.

Understand "drawing" as the drawable-paper when the drawable-paper is
drawn upon.

Drawing it on is an action applying to one topic and one thing and
requiring light. Understand "draw [text] on [something]" as drawing it on.

Check drawing it on:
if the second noun is not the drawable-paper:
say "That's not something you can draw on." instead;
otherwise:
continue the action.

Carry out drawing it on:


now the drawable-paper is drawn upon;

change the drawing of the drawable-paper to the topic understood;
say "You draw a [drawing of the drawable-paper] on the paper."
[end code]

Now your NPC can say "Is this your drawing of a [drawing of the
drawable-paper]?"

I put the code for drawing on the paper in the carry out rule because
for some weird reason (possibly a bug???), Inform wouldn't let me write
an instead rule for the drawing it on action. But if the game includes
only one drawable-on object, that's a trivial problem.

--JA

Emily Short

unread,
Oct 3, 2009, 1:38:14 PM10/3/09
to
On Oct 3, 10:10 am, Jim Aikin <midigur...@gmail.com> wrote:
> weevil wrote:
> > Yeah, I want to let the player be creative and draw anything they
> > want, and then use that as a reoccurring joke, like the reappearing
> > error message in Hitchhikers guide: "so and so holds up your drawing
> > of *foo* and says grimly, 'Did you draw this *foo*?'"
>
> I think you can do that. What you may not be able to do is allow "*foo*"
> to be used as vocabulary for the paper. Maybe Ron or Jesse will be able
> to suggest a way to do this, though.

I suspect the most relevant example for this is the Fido example,
which allows the player to name and rename a dog, and use that name to
refer to it. (This is linked from the section on using the player's
input, but is actually under Animals.)

weevil

unread,
Oct 3, 2009, 2:37:48 PM10/3/09
to

Excellent. I have the paper working now with the regular notebook
function of 'writing'. I may try to add another verb "draw" that is a
portable piece of text that behaves like in the naming and renaming
section.

weevil

unread,
Oct 3, 2009, 3:04:47 PM10/3/09
to
Here's another question about the notebook extension- I have two
allowed-pens, one is a black crayon and one is a white crayon. I want
to have something happen later on if the black crayon is used and
something else happen if the white one is used (some characters can
see the white crayon and some cant). Is there any way to specify *foo*
(written in white crayon) and also have some kind of token that the
white one was used that can be recognized later on?

weevil

unread,
Oct 4, 2009, 12:24:00 AM10/4/09
to
I got the draw action and the write action from the notepad extension
working really well together, once I duplicated the rule that limited
writing on to allowed-pens and changed it to apply to the drawing
action. Now you can write on the drawable-paper and the text will show
up in the description, and when you draw on it, the name becomes
'picture of *foo*', and you can do both to the same paper.

weevil

unread,
Oct 5, 2009, 12:40:42 AM10/5/09
to
Well, now I'm realizing that although the notepad extension makes sure
you have an allowed-pen in your possession, it doesn't care if you
actually use the allowed pen on the notepad, and in fact doesn't
understand when you type 'write *foo* on notepad with *allowed-pen*.

Is there an easy way to modify the notepad extension so that it
actually lets you write with a pen, so that I can somehow record which
pen was used?

Jim Aikin

unread,
Oct 5, 2009, 2:08:39 AM10/5/09
to

I'll take a look at that tomorrow morning. Looks like you've found a
bug, or at least a minor omission. I believe you do have to be holding
the allowed-pen for the command to work, though.

And here's the thing: A typical IF parser only wants to know about two
nouns. Setting aside, for the moment, the question of including
arbitrary text in a command, parsers are not set up to do this:

> put the eyedrops in barbara's eye with the eyedropper

There are three nouns in that command -- eyedrops, eye, and eyedropper.
And that's too many. At best, a parser will respond to "put the eyedrops
in barbara's eye" by checking whether the player is holding the eyedropper.

So there may not be a way to implement "write *foo* on notepad with
*allowed-pen*. But I'll look into it.

--JA

Chuck

unread,
Oct 5, 2009, 7:51:02 AM10/5/09
to
On Oct 2, 11:31 pm, Jim Aikin <midigur...@gmail.com> wrote:

I enjoyed playing around with Jim's code. One very slight change I
would make is to remove (two times) the letter "a" from:

[code]
.....a [drawing of the drawable-paper]
[end code]

This removes the double "a"s that I'm getting when using an article
with what I draw. I'm assuming that most players would type "draw a
sun" or "draw a boy" so the "a" in the code is not needed. Small thing
to consider.

Chuck

weevil

unread,
Oct 5, 2009, 9:41:19 AM10/5/09
to
Hmm. I guess I may have to rethink my puzzle then.

Captain Mikee

unread,
Oct 5, 2009, 10:37:00 AM10/5/09
to

This is not a new problem. Check out this transcript from
Spellbreaker:

>write on cube
You'll have to write on the cube with something.

>write on cube with burin
Write what on the cube?

>packed earth
There was no verb in that sentence!

>write 'packed earth' on cube with burin
There were too many nouns in that sentence.

>write packed on cube with burin
There were too many nouns in that sentence.

>write on cube with burin
Write what on the cube?

>packed
There was no verb in that sentence!

>write 'packed' on cube with burin
There were too many nouns in that sentence.

>write "packed" on cube with burin
There were too many nouns in that sentence.

>write with burin
That sentence isn't one I recognize.

>write on cube
You'll have to write on the cube with something.

You hear a noise from within the cave that sounds like a sneeze.

>write "packed" on cube
The word "packed" is now written on the cube.

Jim Aikin

unread,
Oct 5, 2009, 11:58:11 AM10/5/09
to
Chuck wrote:
>
> I enjoyed playing around with Jim's code. One very slight change I
> would make is to remove (two times) the letter "a" from:
>
> [code]
> .....a [drawing of the drawable-paper]
> [end code]
>
> This removes the double "a"s that I'm getting when using an article
> with what I draw. I'm assuming that most players would type "draw a
> sun" or "draw a boy" so the "a" in the code is not needed. Small thing
> to consider.

There's no graceful solution to this problem, short of going in and
monkeying with the player's input as indexed text to add or remove an
initial 'a' or 'the'. If we revise it as you suggest, like this:

The description of the drawable-paper is "[if drawn upon]On the paper

you have drawn [drawing of the drawable-paper][otherwise]The paper is
blank[end if]."

...then when the player enters DRAW HOUSE ON PAPER, the description of
the paper becomes "On the paper you have drawn house." Equally ugly.

--JA

weevil

unread,
Oct 5, 2009, 6:18:16 PM10/5/09
to
I think I may have to keep the drawable paper as a novelty and have
another object that cares what color crayon you write with, and
assumes what the player is drawing, so there's no extra object to
juggle in the sentence. I'll figure something out.

On an aside- I know it's probably not complicated, but can someone
point to a well-formed code example of an NPC that spouts off random
quips from a table or array or what-have-you?

Erik Temple

unread,
Oct 5, 2009, 8:01:59 PM10/5/09
to
On Mon, 05 Oct 2009 17:18:16 -0500, weevil <wiley...@gmail.com> wrote:

> I think I may have to keep the drawable paper as a novelty and have
> another object that cares what color crayon you write with, and
> assumes what the player is drawing, so there's no extra object to
> juggle in the sentence. I'll figure something out.

I have a couple more suggestions for you:

(1) Inform allows only two nouns in player input, but in addition it can
also recognize one value (e.g., Drawing is an action applying to two
things and one value). That value could be the color of the crayon, and so
you should be able to set up actions that will recognize inputs like these:

Draw a red rose on the paper.
Draw a rose on the paper in red.

Your check rules will need to check to see that the player has the proper
crayon for coloring in the color she's indicated, but otherwise this
should do what you want.

(2) Another option would be to ask a question after input specifying two
of the three elements:

> Draw on the paper with the red crayon
What do you want to draw?

> Draw a cow on the paper
What do you want to draw with?

> Draw a cow with the red crayon
What do you want to draw with?

One way to code this would be to have a different action for each, each
followed by a question that completes the needed information appropriately
(Michael Callaghan's Questions extension is easy to use and should work
well). All three elements could then be passed to a single rule that
actually carries out the action. (Yes, this is the trickier of my two
suggestions!)

--Erik

weevil

unread,
Oct 6, 2009, 12:22:59 PM10/6/09
to
Can I set up an instead rule for something that wouldn't have made
sense to the parser?
like:
Instead of drawing *foo* on the paper with the red crayon:
try drawing a *foo* on the paper in red.

Since I can just see a user trying that a hundred different ways until
he hit upon "in red".

Andrew Plotkin

unread,
Oct 6, 2009, 12:36:21 PM10/6/09
to

Not like that. Inform divides up the parsing process into two distinct
parts:

- Turning player inputs into actions (with Understand statements)
- Performing actions (with before/instead/after or check/carry-out/
report rules)

You already have appropriate actions set up, so you just need
Understand statements that lead into them.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

weevil

unread,
Oct 6, 2009, 1:32:56 PM10/6/09
to
Ah, gotcha... "Understand"

It seems like the way to do this is to have it both accept write/draw
foo on foo in foo, and also to question the user if he just writes
write/draw foo on foo.

weevil

unread,
Oct 6, 2009, 1:55:31 PM10/6/09
to
Ah, ok. I changed the rule for the drawing verb to include a value and
I have some catchalls for 'understanding' other phrasing, and I
defined color as a kind of value and added the colors of the
crayons... Is there anything else I am missing? how do I restrict the
value needed by the paper to colors?

Erik Temple

unread,
Oct 6, 2009, 2:32:57 PM10/6/09
to
On Tue, 06 Oct 2009 12:55:31 -0500, weevil <wiley...@gmail.com> wrote:

> how do I restrict the
> value needed by the paper to colors?

With an Understand statement. I'm not sure what kinds you might be using,
but here is the basic syntax:

Drawing it on is an action applying to two things and one value.
Understand "draw [a thing] on [a thing] in [a color]" as drawing it on.

See Chapter 16 of the manual for more refinements.


On Tue, 06 Oct 2009 11:22:59 -0500, weevil <wiley...@gmail.com> wrote:

> Can I set up an instead rule for something that wouldn't have made
> sense to the parser?
> like:
> Instead of drawing *foo* on the paper with the red crayon:
> try drawing a *foo* on the paper in red.
> Since I can just see a user trying that a hundred different ways until
> he hit upon "in red".

To do this, you can cheat a bit:

<code>

Incorrectly using three substantives is an action applying to two things
and one value. Understand "draw [a thing] on [a thing] with [a color]
crayon" as incorrectly using three substantives.

Instead of incorrectly using three substantives:
say "Try [bold type]Draw [the noun] on [the second noun] in [the color
understood][roman type]."

</code>

What this does is put the word "crayon" into the grammar itself--it is not
understood as a noun but simply as text that must be present in the
player's command for the line to be understood as the incorrectly using
three substantives action. It is not advisable to do this kind of thing
often! I would only recommend using it, as in the example, to produce an
error message, because you don't want to teach your players that three
nouns are allowed across the board.

--Erik

weevil

unread,
Oct 6, 2009, 3:13:07 PM10/6/09
to
Wow! This is getting complicated.

I think this will work, however I am getting an error because now that
I am defining red, white, black, and blue as the values of color, it's
conflicting with my objects; white crayon, red crayon black crayon and
blue crayon.

" I seem to need to give a new meaning to 'red', something which was
created by the earlier sentence 'A white crayon, blue crayon, red
crayon, and black crayon are crayons inside the crayola box' "

is the solution to make all of those crayons privately named? Will
that interfere with the user picking them up and using them?


On Oct 6, 1:32 pm, "Erik Temple" <ek.tem...@gmail.com> wrote:


> On Tue, 06 Oct 2009 12:55:31 -0500, weevil <wileywg...@gmail.com> wrote:
> > how do I restrict the
> > value needed by the paper to colors?
>
> With an Understand statement. I'm not sure what kinds you might be using,  
> but here is the basic syntax:
>
> Drawing it on is an action applying to two things and one value.  
> Understand "draw [a thing] on [a thing] in [a color]" as drawing it on.
>
> See Chapter 16 of the manual for more refinements.
>

Erik Temple

unread,
Oct 6, 2009, 3:51:28 PM10/6/09
to
On Tue, 06 Oct 2009 14:13:07 -0500, weevil <wiley...@gmail.com> wrote:

> Wow! This is getting complicated.

Yes--what you want to do is complicated!


> I think this will work, however I am getting an error because now that
> I am defining red, white, black, and blue as the values of color, it's
> conflicting with my objects; white crayon, red crayon black crayon and
> blue crayon.
>
> " I seem to need to give a new meaning to 'red', something which was
> created by the earlier sentence 'A white crayon, blue crayon, red
> crayon, and black crayon are crayons inside the crayola box' "
>
> is the solution to make all of those crayons privately named? Will
> that interfere with the user picking them up and using them?

Try this:

<code>

Test is a room.

Color is a kind of value. The colors are red, white, and blue.

A crayon is a kind of thing. A crayon has a color. Understand the color
property as describing a crayon. The printed name of a crayon is "a
[color] crayon".

A red crayon called crayon is in Test.
A blue crayon called crayon is in Test.
A white crayon called crayon is in Test.

</code>

The key thing here is the line "understand the color property as
describing a crayon". This makes the color of a crayon something the
player can refer to. Note that you still need to give a crayon a name for
Inform to understand it by. I have named all of these simply "crayon"--the
color property serves to distinguish them.

There may be better ways to do this, or refinements to improve aspects of
the behavior, but this ought to work for you.

--Erik

Message has been deleted

Erik Temple

unread,
Oct 6, 2009, 8:32:23 PM10/6/09
to
On Tue, 06 Oct 2009 15:50:48 -0500, weevil <wiley...@gmail.com> wrote:

> should I give the crayons all different names again like, 'a red
> crayon called red crayon is in *room*' ?

I'd say give that a try--if it works, you're in business. If it doesn't,
hit undo a few times. ;-)

--Erik

weevil

unread,
Oct 6, 2009, 9:13:12 PM10/6/09
to
individually naming the crayons fixed the allowed pens problem, but I
get this error from the 'understand' rule:

"Problem. You wrote 'Understand "draw [a thing] on [a thing] in [a
color]" as drawing it on' : but 'understand ... as ...' should be
followed by a meaning, which might be an action (e.g., 'understand
"take [something]" as taking'), a thing ('understand "stove" as the
oven') or more generally a value ('understand "huitante" as 80'), or a
named token for use in further grammar ('understand "near [something]"
as "[location phrase]"'). Also, the meaning needs to be precise, so
'understand "x" as a number' is not allowed - it does not say which
number."

Erik Temple

unread,
Oct 6, 2009, 9:38:47 PM10/6/09
to

Did you change the name of the action? It sounds like Inform doesn't
understand "drawing it on" as an action you've defined.

Message has been deleted

weevil

unread,
Oct 7, 2009, 10:33:07 AM10/7/09
to
here's a truncated sample of my code. (in the real thing, the cage is
an enterable object in a room).

<code>
Include Notepad by Jim Aikin.

The cage is a room.

Color is a kind of value. The colors are red, blue, black, white,
green, yellow, and purple.

The Crayola box is a container inside the cage.


A crayon is a kind of thing. A crayon has a color. Understand the
color
property as describing a crayon. The printed name of a crayon is "a

[color] crayon". Crayons are edible.

A white crayon called white crayon is in the box.
A red crayon called red crayon is in the box.
A black crayon called black crayon is in the box.

Rule for printing the name of the crayola box while not inserting or
removing:
if the crayola box contains crayons, say "box of crayons";
omit contents in listing.

The drawable-paper is a notepad. The allowed-pens of the drawable-
paper is {white crayon, red crayon, black crayon}. The drawable-paper
is in the cage. The drawable-paper has some indexed text called the
drawing. The drawing of the drawable-paper is usually "blank". The


description of the drawable-paper is "[if drawn upon]On the paper you
have drawn [drawing of the drawable-paper][otherwise]The paper is blank
[end if]."

The printed name of the drawable-paper is "[if drawn upon]drawing of
[drawing of the drawable-paper][otherwise]piece of paper". Understand


"piece", "paper", and "piece of paper" as the drawable-paper. The
drawable-paper can be drawn upon. The drawable-paper is not drawn
upon.

Understand "drawing" as the drawable-paper when the drawable-paper is
drawn upon.

Drawing it on is an action applying to two things and one value and
requiring light.


Understand "draw [a thing] on [a thing] in [a color]" as drawing it

on.

Incorrectly using three substantives is an action applying to two
things
and one value. Understand "draw [a thing] on [a thing] with [a
color]
crayon" as incorrectly using three substantives.
Instead of incorrectly using three substantives:
say "Try [bold type]Draw [the noun] on [the second noun] in [the
color
understood][roman type]."

Check an actor drawing on something (this is the ordinary check
drawing it on rule):
let carrying-pen be a truth state;
let carrying-pen be false;
if the actor is the player:
if the second noun is not a notepad:
say "You can't draw anything on [the second noun]." instead;
otherwise if the second noun is non-edit-allowing:
say "[The second noun] [if the second noun is plural-named]are
[otherwise]is[end if] currently write-protected, and can't be written
on." instead;
if the pen-needed of the second noun is true:
repeat with P running through the allowed-pens of the second noun:
if the player carries P:
now carrying-pen is true;
otherwise:
now carrying-pen is true;
if carrying-pen is false:
say "You have nothing to write with." instead;
otherwise:
if the second noun is not a notepad:
say "[The actor] is unable to write anything on [the second
noun].";
rule succeeds;
otherwise if the second noun is non-edit-allowing:
say "[The second noun] [if the second noun is plural-named]are
[otherwise]is[end if] currently write-protected, and can't be written
on.";
rule succeeds;
if the pen-needed of the second noun is true:
repeat with P running through the allowed-pens of the second noun:
if the actor carries P:
now carrying-pen is true;
otherwise:
now carrying-pen is true;
if carrying-pen is false:
say "[The actor] has nothing to write with.";
rule succeeds.


Check drawing it on:
if the second noun is not the drawable-paper:
say "That's not something you can draw on." instead;
otherwise:
continue the action.

Carry out drawing it on:

now the drawable-paper is drawn upon;

change the drawing of the drawable-paper to the topic understood;
say "You draw a [drawing of the drawable-paper] on the paper."

</code>

weevil

unread,
Oct 7, 2009, 2:24:09 PM10/7/09
to
I should say that on the last compile I am getting a different error
(i think you were right before and that 'draw it on' had been changed
to 'draw' in the definition):

Problem. You wrote 'Understand "draw [a thing] on [a thing] in
[Color]" as drawing it on' : but there can be at most two varying
parts to a line of grammar, so 'put [something] in [a container]' is
allowed but 'put [something] in [something] beside [a door]' is not.

Erik Temple

unread,
Oct 7, 2009, 3:03:28 PM10/7/09
to
On Wed, 07 Oct 2009 13:24:09 -0500, weevil <wiley...@gmail.com> wrote:

> Problem. You wrote 'Understand "draw [a thing] on [a thing] in
> [Color]" as drawing it on' : but there can be at most two varying
> parts to a line of grammar, so 'put [something] in [a container]' is
> allowed but 'put [something] in [something] beside [a door]' is not.

Doh! I hope someone will correct me if I'm wrong, but it looks like you
can't use 2 nouns plus 1 value after all. My apologies if that's the
case!!!

I could swear I've used three varying items in a line of grammar in the
past, however I just tried out 2+1 with a simpler example, though, and got
the same message. So it looks like 2+1 really isn't possible--and as
though I led you astray. I'm sorry!

This does reveal a bug of sorts in the system, because Inform allows
actions to be described in a way that implies that 2+1 is in fact
possible. The sentence:

Drawing it on is an action applying to two things and one value

Should not compile, because an action cannot in fact apply to two things
and one value.

Going on the assumption that there is in fact no way to have Inform parse
2+1, I still see a couple of options:

(1) Ask a question to get the third item, as I mentioned before.
(2) Hard-code the color words into the grammar as I mentioned before for
the crayon, e.g.:
Understand "Draw [a thing] on [a thing] in red" as drawing it in red.
Understand "Draw [a thing] on [a thing] in blue" as drawing it in blue.
Your check rules would have to manually see that the player has the
appropriate crayon.

But maybe you don't want to listen to me any more...

--Erik

weevil

unread,
Oct 7, 2009, 6:08:54 PM10/7/09
to
Fooey. Thanks for trying, though. I'm going to check out the questions
extension and see what I have to include to do it that way...

On Oct 7, 2:03 pm, "Erik Temple" <ek.tem...@gmail.com> wrote:

Message has been deleted

weevil

unread,
Oct 11, 2009, 1:17:41 AM10/11/09
to
I need help disambiguating the "draw it on" verb.. a couple of the
people who I've tested it on type "draw on paper" first and the parser
doesn't doesn't understand the sentence. I'd like for it to understand
draw on as draw it on, but to ask the player what he wants to draw.
The allowed pens should still apply.

weevil

unread,
Oct 20, 2009, 9:13:47 PM10/20/09
to
Is there a way to do something like:

<code>
Drawing it on is an action applying to one topic and one thing and
requiring light. Understand "draw [text] on [something]" as drawing it
on.
Understand "draw [text]" as "draw [text] on paper".
</code>

Inform sure doesn't like it, but there must be some way to make inform
assume that if the 'something' is left out, that the player means
'paper'.

Andrew Plotkin

unread,
Oct 20, 2009, 10:17:47 PM10/20/09
to

Yes, you can define a placeholder action "drawing it on-paper", and
then give it one "instead" rule whose body is "try drawing the text
understood on the paper".

SJ

unread,
Oct 21, 2009, 5:27:07 AM10/21/09
to

> > Is there a way to do something like:
>
> > <code>
> > Drawing it on is an action applying to one topic and one thing and
> > requiring light. Understand "draw [text] on [something]" as drawing it
> > on.
> > Understand "draw [text]" as "draw [text] on paper".
> > </code>
>
> > Inform sure doesn't like it, but there must be some way to make inform
> > assume that if the 'something' is left out, that the player means
> > 'paper'.
>
> Yes, you can define a placeholder action "drawing it on-paper", and
> then give it one "instead" rule whose body is "try drawing the text
> understood on the paper".

You could also use the "supplying a missing noun" activity:

Understand "draw [text] on [something]" or "draw [text]" as drawing it
on.

Rule for supplying a missing second noun while drawing:
if the player can touch the paper, change the second noun to the
paper;
otherwise say "You don't have anything to draw on."

weevil

unread,
Nov 30, 2009, 4:11:40 PM11/30/09
to
This has turned into a big mess, pretty much everyone tries "draw
*blank* on *blank* with *blank*. I think I can do a 'understand as a
mistake' rule for this but can I do an 'instead of' rule for something
that doesn't make sense to the parser, since *I* understand what they
were trying to do, even if the parser doesn't?

weevil

unread,
Nov 30, 2009, 4:13:10 PM11/30/09
to
If you'd like to check out the mess I've made so far, it's up at
http://wileywiggins.com/fiddlestixx/example.html . It might help
people get a better handle on what to suggest.

0 new messages