Dictionary name trouble

maybe i’m not getting something about dictionary names in punyinform. but they don’t seem to work like inform6.

this is an elevator button. it has the number 2 on it, so the player should be able to type some combo of “push 2” or “push two”, etc.

Object -> Button "button"
	with 
		name '2//' 'two' 'second' 'button',
		description "It's a button with the number '2' on it. ",
		before [;
			push:
			"Something happens here. ";
		],
	has static;

“push 2” and “push two” don’t work. they simply generate “You don’t see any such thing”. only after including ‘second’ and button’ into the command does the parser recognize the object.

Which version of PunyInform are you using?

This is most probably due to a new feature in the development version “5.6 dev”. If you revert to version 5.6 it should be fine. And we’ll make sure that this works properly before release. Thanks for the feedback.

OP’s example works fine for me in trunk (5.6dev). It also works in 5.6 (git checkout 7edfd4a):

Button Room
You are in the button room.

You can see a button here.

> push 2 
Something happens here. 

> push two
Something happens here. 

> push second button
Something happens here. 

Can you post a full example, or let me know what version of punyinform you’re using? Try upgrading to at least 5.6 and see if this solves the problem.

If you prefer you could make a new issue at the punyinform github and attach a larger example code

yes, going back to 5.6 takes care of this.
there’s another issue that i’ll keep in this thread because it’s a similar issue also ‘name’ related.

in 5.6 and 5.6dev adjectives are ignored in cheap scenery.

you can copy this into the test_bench.inf code.

cheap_scenery
    4 'painting' 'paintings//p' 'picture' 'pictures//p' [;
        examine:
        "They're generic prints of flowers and fruit. You feel both soothed and insulted just looking at them. ";
        take:
        "You have no need for mediocre art. ";
    ]
    3 'combination' 'lock' 'dial' [;
        examine:"It's a dial with the numbers 1 through 35 around the periphery. A large hole has been drilled in it
            rendering it useless. ";
        turn:
            "It's broken and won't turn. ";
    ]
    21 'wrought' 'iron' 'stand' "It's a wrought iron stand holding up the aquarium. "
    12 'reticulated' 'python' 'snake' [;
        examine:
        "'Louanne' is a two-foot long reticulated python although you have no way of knowing that, having no 
        particular expertise in snakes. She's seems content to stay where she is but you would rather keep your distance. ";
        take:
        "Nope. Just no. ";
    ]
    12 'bleached' 'branch' 'stick' [;
        examine:
        "It's a tortuous piece of bleached wood. There's currently a snake wrapped around and sleeping on it. ";
        take:
        "Not with the snake there, nosirree. ";
    ],

referring to any of these objects using just one of the adjective gives the “you don’t see any such thing” response.

This works as intended. Read the docs on cheap scenery:

(2) If you only need a single noun, or you need multiple nouns and/or adjectives, you can write a number between 1 and 99, calculated as (10*adjectives)+nouns, followed by first the adjectives, then the nouns, and finally the reaction string/routine. E.g. a yellow record player might be added as 21 'yellow' 'record' 'player' "It's yellow!" This means there are two adjectives (yellow and record) and one noun (player). Any combination of adjectives and nouns will be recognized in player input, as long as the adjectives come before the nouns, and at least one of the nouns is used.

A cheap scenery object can never be involved in a disambiguation question (“Do you mean the record player or the Elvis record?”). To make the cheap scenery system more useful, we added the option of including adjectives with cheap scenery objects. This can be used to make it more likely that the parser finds the cheap scenery object or regular object the player actually intends. So “x player” or “x record player” points out the record player, but “x record” doesn’t.

If, for your game, you want adjectives to be treated just like nouns, exactly the way regular objects work in PunyInform, just consider your adjectives as nouns, and you’re good. I.e. instead of:
21 'yellow' 'record' 'player'
you specify:
3 'yellow' 'record' 'player'

1 Like

ahh. i read it but didn’t catch the significance of those last 8 words

1 Like

I edited my reply with more information on the thoughts behind this system.

If you find that you like the system, and would want to use it for some regular objects as well, we’ve provided an example of how you might go about that:

(PunyInform/howto/adjectives.inf at master · johanberntsson/PunyInform · GitHub)