Ask a question confusion

tingtingminer
I am currently making an adventure requiring asking questions. If you enter the scripts menu and scroll down to ask a question, when you have set the question, I can only see 1 option for the script, and when I test it if I click yes or no It does the same thing. Is there any way I can make it so it runs a different script for yes or no.

Thank You :D

Pertex
Could you append your game here? It's hard to say anything about your problem if we can't see your code

mazzy15
I am having the same problem. There is no option to make two different answers, which is irritating.

The Pixie
For a yes/no question, use the "ask" acript command. The result goes in a variable called "result", true for yes, false for no, so you need to check that value.

Here is some example code to do that:

ask ("Are you sure?") {
if (result) {
msg ("Let's do it then!")
}
else {
msg ("Nevermind then!")
}
}

mazzy15
the only 'ask' script I can find is an 'ask question' script.

it says, 'Ask question', in a box 'text' which you can change to 'expression'. then a text box to write the question. underneath it says, 'after choosing, run script.' with an arrow.

Alex
You can check the result by looking at the "result" variable - you can put it inside an "if" expression.

For example, add an "if" script and set the expression to "result". The script inside the "if" will only run if the user selected "Yes". Use "Add Else" to add a script to run if the user selects "No".

HegemonKhan
Do you want a question with the answer choices of "Yes/No" (only 2 options-responses), or do you want a more open question and-or being able to have more answer choices than only just 2 options-responses ???

-----------

like the others have already stated above:

when using the 'Ask A Question' script, this (only a single example though) is how it works:

Add A Script -> Output (Ask A Question) -> Ask question [text] 'Are you dead?', after choosing (Yes or No), run script:
-> Scripts (If...) -> If [expression] 'result', then:
->-> 'Output (Print a Message) -> Print [message] 'You go to the afterlife' (this is for the Yes choice you clicked on)'
->-> Add Else -> 'Output (Print a Message) -> Print [message] 'You stay on the earth' (this is for the No choice you clicked on)'

--

an alternative method, is to do this, instead:

Add A Script -> Scripts (If...) -> If [player answers yes to] [question] 'Are you dead?', then:
-> 'Output (Print a Message) -> Print [message] 'You go to the afterlife' (this is for the Yes choice you clicked on)
-> Add Else -> 'Output (Print a Message) -> Print [message] 'You stay on the earth' (this is for the No choice you clicked on)'

-----------

if you want to ask a single answer question that produces an attribute or a variable, then you use Get Input script:

Add A Script -> Output (Print a Message) -> Print [message] 'What is your name?'
Add New Script -> Output (Get Input), then run script:
-> Variables (Set a Variable or Attribute) -> Set variable 'player.alias' [expression] 'result'

----

You can also use show a menu (after the Get Input script) to bring up a menu with several answer-options to choose from (and then you can set an attribute or variable to that result ou choosen):

Add A Script -> Output (Print a Message) -> Print [message] 'What is your name?'
Add New Script -> Output (Get Input), then run script:
-> Variables (Set a Variable or Attribute) -> Set variable 'player.alias' [expression] 'result'
-> Add New Script -> Output (Show a menu):
->-> the menu's question -> 'What class are you?'
->-> the menu's choices -> split ("warrior;thief;barbarian;wizard" , ";")
->-> the menu's asking of if you want to be able to cancel your menu choice -> [no]
->-> Add New Script -> Variables (Set a Variable or Attribute) -> Set variable 'player.class' [expression] 'result'

lastly, you can use the Scripts (Switch...) :

(this is continued from above script block, in this example of mine)

->-> Switch (if) 'player.class'
->->-> Case (is a) 'warrior', then... like setting attributes (player.strength = player.strength + 1)
->->-> Case (is a) 'thief', then... like setting attributes (player.agility = player.agility + 1)
->->-> Case (is a) 'barbarian', then... like setting attributes (player.endurance = player.endurance + 1)
->->-> Case (is a) 'wizard', then... like setting attributes (player.intelligence = player.intelligence + 1)

----

these are all just examples of mine, of (at least some of the) different types of "questions" you can do in quest

and for my examples, you can replace the variable (set a variable or attribute) with output ( print a message [message or expression] ), if you want answer type responses too. Or, you can use whatever script type choice you want as well of course.

for loose (coding not included lol) example :

Do you want to explore the desert or the tundra?
if choice is desert, move player to desert room
if choice is tundra, move player to tundra room

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

Support

Forums