You can conditionally display text depending on the value of an attribute using "if" inside curly brackets. You can also use "else":
{if gender=male:You are a man.}{else:You are a woman.}
You can also conditionally display text:
You can see a [cupboard]. Maybe you should [open] it?
[open]:
You open the cupboard.
[cupboard]:
The cupboard is {if seen open:open, and there are empty bottles
inside}{else:closed}.
@set questions_asked=0
[[Begin.]](AskQuestions)
[[AskQuestions]]:
{if not seen Doing:[[How are you doing?]](Doing)}
{if not seen Weather:[[How is the weather?]](Weather)}
[[Doing]]:
@inc questions_asked
{if questions_asked=2: [[Finish.]](YouWin)}{else: [[Ask another question.]](AskQuestions)}
[[Weather]]:
@inc questions_asked
{if questions_asked=2: [[Finish.]](YouWin)}{else: [[Ask another question.]](AskQuestions)}
[[YouWin]]:
You successfully asked two questions.
<object name="animal_1">
<attr name="type" type="string">lion</attr>
</object>
<object name="animal_2">
<attr name="type" type="string">zebra</attr>
</object>
// some Script/Verb/Function:
if (this.type = "lion") {
msg ("Oh... %@$@#.... I can't outrun it and I don't have any weapon/protection.... $#@$@#!")
msg ("The hungry lion easily chases you down, tears you to shreds, and gobbles you up.")
msg ("GAME OVER")
finish
} else if (this.type = "zebra") {
msg ("You admire the beautifully white and black striped zebra.")
}
<object name="player">
<attr name="cash" type="int">100</attr>
</object>
<object name="shop_owner">
</object>
<object name="sword">
<attr name="parent" type="object">shop_owner</attr>
<attr name="price" type="int">50</attr>
</object>
// some Script/Verb/Function:
if (player.cash >= sword.price) {
player.cash = player.cash - sword.price
sword.parent = player
msg ("You bought the sword.")
} else {
msg ("You don't have enough cash to buy the sword.")
}