Is there a way to have a Random selection done in Quest?

Basically, in the game I am working on, at certain points I would like to have various things happen, and have it happen randomly so that the game could be different each play-through.

Specifically, this references things that the player would have no control over, but still keep it more interesting than a single path- in my example, after a specific event, the only choice will be "continue..."
After the continue is pressed, I would like to have four or five possible paths, and the game chooses one at random. For example, towards the end of the first quarter of the game, I would like there to be two options having the US join the war against Germany, and two or three where the US only goes to war against the Empire of Japan.

Is something like this possible?


K.V.

Hello!

Here are the randomizing functions:

http://docs.textadventures.co.uk/quest/functions/#random


Yes...
for just text displays of random descriptions:
in the room description:

You enter the room and see {Random:a snake:a ball:a bat:the empty floor, well, except for the dust}.

Or for random events that will affect the game:

 R = GetRandomInt(1,6)
        if (R=1 or R=2 or R=3 or R=4) {
          msg ("You try to climb the sloop but it is too slippery and you slide back down.")
          // MoveObject (player, DL_Cave5)
        }
        if (R=5 or R=6) {
          msg ("You manage to climb the slope, but after many failed attempts.")
          MoveObject (player, DL_Cave4)
        }

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums