Help with weapons in Inform 7 needed.

If you want “weapons” to have some common characteristics (for example, if you want to allow “kill the troll with [something]” only to work when the specified something is a “weapon”, then you have to define a “kind” called “weapon.” If there is nothing special (in the context of the game) about something being a weapon, then you can just say “the Knight carries a sword,” in which case a thing called a sword will be created and placed in the possession of the Knight.

Robert Rothman

PS No need to capitalize the names of all nouns. I believe (not sure about this) that, by default, Inform 7 interprets a capitalized noun as proper-named (meaning it does not use an article in front of the name of the noun) so its less work not to capitalize improper-named nouns (because you don’t have to override the default behavior).

Yes. The “try consulting the Kinds index” means that if you click on the Index button and choose the Kinds tab, you can see that a “weapon” is not in the list of kinds of objects. You have to define the kind first by saying “A weapon is a kind of thing.”

The only instance of “X carries a weapon called Y” I found in the manual is in example 282 (Lanista 2), where the weapon kind is defined in the previous paragraph:

[code]A weapon is a kind of thing. A weapon has a number called the maximum damage. The maximum damage of a weapon is usually 4.

The gladiator carries a weapon called a trident. The maximum damage of the trident is 5. The gladiator carries a weapon called a net. The maximum damage of the net is 1.[/code]

Also note that you need to compile your project at least one time successfully in order for the index to be populated. (It starts out blank.) For this reason I always start every project with one room and compile before adding anything else.