Innkeepers and locked doors

Post » Wed Jan 23, 2013 3:32 am

I have an inn setup in the normal fashion: the innkeeper goes through the normal dialogue, leads you to the room, the bed is un-owned for 24 hours, etc. The only thing I want to add to this is a door that locks automatically after the time is up and the player leaves the cell (to make sure they don't get stuck in there). In other words, I want the inns to work like they did in Oblivion: you've got the room for 24 hours, and once you leave the cell the door is locked until you pay again.

How would I go about this? I'm completely lost.
User avatar
Heather Dawson
 
Posts: 3348
Joined: Sun Oct 15, 2006 4:14 pm

Post » Tue Jan 22, 2013 4:51 pm

I only have a second so you'll have to forgive me for the lack of detail;

But you could use triggers to track whether or not the player is in the room, (OnTriggerEnter - They are inside the room, OnTriggerLeave - They have left the room) then once the 24 hours is up, have a script check every few seconds if the player is in the room or not, and once they are not the door is locked.

Alternatively you could use http://www.creationkit.com/GetParentCell_-_ObjectReference to check if the player is in the cell, then lock the door if they are not.
User avatar
phillip crookes
 
Posts: 3420
Joined: Wed Jun 27, 2007 1:39 pm

Post » Tue Jan 22, 2013 2:20 pm

It would be nice if someone could add that functionality to all inns - it sounds like you're building an inn of your own.

I find it intensely aggravating to spend hard-earned gold on a luxury such as a night at the inn, then go to settle down and find half the common room patrons and some of the staff hanging out in my room. It's very creepy, especially since my char strips off her armor to sleep.
User avatar
Neliel Kudoh
 
Posts: 3348
Joined: Thu Oct 26, 2006 2:39 am


Return to V - Skyrim