<object name="Boat">
<inherit name="editor_room" />
<inside type="boolean">false</inside>
<enter type="script">
if (Boat.inside = false) {
msg ("You are still at sea.")
Boat.inside = true
}
else {
msg ("You awake on a boat adrift at sea.")
}
</enter>
</object>
Jhames wrote:I don't know how to use flags in Q5.
But....
Is very easy doing that with attributes.
So go to the tab or your room, for example "Boat", and go to "attributes". Press add.
Name it with "inside", in the dropbox click boolean, and leave true unmarked.
Now you can make a script, for example "After entering the room"
Add new script.
Select Script - If
And make the condition.
Object attribute equals - Object [Boat] Attribute [inside] = false
Print: You are still at sea.
Else
Object attribute equals - Object [Boat] Attribute [inside] = true
Print: You awake on a boat adrift at sea.
To change the attribute.. in the script go to Variables Set A Variable Or Attribute, and... this is important:
In the box of Set variable, put the name of the object point attribute.
So, in the example look like this (Respect the upper and lower case):
Set variable [Boat.inside] = expression [true]
(In the Script Tab?)To change the attribute.. in the script
(Or is that the Attributes Tab?)go to Variables Set A Variable Or Attribute,
and... this is important:
In the box of Set variable, put the name of the object point attribute.