About Braces

Some tags take script commands - for example, the speak tag in an object definition can take a script command to execute when the player speaks to that object, for example:

speak msg <"La la la I'm not listening to you!">

If you want to specify more than one line of script to execute, surround the script commands in braces { }.

For example:

speak {
	msg <"Alright mate, have this tasty banana," he says, handing you some fruit.>
	give <banana>
}

Braces can also be used to create complex if statements:

if ( %cash% > 30 ) then {
	msg <You hand over thirty bucks and make your way into the club.>
	dec <cash; 30>
	goto <dancefloor>
} else {
	msg <You don't have enough money to get into this club. You slink off to a nearby caf� instead.>
	goto <cafe>
}

Note that with if statements, the else can appear on the following line whether braces have been used or not. For example:

if got <potatoes> then msg <I see you have potatoes!>
else msg <You appear to be agriculturally lacking.>

 

< Back