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.