Here's the situation:
I have a container object (named "device".) I also have four key objects in the game; red key, green key, blue key, and black key (with object names, greenkey, redkey, bluekey, and blackkey). Using the "Advanced" tab, I create a boolean property "is key" on each one (but on no other objects in the game). The keys are takeable, and the device is not. The device is set up so that it's neither openable, nor closeable. The player also can't remove objects from it, but adding objects is controlled by a script.
What I want is for the user to only be able to add the keys - "Put key in device" - to the container, but I can't get it to evaluate quest.add.item.name to the actual key object. I think the logic of the script is correct, but the syntax of the if comparison is wrong. It says in the script area (when I click on the Add verb in the container tab):
if #quest.add.item.name# has the property "is key" then
...
I believe that the game engine is trying to evaluate "#quest.add.item.name#" down to "#bluekey#", "#greenkey#", "#redkey", or "#blackkey#" when I (during playtesting) use the keys in the 'correct' manner, instead of evaluating them to the object named by "#bluekey#", etc... so that it'll test the object, not the string "#bluekey#" to see if it has the "is key" property.
I've even tried removing ".name" from the above test, thinking it ("#quest.add.item#") would then evaluate to an object, but nope!
This is driving me nuts, as there's got to be a way to make a container that only holds certain types of items. And this (the Quest game I'm currently working on) isn't the only one I'd like to use this technique on! And hard-coding the item names isn't flexible, because what if I want to add a yellow key, or a gold key? Then I gotta rewrite that part of the script again - YiQ!
For anyone whose interested, email me and I'll attach the .cas file (so far) for you to play with. It's a spoof of Myst, a sort of Myst pre-history involving a hacker, some desert islands, and... Oh, wait. I'll give too much away.