Jump to content

[solved][Creationkit] Howto make NPC's to close the door behind them?


worik

Recommended Posts

Posted

One thing that annoys me is that NPC never close doors behind them.

I'm not talking about "locking" them. That's not what I want.

My point is just a simple  "SHUT THAT DAMN DOOR BEHIND YOU! YOU IDIOTIC NPC!".

 

It seems to be a general deficit in Skyrim's NPC AI but it ruins the immersive feeling for my mod.

So far, I couldn't come up myself with an idea how to add that behaviour to my own AI packages. That would have fixed it at leat for my own NPCs.

 

Another idea could be to add a "close-me" script to my doors, but that's plan B.

 

 

Does anybody know of a mod where that was solved?

Or if anybody has an idea for either the NPCs or my plan B "close door" script?

I'd be happy about any comment :classic_happy:

Posted
5 minutes ago, worik said:

One thing that annoys me is that NPC never close doors behind them.

I'm not talking about "locking" them. That's not what I want.

My point is just a simple  "SHUT THAT DAMN DOOR BEHIND YOU! YOU IDIOTIC NPC!".

 

It seems to be a general deficit in Skyrim's NPC AI but it ruins the immersive feeling for my mod.

So far, I couldn't come up myself with an idea how to add that behaviour to my own AI packages. That would have fixed it at leat for my own NPCs.

 

Another idea could be to add a "close-me" script to my doors, but that's plan B.

 

 

Does anybody know of a mod where that was solved?

Or if anybody has an idea for either the NPCs or my plan B "close door" script?

I'd be happy about any comment :classic_happy:

Best I've done is just make doors close on their own after a few seconds of nobody being near them.  Problem with AI closing them is that the logic for detecting if they should or not is way too complex.

Posted
2 hours ago, Seijin8 said:

Best I've done is just make doors close on their own after a few seconds of nobody being near them.

?  Ok, that sounds like plan B is the way to go.

How did you do that? Attaching a script to each door was my first idea?

Posted
35 minutes ago, worik said:

?  Ok, that sounds like plan B is the way to go.

How did you do that? Attaching a script to each door was my first idea?

Yes, you can do that.  I mainly did it for doors in/around my player home since there aren't many other places where it needs to be done.  Inns maybe would be another place to do it.

 

A sample of this script is used in Immersive College of Winterhold.  The script is called something like CWDoorDraught.  Pretty basic and works well.

 

If you wanted, you could create a spell that lets you add the effect to any door you targeted, or even go so far as to create a quest that adds it to every door you come across, which would probably be stupid (it might not distinguish doors that shouldn't be opened/closed that way and may silently break something in the background), but is technically possible.

Posted
4 hours ago, Seijin8 said:

A sample of this script is used in Immersive College of Winterhold.  The script is called something like CWDoorDraught.  Pretty basic and works well.

Thank you :classic_smile: I'll have a look.

 

4 hours ago, Seijin8 said:

to any door

No need for that. It mostly annoys me in my own mod. I have a bunch of doors where anyone would close them after stepping through. It's totally absurd to have literally every door open after an hour of AI movements.

Spoiler

WMAE_BI.cellar.9.jpg.30fe9c890b43e3c2b4733259198515ec.jpg

 

Posted
6 hours ago, Seijin8 said:

Pretty basic and works well.

? It's perfect!

I'm using an even further simplified script which is exactly what I had in mind.

Scriptname my_AutoCloseDoorScript extends ObjectReference  
{Automatically closes doors. Inspired by an example in "Immersive College of Winterhold".}

Event OnActivate(ObjectReference akActionRef)
	If  Self.GetOpenState() < 3
		Utility.Wait(8)
		While Game.GetPlayer().GetDistance(Self) < 250
			Utility.Wait(1)
		EndWhile
		Self.SetOpen(false)
	EndIf
EndEvent

I just add it as a script to the door in question or create a new door base object with the script already in place.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...