Login
Remember
IF Answers
Ask a Question

# Is there syntax to allow multiple expressions in the same script?

0 votes
65 views
asked Jun 25 in Authoring by Corbomite (1 point)
retagged Jun 26 by Dannii

I'm working a Star Trek game and am using a "say" command for the Turblolift. Everything is working fine, but I worry I'm facing a situation where I'll need to create a new script for every possible spelling or capitalization (We're using the web GUI for this whole project and won't be copy/pasting any code).

If I want the commands for "Deck 6, deck 6, Engineering, engineering" to all send the player to the same location, is there syntax I can use to include it all on one line? Apologies if the answer is in the tutorials; everything I've found that seems relevant results in errors.

- syntax
- quest

## 1 Answer

+1 vote
answered Jun 25 by hegemonkhan (161 points)

'game' Game Object -> 'whatever the tab' Tab -> find the checkbox for ~ 'allow the period to separate commands' and have it be checked in, of course.

I think this will do what you want, but I'm not sure.

here's some code stuff (which I know you don't want), but here it is (as I don't know the GUI~Editor that well):

for dealing with caps vs non-caps:

http://docs.textadventures.co.uk/quest/functions/string/lcase.html
http://docs.textadventures.co.uk/quest/functions/string/capfirst.html

and another method for multiple conditions:

    if (text = "deck_1" or text = "bridge_1" or text = "quarters_1") {
      // blah scripts
    } else if (xxx blah xxx) {
      // blah scripts
    } else {
      // blah scripts
    }

you can use 'and' too, but you need to understand these 'bitwise' (or english grammer) meanings of: 'and', 'or', and 'exclusive or'

commented Jun 26 by Corbomite (1 point)
Thank you! Using the second method, its working great. And thanks for the links, I am interested, I just need to stick with the GUI for now.

## Related questions

- Is there a limit to the length of a script in Quest?
- Is there an expression or script that addresses an attribute that is shared by all objects in a room (or the game)?
- Is there any way to paste code into the web version of Quest?
- Is there a way for me to have collapsed menus on startup in Quest?
- With Flexible Windows by Jon Ingold, is there a way to make the text display at the top of the window, even in Gargoyle? (Inform 7)

...