Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
If my PCs are trapped in a locked prison cell, is there any way I can make an NPC walk into that prison cell by opening the locked door and walking through it?

- I tried giving the NPC the key for the door.
- I tried scripting ItemUnLock(ITEM_Cell1); before the NPC walks in
- I tried putting ItemOpen(ITEM_Cell1); if the NPC enters a trigger that is outside the door.

All these attempts resulted in the NPC simply teleporting into the prison cell. The NPC only walks into the cell if I keep the prison door unlocked.

Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
Have you tried separating the action into 1. Walk up to door, 2. Open door, and 3. Walk to destination rather than just having one single action of walking to the destination?

Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
I didn't think to do that, being a minimalist scripter, but it worked! The only issue I have now is getting the door to relock after the NPC goes through. I tried ItemLock(ITEM_Cell2); but that didn't seem to do anything. The prompt says call ItemLock((ITEM)_Item,(STRING)_Key). Any idea what info belongs in the string_key spot? I tried typing the corresponding keys name but that generated an error.

Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
Bump. Anyone know how to relock doors? ItemLock(ITEM_Cell2) didn't seem to do anything. The prompt says call ItemLock((ITEM)_Item,(STRING)_Key).

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
Originally Posted by JecklynHyde
Bump. Anyone know how to relock doors? ItemLock(ITEM_Cell2) didn't seem to do anything. The prompt says call ItemLock((ITEM)_Item,(STRING)_Key).


You said it calls for a string, but you didn't include the string? You should have your keyname in the ItemLock call. Strings always go inside quotes. "KeyName".

Last edited by Burgee; 02/01/15 01:09 AM.
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
Thanks again, I misunderstood how the string thing worked. I had also tried ItemLock(ITEM_Cell2, Key_CellKey2) but that didn't work and I got confused.



Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5