ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Locked door with key

This forum is the place to discuss the older ADRIFT versions 3.9 and 4.0.

Please refer to the ADRIFT 4 Manual for more information.

Postby Fabe » Tue Oct 26, 2010 2:52 am

I'm having a bit of trouble creating a locked door that requires a key to unlock. I've found and followed Mystery's tutorial but I can't get it to work, what could I be doing wrong.
Fabe
 
Posts: 9
Joined: Mon Oct 18, 2010 1:09 am

Postby Albaniua » Tue Oct 26, 2010 8:33 am

hmmm

a myriad of things, including not sacrificing the right kind offering before starting.

Could you be more specific?
What have you done?
Honk if you've played Escape from Rungistan.
User avatar
Albaniua
 
Posts: 87
Joined: Tue Sep 30, 2008 8:55 pm
Location: Las Vegas, NV

Postby P/o Prune » Tue Oct 26, 2010 8:47 am

Fabe wrote:I'm having a bit of trouble creating a locked door that requires a key to unlock. I've found and followed Mystery's tutorial but I can't get it to work, what could I be doing wrong.

It should be possible using tasks...
Are you using V.4 or V.5?
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 60Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4394
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Postby Duncan_B » Tue Oct 26, 2010 9:56 am

Create a key as a dynamic object. Now create another object that you want to be locked. Open the object in the Generator and click the "Attributes" tab. Click the box that says, "Object can be Opened and Closed." Then click the box in front of "... and is Lockable with key." Click the drop-down menu and choose the object you want to act as a key.

You're done.
User avatar
Duncan_B
 
Posts: 1220
Joined: Fri Apr 01, 2005 8:26 pm
Location: Chicago, Illinois
Points: 11

Postby Fabe » Tue Oct 26, 2010 1:44 pm

This the tutorial that I used to try and create my locked door and I'm running a unregistered version of adrift 4.

http://www.adrift.org.uk/cgi/f/ikonboard.cgi?act=ST;f=4;t=3170

I did every thing but when I try and test it out in the runner I'm unable to unlock the door, I've trying every command I can think of Use key,unlock door,unlock door with key, use key to unlock door, etc.
Fabe
 
Posts: 9
Joined: Mon Oct 18, 2010 1:09 am

Postby Duncan_B » Tue Oct 26, 2010 7:50 pm

Forget the tutorial. I can walk you through it. Have you created a door lockable with a key as I described above? If you have, you should have no problem unlocking it. Just pick up the key item and type UNLOCK DOOR.

Ostensibly, you also have two rooms that you want to connect. Open one of the rooms in the Generator and select the "Directions" tab. Select the room you want to be able to travel to from one of the drop-down menus on the left and then change the "Only if..." from "Task" to "Object." Select your door object from the next drop-down menu over, then from the next one over select "Open."

When you click the "Update Room" button, you will be asked if you want to copy that movement restriction from the other direction, which I'm guessing you do in this case.

Let me know how this works out for you. It really should be an easy thing to do.
User avatar
Duncan_B
 
Posts: 1220
Joined: Fri Apr 01, 2005 8:26 pm
Location: Chicago, Illinois
Points: 11

Postby Fabe » Thu Oct 28, 2010 1:02 am

I'm sorry but no matter how may times I try I just can seem to get it to work. Your directions are clear and easy to understand but once I get every thing set up it still tells me i can't unlock the door.

I did manage to make a lockable box that worked but I can't get the door to.
Fabe
 
Posts: 9
Joined: Mon Oct 18, 2010 1:09 am

Postby Albaniua » Thu Oct 28, 2010 2:32 am

Duncan,
just for kicks I decided to try it to.....I can't get it to work either. In the debugger, when you look at the object there should be three status, right? open, closed and locked. When I look in mine it only shows open and closed.
Do you have to create a task to unlock the door? --setting the conditions to having to have the key and such....
Honk if you've played Escape from Rungistan.
User avatar
Albaniua
 
Posts: 87
Joined: Tue Sep 30, 2008 8:55 pm
Location: Las Vegas, NV

Postby Hensman Int'l » Thu Oct 28, 2010 3:18 am

I looked at the file Albaniua sent me. Yup, something simple.

You'll need to create tasks to: lock door, unlock door, open door, close door. The first two will require the player have the key. Note: you could make each task reversible, however that will only work while you are still in the room that you performed the task.

Also, if you leave descriptions blank, you will get "You can't unlock that." and "You can't open that." although the debugger will say otherwise.

Hope this helps.
Officially and Fully Released:
The Fly Human (v.4) - 2010
Brain Dead Weekend (v.4) - 2011
User avatar
Hensman Int'l
 
Posts: 197
Joined: Sat Aug 05, 2006 12:48 am
Location: Wisconsin USA
Points: 10

Postby Albaniua » Thu Oct 28, 2010 3:52 am

when I made my first game, I didn't know about keys, so I just tasked my own door, key and opening procedure. I'd never just used the ingame functions. Duncan's description made it sound as if there were in game preset tasks where you could "unlock door" without having to write a task for it to happen.
Honk if you've played Escape from Rungistan.
User avatar
Albaniua
 
Posts: 87
Joined: Tue Sep 30, 2008 8:55 pm
Location: Las Vegas, NV

Postby Fabe » Thu Oct 28, 2010 4:01 am

OK cool,it works now.
Fabe
 
Posts: 9
Joined: Mon Oct 18, 2010 1:09 am

Postby Duncan_B » Fri Oct 29, 2010 9:36 pm

I'm really baffled by this. I made a test game just to see what all the fuss was about, and it seems I couldn't get a door to unlock using a simple "unlock door" command (I also tried "unlock door with key" and, after a few changes of flavour, "unlock cake with lobster"). This should not be happening... I have one particular work in progress that I've never really planned to publish anymore in which doors can be locked and unlocked without having created a task for doing so (I can release this game as a demo without a password, if people are interested in taking a look at it/searching it for "lock" or "unlock").

I've also conferred with Tiberius Thingamus in the matter, who reports that the hovel table in Yon Astounding Castle! of some sort is not unlocked or opened by a task (though there are tasks associated with unlocking or closing if the character does not have the key-- these report that the player needs a key). These games were both written on ADRIFT 4.0, release 51. So, I'm wondering what's happening that keys now require tasks to operate? Seems like a question for Campbell.

As for opening and closing a door, you by no means should need to do that with a task. That is built-in behaviour for sure. Your door just needs to be unlocked, first.
User avatar
Duncan_B
 
Posts: 1220
Joined: Fri Apr 01, 2005 8:26 pm
Location: Chicago, Illinois
Points: 11

Postby Jador » Tue Nov 23, 2010 1:36 pm

Hi, I've been having problems with the locked door as well.

I used Hensman's idea of creating four tasks associated with the door, but the default "open door" still works with or without the key, whether the door is locked or unlocked.

I've tried restricting the task "open door" to require the key, but it doesn't seem to be working. I've also tried creating a new state: "locked" under the "object begins in state" dropdown menu, (the only two options are "on" and "off"), but it still allows the player to open the door whether it's locked, unlocked.
Jador
 
Posts: 2
Joined: Tue Nov 23, 2010 1:30 pm
Location: New Hampshire

Postby Jador » Tue Nov 23, 2010 2:40 pm

Wow. Just found the solution. And it's so easy, I completely missed it.

Note, I have ADRIFT v. 4.0, build 51, so your mileage may vary.

I created two rooms: Cell and Dark Hallway
I created two items: Iron Door and Iron Key.
I set the Iron Door to "object can be opened and closed" in the Attributes tab, but I did NOT try to set the "starts off in" status yet.
I checked the "...and is lockable" and selected "iron key"
I went BACK to the Iron Door attributes tab and the "object can be Opened and Closed and starts off " dropdown. The "locked" status is now selectable. I chose it.

I set the directions for both Cell and Dark Hallway to East and West respectively with the restriction on both that the Object (iron door) MUST be (open).

Now, the door won't open unless it's unlocked. You can't unlock it without the key, and it acts as is appropriate for a door which opens and closes.

Creating new tasks for opening and closing the door apparently caused confusion in the ADRIFT Runner, allowing the door to be opened when it was already open, closed when it was already closed and locked when it was already locked. Despite restrictions in those tasks which were supposed to make all of the above impossible.

I don't know if people have been having said problems with earlier versions of ADRIFT, but this solution might work for almost all situations which require a simple, locked door.
Jador
 
Posts: 2
Joined: Tue Nov 23, 2010 1:30 pm
Location: New Hampshire


Return to ADRIFT 3.9 and 4.0

Who is online

Users browsing this forum: No registered users and 3 guests