Multiple Answers with Different Outcomes

I want to use the Quest program to represent something in a LARP (Live Action Role Play) with an Escape Room bent. So basically I want the players to go out in the real world, locate a bunch of numbered nodes, jot down those numbers and return to type them in to prove they found them. Once they've found them all, and all nodes are switched on, then another option will appear (basically just going to make a Scenery Object visible).

The trick is, how do I nest the script / write the script in such a way that they can put in multiple correct answers that will each then run their own script and turn on their own node.

  <repair type="script">
    msg ("'Which nodes have you repaired?  Please input the node numbers so that the connection can be re-established.'")
    get input {
      if (result = "1986") {
        msg ("'Connection established.'")
        SwitchOn (Node 1986)
      }
      else if (result = "8370") {
        msg ("'Connection established.'")
        SwitchOn (Node 8370)
      }
      else {
        msg ("'Is it \"" + result + "\"?' you ask.")
        msg ("'Unknown node.'")
      }
    }

would you prefer a single input that holds/stores/gets all of the number inputs? (each node number is separated by a space in this example/case of mine, but you can change it to something else if you want)

for example:
input iteration 1: 100 200 300 400

<attr name="repair" type="script">
  msg ("Which nodes have you repaired?  Please input the node numbers (separated by a space) so that the connection can be re-established")
  get input {
    input_string_variable = result
    stringlist_variable = Split (input_string_variable, " ")
    foreach (string_variable, stringlist_variable) {
      switch (string_variable) {
        case ("100") {
          // WHATEVER scripting
        }
        case ("200") {
          // WHATEVER scripting
        }
        case ("300") {
          // WHATEVER scripting
        }
        case ("400") {
          // WHATEVER scripting
        }
        default {
          // WHATEVER scripting
        }
      }
    }
  }
</attr>

or, would you prefer multiple inputs for each number input?

for example:
input iteration 1: 100
input iteration 2: 200
input iteration 3: 300
input iteration 4: 400

<attr name="repair" type="script">
  msg ("Which nodes have you repaired?  Please input a single node number so that the connection can be re-established")
  get input {
    if (IsInt (result)) {
      input_string_variable = result
      switch (input_string_variable) {
        case ("100") {
          // WHATEVER scripting
        }
        case ("200") {
          // WHATEVER scripting
        }
        case ("300") {
          // WHATEVER scripting
        }
        case ("400") {
          // WHATEVER scripting
        }
        default {
          // WHATEVER scripting
        }
      }
    } else {
            msg ("Error: wrong input: type in a number next time")
    }
  }
</attr>

The Show Menu function is good for that sort of thing.

This is an example.

items = Split("Oran Berry (100);Pokeball (500);Power Points (50)", ";")
ShowMenu ("Purchase", items, true) {
  switch (result) {
    case ("Pokeball (500)") {
      if (player.pokedollar >= 500) {
        player.pokedollar = player.pokedollar - 500
        player.pokeballs = player.pokeballs + 1
        msg ("You bought a pokeball.")
      }
      else {
        msg ("You don't have enough Pokedollars.")
      }
    }
    case ("Oran Berry (100)") {
      if (player.pokedollar >= 100) {
        player.pokedollar = player.pokedollar - 100
        player.potion = player.potion + 1
        msg ("You bought an Oran Berry.")
      }
      else {
        msg ("You don't have enough Pokedollars.")
      }
    }
    case ("Power Points (50)") {
      if (player.pokedollar > 50) {
        msg ("You bought 50 Power Points.")
      }
      else {
        msg ("You don't have enough Pokedollars.")
      }
    }
  }
}

Log in to post a reply.

Support

Forums