Error with using the "visited" attribute

puzzler7
I'm getting this error with using kitchen.visited (kitchen is a room):
Error running script: Error compiling expression 'game.pov.parent = hallway and kitchen.visited=true': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Boolean'

I looked at the attributes for kitchen, and I don't see a 'visited' attribute. I'm using the latest version of Quest (or at least whatever was on textadventures.co.uk on Friday), so did I miss something? Some feature I need to check?

puzzler7
Let me know if you need me to post my full code.

Anonynn

I'm getting this error with using kitchen.visited (kitchen is a room):
Error running script: Error compiling expression 'game.pov.parent = hallway and kitchen.visited=true': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Boolean'

I looked at the attributes for kitchen, and I don't see a 'visited' attribute. I'm using the latest version of Quest (or at least whatever was on textadventures.co.uk on Friday), so did I miss something? Some feature I need to check?



I'll try to help a little. So basically you're using "visited" like a "flag". For example, kitchen.visited=True or kitchen.visited=False. Right?

1. I would say go to your Kitchen's Attributes Tab
2. Click "Add"
3. visited (Boolean) unchecked (making it False)
4. Then go to Script Tab of the room, find the "After Entering" or "Before Entering" whichever you prefer (before might work better).
5. Add a "Script", "Set variable or attribute" then write kitchen.visited=True

Make sure that everything matches up. That's really important in Quest.
For example, your room-name is kitchen. So Kitchen.Visited (will cause errors), KITCHEN.visited (will cause errors), Kitchen.visited (will cause errors). If you write the name in lower case, every time you use it, it must be lower-case. Same goes for the attribute, visited. Also, make sure True and False are capitalized, otherwise they may not work in some instances.

I hope this helps to solve your problem, make sure you delete your old code that was causing the errors in the first place!

Pertex
The visited attribute is created, when you enter a room. So you must check if this attribute exists, something like this
game.pov.parent = hallway and GetBoolean(kitchen, "visited")=true

puzzler7
Ah, ok. I didn't realize the visited attribute didn't exist to begin with. Thanks!

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums