Container with password key showing object inside

gideonwilliams
07 Jun 2012, 09:03
I have created a box container with a password which will not let you into it until the password is cracked (using a Function and call function). The password is perins

I chose the openable/closeable container because it allows me to run the script "on opening". I then want to have the objects listed on the screen (with hyperlink) when I eventually crack the password. Unfortunately this option appears only available on the Container option.

Have been working on this for days without any luck. Might someone come to my rescue please?

If solution can avoid going too much into code I'd be grateful :o)

Thanks

Gideon

Pertex
07 Jun 2012, 14:53
Yes, this is not easy to be done. If you are using the script "on opening" it overrides the Questfunction for opening a box, so you must set the 'isopen' attribute in the script. With function ListObjectContents (obj) you get the line "It contains..."

gideonwilliams
07 Jun 2012, 15:06
Thank you so much for the quick reply AND the enclosed improvement. I have one question which is why you have added in obj in the parameter settings for the codeword function and this in the container script?

Thanks again

Gideon :D

Pertex
07 Jun 2012, 15:13
OK, you could use ListObjectContents in your function codeword without parameters like this:

ListObjectContents (box)


but then you can use the codeword function only with this box. If you want to use the codeword function with an additional object, too, you must pass the object to this function.

codeword(this)
calls the function and uses the active object as parameter.
But if you don't need this function for other objects, you can remove the parameter