Unlock error
cdutton184
06 Jan 2015, 13:21I believe I have found an 'error' in version 5.5.1!
When it comes to making containers lockable and you assign the 'No. of keys to unlock container:' to just 1 and then select the key you want. If you play the game the door, in my case, could be UNLOCKed without the right key being in my inventory or location.
For example this is how I setup a locked door:
I looked at the main script and found that the line <keycount type="int">1</keycount> is the problem. I deleted it (tried to change 1 to 0 first but it didn't work) completely and the default of unlocking the door: 'You do not have the right key.' now worked rather than saying 'Unlocked.' and unlocking the door regardless of having the right key to hand. But it does mean the key selected pop-up menu vanishes but at least the gold key is assigned in the script.
Using more than one key to unlock a single container works fine.
A convoluted way to do it until it gets fixed, I guess.
When it comes to making containers lockable and you assign the 'No. of keys to unlock container:' to just 1 and then select the key you want. If you play the game the door, in my case, could be UNLOCKed without the right key being in my inventory or location.
For example this is how I setup a locked door:
<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="adv">
<gameid>37dd0093-bde3-480d-b152-7b4bbec69ebb</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="hall">
<inherit name="editor_room" />
<exit name="doorlocked" alias="north" to="garden">
<inherit name="northdirection" />
<locked />
<runscript />
<script type="script">
if (not door.isopen) {
msg ("Closed.")
}
else {
MoveObject (player, garden)
}
</script>
</exit>
<object name="door">
<inherit name="editor_object" />
<inherit name="container_closed" />
<inherit name="container_lockable" />
<look>A wooden door.</look>
<feature_container />
<keycount type="int">1</keycount> // THE PROBLEM IS THIS LINE
<autounlock type="boolean">false</autounlock>
<autoopen type="boolean">false</autoopen>
<unlockmessage>Unlocked.</unlockmessage>
<nokeymessage>You do not have the keys.</nokeymessage>
<key type="object">gold key</key>
<onlock type="script">
LockExit (doorlocked)
</onlock>
<onunlock type="script">
UnlockExit (doorlocked)
</onunlock>
</object>
<exit alias="west" to="kitchen">
<inherit name="westdirection" />
</exit>
</object>
<object name="garden">
<inherit name="editor_room" />
<exit alias="south" to="hall">
<inherit name="southdirection" />
</exit>
</object>
<object name="kitchen">
<inherit name="editor_room" />
<exit alias="east" to="hall">
<inherit name="eastdirection" />
</exit>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="gold key">
<inherit name="editor_object" />
<take />
<look>A door key.</look>
</object>
</object>
</asl>
I looked at the main script and found that the line <keycount type="int">1</keycount> is the problem. I deleted it (tried to change 1 to 0 first but it didn't work) completely and the default of unlocking the door: 'You do not have the right key.' now worked rather than saying 'Unlocked.' and unlocking the door regardless of having the right key to hand. But it does mean the key selected pop-up menu vanishes but at least the gold key is assigned in the script.
Using more than one key to unlock a single container works fine.
A convoluted way to do it until it gets fixed, I guess.

Pertex
06 Jan 2015, 13:47Yes, this bug will be removed with the next Quest version