Really noob question

zigarot
25 May 2015, 06:49
Hi,

I am just trying to run a basic game to show a friend an example of a text adventure.
Essentially, I have 3 rooms, each with an object that must be used. those items then trigger a boolean attribute I've attached to "player".
If you use all 3 items, all 3 booleans attributes change to true. This works fine

I have a 4th object with an if statement. I want the if statement to check all 3 bools are true, then process the finish command, however my coding is pretty average.
This is the exact code I'm checking, but I receive an error

if (player.EngineFixed && player.CourseSet && player.CrewRescued) {finish}
else {msg ("You're not finished yet!")}

"Error compiling expression 'player.EngineFixed && player.CourseSet && player.CrewRescued': SyntaxError: Unexpected character: &"

So I can assume & or && is incorrect. I have tried , as well.
I had a search around, and from what I can see, I can learn about the functions feature and do it that way, but is there a simpler way to just have my script check the three bools and then finish?

jaynabonne
25 May 2015, 06:53
Quest uses "and" instead of "&&". :)

if (player.EngineFixed and player.CourseSet and player.CrewRescued)

It also uses "or" and "not" instead if "||" and "~".

The expression parse is FLEE (https://flee.codeplex.com/), if you want more details. There is a language reference there.

zigarot
25 May 2015, 07:03
Thank you Jaynabonne!
My programming knowledge is limited to the minimum amount of java to work a twitch overlay :(
Wish I had have asked 6 hours (and 30 minutes of forum browsing) ago.
:)

HegemonKhan
25 May 2015, 17:10
here's a useful link for all (most of) the commands and syntax that quest uses:

http://docs.textadventures.co.uk/quest/

the quest wiki site (quest's 'code bible' documentation reference source).