Discussion:
"Understanding" indexed text
(too old to reply)
f***@gmail.com
2017-10-16 02:52:34 UTC
Permalink
Hi,

New IF author here. I've come across a problem and I figure that I'm merely attacking the problem from the wrong angle, but I can't figure out what the right angle is.

I told the game to ask the player for some input (in this case, a color), which the game will then use to describe some items in the game.

I made this work by implementing an indexed text that varies called "player's color.

I then use that to alter the printed name of some items by saying the following:

The printed name of the hat is "[player's color] hat";

This works great. If the player inputs "scarlet" as his favorite color, later in the game he sees "a scarlet hat."

Yay!

The problem is, if the player says "Take scarlet hat," the parser doesn't understand him.

That complaint made sense to me, so I tried the following:

Understand "[player's color] hat" as the hat.

Inform didn't like that.

So, my issue is how do I fix it? How can I let the player choose the color of an item and use that color when interacting with it?
Daniel Stelzer
2017-12-09 18:54:09 UTC
Permalink
Post by f***@gmail.com
Hi,
New IF author here. I've come across a problem and I figure that I'm merely attacking the problem from the wrong angle, but I can't figure out what the right angle is.
I told the game to ask the player for some input (in this case, a color), which the game will then use to describe some items in the game.
I made this work by implementing an indexed text that varies called "player's color.
The printed name of the hat is "[player's color] hat";
This works great. If the player inputs "scarlet" as his favorite color, later in the game he sees "a scarlet hat."
Yay!
The problem is, if the player says "Take scarlet hat," the parser doesn't understand him.
Understand "[player's color] hat" as the hat.
Inform didn't like that.
So, my issue is how do I fix it? How can I let the player choose the color of an item and use that color when interacting with it?
This is really late because I don't read this group often—sorry! But you can understand a thing by a property of that thing. So make the color a property of the hat, and then "understand the color property as describing the hat".
Loading...