• "Understanding" indexed text

    From frotzing@gmail.com@21:1/5 to All on Sun Oct 15 19:52:34 2017
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Stelzer@21:1/5 to frot...@gmail.com on Sat Dec 9 10:54:09 2017
    On Sunday, October 15, 2017 at 9:52:37 PM UTC-5, frot...@gmail.com wrote:
    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?

    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".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)