Problem storing kinds in tables and a player input question

I’m having a bit of trouble with the entries in a table. What I want to do is make it so that each area has a list of enemies that can be encountered randomly with differing probabilities. What I came up with looks like this:

Table of Eastern Arena Encounters ODDS ENEMY 25 kobold 95 eastern kobold 100 training dummy
(Kobold, eastern kobold, and training dummy have all been previously defined as kinds of enemies.)

To choose an enemy at random, it picks a random number between one and one hundred, then goes through the table one row at a time until the number picked is less than or equal to the entry on the odds column. That part works fine, however, whenever I try to get something from the enemy column, nothing happens. I tried adding ‘say “[enemy entry]”’ to it to figure out where the problem was, and it returns with “<illegal object number 1>” instead of the name of the kind stored there, and I’m assuming this is why nothing happens when I try to use the enemy entry for something, such as “now an[or the, I’ve probably tried both] enemy entry is in the location.” Any help would be appreciated, as I’ve been reading the chapter on tables in the documentation for the past couple days and don’t really get what I’m doing wrong here.

Also, I was wondering if there was a command that stopped the current block of code, asked for input from the player, and then continued where it left off. Sort of like how “if the player consents” works, but with more possible accepted inputs than yes or no. There are some examples in The Inform Recipe book of ways to ask for the player’s input, but those examples are not nearly so clean and elegant as the way “if the player consents” works.

You aren’t supposed to be able to put kinds in a table; see bug 690.

Perhaps you want to store exemplar objects in your table and clone them with Dynamic Objects?

For your second question, you might try the extension Questions by Michael Callaghan.

Ah, thank you very much! Writing with Inform didn’t mention this, and it didn’t produce a problem message, so I assumed it was possible, and I was just doing the syntax wrong or something. That extension looks like it’ll do very nicely, thank you!
Edit: I thought of a question just after I posted. Can you store commands or actions in a table? Like having “now the noun is in the location” in one column, and then using that somehow? There’s certainly other ways to do this, but I feel a table would be much neater.

Oooooh. I like this extension. This looks very useful, thanks for the tip!

You can write a couple of rules that do what you want, give them names, and then store those named rules in a table in order to abide (or follow or consider) them as wanted.

All right, thanks for your help. The documentation included with Inform 7 isn’t always explicit about what is and is not allowed where, so I greatly appreciate it.

It’s not always right either! :wink: