How to choose a random monster

I’m pretty new to Inform and have only skimmed through the documentation. I was wondering if there is any way to have a monster randomly chosen from a list at the start of play? I was thinking maybe have a table of the different monsters and chose from that. If you think you know a better way, I welcome the feedback. I don’t know the syntax very well so tips on how things should be worded would be much appreciated.

Context: The player starts the game sealed in a house with a randomly chosen monster and must learn more about the monster to learn how to defeat it or learn about the house to find hidden areas or possible escape routes.

Example list of Monsters:

  • Alien
    • Xenomorph
    • Grey
    • Reptilian
  • Boogeyman
  • Chupacabra
  • Demon
  • Ghoul
  • Human
    • Serial Killer
    • Mad Scientist

Question: How to have the game chose a monster from the list and if it has more than one type, to chose between the types before the start of the game and make it the monster for the rest of the game?

2 Likes

The simplest thing is probably to just give it a property called “monstrous” (A person can be monstrous. The boogeyman is a monstrous man.) You instantiate all the monsters off-stage. Then, when play begins, you select a random monstrous creature and put that on stage.

1 Like

You’re embarking on a very ambitious project, while also learning a new language from scratch. (It’s very ambitious because having ten different scenarios in a single game comes with all kinds of headaches, both in terms of implementation – making sure you are having everything correspond correctly to the different monsters – and in terms of design – because it is far from trivial to ensure that the randomisation actually adds anything for players, most of whom wouldn’t want to replay the game if the differences between scenarios are only small.)

This makes me think that perhaps the best advice to give you is this. Yes, it is very much possible in Inform to choose a random monster. But in order to learn Inform, I would start out by creating a scenario with a single monster, and then generalising from there. This has the additional advantage that the Inform documentation starts with basic ideas about how to create rooms and objects and actions and so on, and you can work on your scenario as you work through the documentation.

4 Likes

You’re right, it is very ambitious, but I wanted to have a reasonable end goal in mind and work towards it. Once I work up to being able to randomly choose a monster from a selection, I want to work on changing elements of the house to better mach the chosen monster. I’ll worry about that when I get to it, though.

1 Like

Just as an aside, have you looked at When In Rome 2 by Emily Short? It’s one of the full worked examples for I7 (though I’m not sure the source is currently available due to technical difficulties…hopefully that’ll change soon, when the new Inform version drops and the website gets updated).

Are you making Cabin in the Woods: The Text Adventure? :smile:

2 Likes

That’s a good description of it. A bit less humor though.

2 Likes

That movie has a weird sense of humour anyway.

Does this mean it’s in the “Writing with Inform 7” main documentation?

Doesn’t look like it, but the internet archive has a copy:

https://web.archive.org/web/20171109155817/http://inform7.com/learn/eg/wir2/index.html

2 Likes

Nope, along with the manuals, the I7 devs released four “worked examples”: full, playable games written in I7 to show off the language. Unfortunately the part of the website they were on is currently down as far as I can tell, but as Josh mentioned, they’re available on archive.org.

1 Like

Thanks, I’ll have to check it out. I’m still a long way off from having a working game, but I think it’ll be a good learning experience.