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.

enter image description here

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.
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...