How do I create links to random pages?

Is it possible to create links that go to a random page in your Quest game? And is it possible to select the list of pages that this link can go to (I don't want every page in my game to be accessible from the random link, only certain ones).


Io

YES!

What you are looking for is the command text option. When creating your text, it looks like this:

{command:NameOfTheCommand:WordsPlayerSees}

It creates a hyperlink of WordsPlayerSees that, when clicked, executes command NameOfTheCommand.

So you want a command called, I don't know, 'GoToRandomRoom', with word-input '12345'. Then you structure it like:

{command:12345:Click Me!}

Under that commands, you basically use a Switch block, switching based on a GetRandomInt. It'd look something like this (Pardon my psuedocode):

Switch Case (GetRandomInt(1,5)){:
case 1{
Move Player to room1
}
case2{
Move Player to ToothbrushRoom
}
case3{
Move Player to room3
}
etc.

To instead make a list of possible ones, you instead want to use menu:
First create a blink Stringlist
Add the possible options to it
Show the menu, with a Switch-case inside.

Like so:

WhateverYouWantToCallTheNewStringList = newStringList()

Add to WhateverYouWantToCallTheNewStringList "Option 1"
Add to WhateverYouWantToCallTheNewStringList "Option 2"

Show Menu based on WhateverYouWantToCallTheNewStringList{
after input:
Switch Case based on result{
case "Option 1"{
Move player to room99
}
case "Option 2"{
Move player to GameOverRoom
}

Hope this helps!


If you're doing a text adventure, the advice above is probably close enough that you can probably figure it out.

If you're making a gamebook, I'd suggest making a page which, when visited, immediately sends the player to a random page.

The random page would be "script" type, and would look something like this:

switch (GetRandomInt (1,4)) {
  case (1) {
    MovePlayer (page12)
  }
  case (2) {
    MovePlayer (page17)
  }
  case (3) {
    MovePlayer (page29)
  }
  case (4) {
    MovePlayer (page44)
  }
}

Which chooses a random number from 1 to 4, and then moves the player to a different room (one of 4 options) based on that number.


Thanks for the helpful responses. Is there a way to do this on Squiffy too?


Log in to post a reply.

Support

Forums