multiple of same object

if i have a metal key, and i want their to be an undefined number of keys in the game, meaning i could have 1 or 1,000.

room 1 is a room. “a random room in a maze. theirs a door to the east, and an intercom system on the north wall.”.

metal key is an object. metal key is here. the description is “a metal key”.

metal box is in room 1. metal box is a container. metal box is lockable and locked. metal box contains metal key.

Problem. You wrote ‘metal key is here’ , but in another sentence ‘metal box contains metal key’ : metal key can only be given its position once, in a single assertion sentence.

do i have to make metal key 1, metal key 2, and the like with a metal key is a kind of thing or what?

I had a similar challenge (blackberries from bushes and rocks along the railroad tracks).

I found Emily Short’s FAQ here: emshort.wordpress.com/how-to-pla … orm-7-faq/ which says:

Following that lead, I found the famous pizza table that provides an “infinite” number of pizzas to eat (or hoard). inform7.com/learn/man/Rdoc82.html

Good luck. Easily adaptable.

In order for the keys to start off in different places, you need to give them different names in the source code. However, you can make them indistinguishable to the player, like so.

[code]“Test”

A metal key is a kind of thing. The description of a metal key is “A metal key.”. The printed name of a metal key is “metal key”.

The Room 1 is A Room. The description of the room 1 is “A random room in a maze. There’s a door to the east and an intercom system on the north wall.”.

The first metal key is in room 1. The first metal key is a metal key. A metal box is in room 1. A metal box is a locked container. The second metal key is in the metal box. The second metal key is a metal key. The first metal key unlocks the metal box.

Test me with “unlock box with key / open box / take all / x key”.[/code]

However, this is very bad practice, since you will end up with a disambiguation loop and will never be able to refer to either key. The “x key” command shows the problem. This is a better solution.

[code]“Test”

A metal key is a kind of thing. The description of a metal key is “A metal key.”.

The Room 1 is A Room. The description of the room 1 is “A random room in a maze. There’s a door to the east and an intercom system on the north wall.”.

The first metal key is in room 1. The first metal key is a metal key. A metal box is in room 1. A metal box is a locked container. The second metal key is in the metal box. The second metal key is a metal key. The first metal key unlocks the metal box.

Test me with “unlock box with key / open box / take all / x key / first / x key / second”.[/code]

Here you will be able to refer to both the keys as they are distinguishable from one another.

Hope this helps.

Section 4.13 deals with this topic, but the only way I could figure out to get the effect you seem to trying for was a little indirect:

[code]Place is a room.

The metal box is a closed locked lockable openable container. The metal box is here.

A key is a kind of thing. A metal key is a kind of key.

The box out of sight is a container.

Three metal keys are in the box out of sight.

Before locking or unlocking the metal box with a metal key:
now the second noun unlocks the noun.

When play begins (this is the distribute metal keys rule):
While fewer than two metal keys are in Place:
now a random off-stage key is in Place;
now a random off-stage key is in the metal box.[/code]

I couldn’t figure out a way to assert the existence of multiple identical metal keys that weren’t in something (like you can with unique things), so the “box out of sight” is used to create them. Since the box out of sight is “off-stage” (not placed in any room), at the start of play you can move as many from there to places in your world as you like.

Since the lock-fitting relation is built in to the Standard Rules as a one-to-many relationship between keys and lockable things (e.g. a key can unlock many locks but each lock is unlocked by only one key), the before rule is a bit of legerdemain to make sure any metal key being used in a particular action will work with the metal box with minimum complexity.

You only need to say this.

The metal box is a locked container.

The standard rules automatically assumes that a locked door or a locked container is lockable, openable and closed.

You can do that like this.

There are 3 metal keys.

Hope this helps.