View Full Version : AIs and locked doors.

4th Aug 2002, 21:07
AIs don't open locked doors, unless they contain the key for the door. When I attach the key to the belt of the guard, and he would need to walk through a locked door for his next TrollPt, he will stop his patrol after I stole the key.

Well. This is dull.

I can add another key to him with a Contains link, "generic", then he will continue walking.

My problem is now that I will have a couple of AIs who shall be able to walk through locked doors. Do I need to give each of them the matching key, or is there some simple solution, like "linking the door to each of the AIs" or something?

BoundsTrigger, Button -> unlock Door?

Frobinert, Lockboxes? Hm... Nah.

Old Man
5th Aug 2002, 01:55
I don't know squat about dromed, Lytha, but I've noticed a couple a spots in the OM's that intrigued me about AI and locked doors. Have a look at these maybe.

1. TG Assassins -- some doors are unlocked (or lockpickable) until an AI with the key goes through. Thereafter the doors are locked. The servant taking Ramirez his snack locks the basement door behind him and it cannot be lockpicked after that.

2. TII Shipping & Receiving -- At least one of the patrolling AI around Building B who has no key will change his patrol route when an originally locked door is left unlocked.

5th Aug 2002, 08:49
Interesting, I did not know that the servant in Assassins makes the door unpickable. :)

Can you recall a mission in which the AI was able to walk through locked doors, even after you stole the key from their belt?

Uh huh... Baffords. Baffords for sure. (or isn't it? They *could* enter the throne room after I stole the keys and locked the doors again behind me, wasn't it?)

But that's a Thief1 thing, most probably "fixed" for Thief2, harr harr.

How about LotP, i.e. that castle south of the housebreakers; or the Karras' Office? And how about Precious Cargo, i.e. the storage room key (don't think so).

If the AI has to change the patrol path after I stole the key or unlocked some doors (compare S&R), it's not what I need. :)

Hm... no. Funny, I was sure of it as the Trickster himself that the guards can enter the throne room without the keys. Well...

5th Aug 2002, 21:06
I will need to do exactly the same thing for my FM.

Can't find it right now, but I recall that there is something you can add to the AI to say that they can walk through a certain locked door.

Have a look at the FM Burgomaster (Thief1) , where the servant walking up and down the street walks into his locked house as part of his patrol route. Because it's an FM, what works there should work in any FM.

BTW, I also clearly remember an AI still walking through a locked door after I stole his key from him!

6th Aug 2002, 00:18

This is FAR from being perfect or optimized yet; it's more like "lets test what this does and add it to the other junk in the test mission", but I guess the basic idea is in it.

I've placed a TrollPausePt into a door, linked it to the AI that I want to be able to walk through it. Then there's a FnordLock and a Up/Down Switch (I always spill buttons and switches all over the floor)

AIPatrol: TrollPt_RoomA -> TrollPause -> TrollPt_RoomB -> TrollPt_RoomA

FnordLock: Engine Features: Locked
Switch: Tweq: ON; none none none none

Links for the door:
CD: switch -> Lock
Lock: door -> FnordLock

AIWatchObj: AI -> TrollPause
Data: among a lot of default things, there's a "frob switch"

It is dirty and ugly yet, and the AI will sometimes lock the door instead of unlocking it.

I guess vaguely that maybe you can ignore the TrollPause and make the AIWatchObj Door (or FnordLock?) -> AI; then the AI unlocks the door automatically when it enters the specified radius of the door (I think).

Then add this link from the door to all the AIs that you want to be able to walk through the door.

Or really just a boundstrigger. But how do you set up a boundstrigger so that it does not react on the Player walking through it, but only to the AI?

6th Aug 2002, 17:37
My thinking is a little slow today, so I'm not sure I understand what you want to do :confused:

But, if you want the AI to keep going on his patrol after filching his key, the easiest way is to link 2 keys to him. One on his belt, and the other just in his possesion. That way he still has a key to open the door and continue his patrol.

If you don't want him to be able to open the door, but start another patrol, that would be a little more difficult, and since I haven't opened dromed in a few months, the first thing I could think of is to set a TrolPt righ in front of the door, and have patrol > random set. I'm not 100% sure this will work though. The other thing is messing with S&R's. Although I'm not sure if you could set up a door as a Source, when it's locked AND when the guard doesn't have a key.

And about the bounds trigger, sorry - I haven't yet tried to do anything at all with one of those:)

But I do thank you Lytha. I haven't had an urge to open dromed, but I love trying to figure stuff like this out. When I get home, I'll have to play with this :D

6th Aug 2002, 20:57
I think the AIWatchObj would be the way to solve this.

I know about the double key-contains; and I will use that for 2 of the AIs that I want to be able to walk into a certain area (keys at the belt or not)

But I also want an entire Class of AIs being able to walk through two locked doors ir they want to, and I hesitate to give each of them a key. I doubt that you can link one key to all of them ("singleton link expected", it said once), so that's one more object for each of them. Nasty. And maybe it screws the pickpocket count up even more.

I haven't looked into this much more into this, since I still need to make up my mind if I want to convert an obvious bug into a feature or not... or maybe it isn't a bug since it doesn't make the monolog scream in agony or crash the game.

6th Aug 2002, 22:39
I just had a look at the servant in Burgomaster.
Lytha, I think you are on the right track.
The servant has several keys, one on the belt and one as general containment, and has several object watches.

6th Aug 2002, 22:52
Hmph, I hate the solution with all the extra keys.

But I guess the guards won't even think about walking through the doors when they don't have the key, so the AIWatchObjs won't do any good.

They would just stand there behind the door and shake their fists and say the "just you wait til my friends arrive" instead of approaching the door and frobbing the lock.

Maybe if one of them has the key? Run, open - other AI follows. Possibly.

I noticed in Baffords that both would run into the throne room when one of them had a key (or didn't they?)

But since it's dromed, and so nothing works as we hope it should, he would probably lock the door immediately when he is through, and then it's back to the "think you're so smart" again for the others. :/


AIWatchObj, MinAlert 2 ?! Hmmm... & TrollPT nearby, or so? Uhm. Then they don't open the door automatically when approaching it (that would be bad just like them not being able to walk through the door)

Maybe I inherit this key to that AI class or so (if that is possible). Still, annoying.

13th Aug 2002, 15:24
In Thief:TDP and ThiefGold, you can only pick open a lock once. If it is locked again after picking, you are out of luck. This is why after picking open a door and an AI re-locks the door, you cannot re-pick the door. I think this was fixed in Thief2.

You could use Stims&Receptrons to determine when a lock is picked (as opposed to unlocked with a key). When the lock is picked open, a trigger could delete all keys that can operate that lock. Thus, avoiding the problem of re-locking the lock with a key and being unable to pick it open. I haven't used S&R much, so I am unsure how to go about it.

When Garrett frobs a key off the belt of an AI, that can trigger a signal to delete the generic "contains" key of the AI and alter the AI's patrol route by changing the AICurrentPatrol link to another TrolPt that is part of a different patrol path.

In general, to avoid problems with re-locking doors, I make keys either non-droppable or delete the keys after they're used once.

Just some ideas to think about.
2 cents worth. Your mileage may vary.

13th Aug 2002, 16:47
Originally posted by xarax
When Garrett frobs a key off the belt of an AI, that can trigger a signal to delete the generic "contains" key of the AI and alter the AI's patrol route by changing the AICurrentPatrol link to another TrolPt that is part of a different patrol path.

That matches my observation when I stole the key from the belt of my guard and he decided that he could not continue his patrol now anymore.

Well. It's two kind of keys, and the first is a serious problem (if the guard stands just there and watches my room, gameplay is pretty much over. The other are a cosmetical problem - it is stupid when the guards are not able to leave their mansion after I stole their keys and locked the doors. It feels wrong. But that happens anyway only in the very end.. hm.

I'll work with the extra keys & generic data of the contains-link, I guess. And sure, there needs to be a key for each of them, or the "singleton link expected" appears as error message.

13th Aug 2002, 22:59
simple solution: give them a set of lock picks :D j/k

hey wonder what would happen if you did give them a set of lockpicks? something to try when im bored :D

14th Aug 2002, 14:32
At least in modern times, it is not possible to get locked inside a building due to building codes, regulations, etc., for safety reasons.

AI should always be able to leave a building. So, doors should be openable from the inside. However, before an AI will approach a door, it already knows whether it can open the door. (You couldn't use a BoundsTrigger to unlock the door, because the AI won't approach the locked door, except in unusual circumstances.)

That's why designing a mission where the player can lock doors to stop AI is always problematic game play. You may want to consider alternative routes (stairs, basement, backdoor to the alley, etc.) that the AI will consider when attempting to pursue the player that has locked the door.


14th Aug 2002, 15:43
Thank you xarax :)

But these alternate routes are impossible in this case. It is imperative that there is no other way than the locked door, or I will have the player in areas before he is supposed to be there. I try to be as nice to the player as possible and try not limit his possibilities to walk around, whenever I can - but this door must be the only route.

Hm... what does the AI say to frobinert, unlocked doors that they can open with a switch from the inside? That might be a nice solution, although... hm...

15th Aug 2002, 14:03
The "Assassins" mission in Thief1 has an alert response on some of the Ramirez guards to go to the nearest alarm button and frob it. You could do something similar to have the AI go to the nearest lever and frob it to open the door.

Note that AI can open an unlocked door even when it is frobinert. That's why the door must be locked to prevent AI from operating it. You can still open a locked door by sending a ControlDevice TurnON signal to the door, which won't change the locked status of the door.

16th Aug 2002, 20:21
I just realized that this "AI runs out of this house to investigate" opens all the way up for a break of my "bottle-neck". The player might noise around there (bang the head against the door), until the AI comes out, and then, ala Courier, he holds the door open and is scared because there is stuff he is not supposed to know about. I don't want the player in there before he runs into the bottle-neck.

So... I guess this solves the problem... heh. :)