Having some issues with "responses of responses" on my tutorial

Thanks for opening my question :)
Long story short, first time giving the creation of text adventures a try, I've been goofing around the software and it's been fun!

Anyways, at the start of my game a voice asks you if you've ever played a game like this, i managed to make it so that if you answer "Yes" or "No", it works as intended (Answer only counts once)

Answering "No" is working, it just continues with that voice telling you more or less how these games are played, my issue is with answering "Yes", i want this to promp the question "Do you want to skip the tutorial?" (Which it does), but then i couldnt figure out to create a "yes/no" for that...

Any help is greatly appreciated, thanks!


there's a built-in 'yes:true/no:false' Function:

'ask' (popup menu) Function or 'Ask' (inline: hyperlinks in left big text box area) Function

(unfortunately these 'ask/Ask' Functions are not clear and a bit misleading in how they work - at what they're actually doing, so new people don't realize to use them for their purpose or they use them incorrectly as they don't realize/understand how these Functions are to be used. They seem like they are open-ended-question Functions, but they're actually like a court lawyer's/judge's questioning, which requires the response/answer of the witness/whoever to be strictly 'yes/no' only, type of questioning)

http://docs.textadventures.co.uk/quest/scripts/ask.html
http://docs.textadventures.co.uk/quest/functions/ask.html

ask ("Do you want to skip the tutorial") {
  // quest automatically (hidden from you) does this: result = YOUR_SELECTED_INPUT // yes ---> true, no ----> false
  if (result) { // this is it's long version: if (result = true) {
    msg ("You decided to skip the tutoral")
  } else { // logically conceptually: if (result = false) {
    // your tutorial scripting
  }
}

if you need help doing this in the GUI/Editor....

run as script -> add new script -> 'scripts' section/category -> 'call function' Script -> Name: ask // or: Ask

// 'ask/Ask' Function's scripting:

add new script -> 'scripts' section/category -> 'if' Script -> if [EXPRESSION] result
-> then, add new script -> 'output' section/category -> 'print a message' Script -> print [message] You decided to skip the tutoral
else,
-> add new script -> whatever script(s)


I got the popup options one working in no time, but i'd like it to work with the player typing yes/no rather than having to click the option, thing is im having some issue with that one, could you explain it some more please? Thanks a lot!


there's two ways of getting typed-in input:

  1. the 'get input' Script/Function ( http://docs.textadventures.co.uk/quest/scripts/get_input.html )
  2. the 'Command' Element ( http://docs.textadventures.co.uk/quest/elements/command.html )

get input {
  // quest automatically (hidden from you) does this: result = "YOUR_TYPED_IN_INPUT" // the Data Type of your typed-in input is always a String Data Type, but it can then be manipulated/converted via the 'ToInt/ToDouble/GetObject' Functions
}

------

some examples of various ways of using 'get input' Script/Function:

msg ("Name?")
get input {
  player.alias = result
  msg ("Your name is " + result)
  msg ("Your name is " + player.alias)
}

msg ("Are you a male?")
msg ("1. yes")
msg ("2. no")
get input {
  if (result = "1" or result = "y" or result = "yes") {
    player.sex = "male"
  } else if (result = "2" or result = "n" or result = "no") {
    player.sex = "female"
  } else {
    msg ("wrong input, try again")
  }
}

msg ("Your strength?")
msg ("Type in a number from 0 to 100")
get input {
  if (IsInt (result) and ToInt (result) >= 0 and ToInt (result) <= 100) {
     player.strength = ToInt (result)
  } else {
    msg ("wrong input and/or out of range/bounds, try again")
  }
}

Commands:

<command name="skip_tutorial_command">
  <pattern>skip tutorial #text_parameter#</pattern> // you'd type in during game play: skip tutorial yes // or: skip tutorial no
  <script>
    if (text_parameter = "yes") {
      msg ("You decided to skip the tutorial")
      // do/goto the next action/event you want done
    } else if (text_parameter = "no") {
      // do/goto your tutorial part
    } else {
      msg ("wrong input, try again, choosing/using: no or yes)")
    }
  </script>
</command>

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

Support

Forums