Exits won't unlock?

Caleb_Blade
02 Dec 2016, 08:21

So basically I have an exit in my game that is initially locked. When the player attempts to move to that room while the exit is locked the following script runs.
"If player is carrying object key then unlock exit blackroom"
"If player is not carrying object key then print message" "A key is needed to get inside"

Even with the key in the inventory, the exit will not unlock when I attempt to enter it. Any ideas on what the problem might be?


OurJud
02 Dec 2016, 13:43

Not without seeing the exact script we can't.

Paste the block of code that handles the unlocking so that people can dig out the problem for you.


Caleb_Blade
02 Dec 2016, 21:29

if (Got(back room key)) {
UnlockExit (insidebackroomexit)
msg ("you unlock the back room using the back room key")
}

I should also point out that this is an "in" direction and not one of the norh, south, east or west. Idk if that makes a difference but yeah


OurJud
02 Dec 2016, 21:45

Do you get the locked message when you try to unlock the exit or when you try to go 'in' after unlocking it?


Caleb_Blade
03 Dec 2016, 05:48

Well at the moment I was simply hoping the exit would unlock on its own if the player attempted to enter the room with the key in their inventory, otherwise it would stay locked but in my case, even with the key in the inventory it will still say the exit is locked.


Caleb_Blade
03 Dec 2016, 06:12

Ok so i've got it working now. What I did was create a "door" object with the "unlock" verb which would allow the player to unlock the door if they were carrying the key. Initially I was using the "run a script instead of moving the player automatically" in the exit itself though i used the same script so im not sure why that wasnt working


hegemonkhan
03 Dec 2016, 07:50

the 'Exit/door/locked/unlock/open/close' is confusing stuff... I still get confused with it, and almost everyone else does too.

Exit/door locked/unlocked/open/close and the defibrilator/bob/troll/saying-command are the two most confusing parts within the tutorial. Everyone needs help with these two things in figuring out how to get them to work, sighs.


The Pixie
03 Dec 2016, 08:24

This might help:
https://github.com/ThePix/quest/wiki/Keys-and-Locks