Using a Switch

Creativita
I am trying to use a switch so that the player may answer yes or no to the question "do you want to get out of the car and run away," at one point in my game. I have followed the "Multiple Choices" tutorial and my script seems identical to the image. Can anybody refer to the image to the image I have attached and tell me what I have done wrong? Is there another way to ask the player a question in this context?

I know that the event isn't incredibly plausible but I am just using a basic story for my practice game.
Quest Screenshot 1.PNG

Pertex
Have a look at the wiki. There is the ask command http://quest5.net/wiki/Ask_%28script_command%29 for yes/no-questions or the Getinput command http://quest5.net/wiki/GetInput for textinput (Getinput will change in the next version of Quest so its better to wait for the change).

Alex
You need to use an expression for the case key. This means if you use yes or no, Quest will be expecting a variable of that name.

To fix the problem, use quotes around the expression, like this:


"yes"
"no"

sgreig
You could also use the "if player answers yes to question <blank>" script that Alex demonstrated during his webcast presentation today. That would be even easier. The game would pop up a window prompting you to click yes or no and then continue from there.

Creativita
Thankyou everyone. I originally was using the ask function but I would prefer to use text input.

Creativita
Are you able to use a key that is longer that one word.

Alex
"as many words as you like"

Creativita
Why is that I am having difficulty using a switch in the same way to ask a character a question? I have made sure to follow your instructions.

Pertex
You must be careful! If you use a key "who are you" with the ask-command in the ask/tell tab, every single word of the key is evaluated. So if you "ask man about are" the keyscript is executed.
In your switch in your say-command the complete key is evaluated, so "say are" doesn't match the "who are you" key

Creativita
Thanks again. I'll make sure to do that.

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

Support

Forums