Can npcs close doors?

Post » Tue May 17, 2011 5:14 am

Hello! this seems like a simple issue. basically, I have a patrolling npc who's walking through a hall with a bunch of animated doors. the npc opens all the doors as he's walking along the xmarkers. the npc doesnt close any of the doors, though! I'm wondering if there's any way at all to make the npc open a door, walk through it, then turn around and close it? has anyone done this? or is it done in fallout somewhere, where I could just track down fallout's script? if anyone's able to help, I really appreciate it. :D
User avatar
Angela
 
Posts: 3492
Joined: Mon Mar 05, 2007 8:33 am

Post » Tue May 17, 2011 9:06 am

Hello! this seems like a simple issue. basically, I have a patrolling npc who's walking through a hall with a bunch of animated doors. the npc opens all the doors as he's walking along the xmarkers. the npc doesnt close any of the doors, though! I'm wondering if there's any way at all to make the npc open a door, walk through it, then turn around and close it? has anyone done this? or is it done in fallout somewhere, where I could just track down fallout's script? if anyone's able to help, I really appreciate it. :D



I've seen NPC's close doors and, lock me into rooms in Canturbery Commons interiors. I have know idea how he pulled it off, I didn't look at his AI packages but, I think it is possible.

Heres a link to his nexus thread.

http://www.fallout3nexus.com/downloads/file.php?id=11046
User avatar
Calum Campbell
 
Posts: 3574
Joined: Tue Jul 10, 2007 7:55 am

Post » Tue May 17, 2011 2:23 am

To make an NPC close a door is a bit tricky as it is not native to the game. You would have to script his movements with AI packages and forcing the animation yourself. This can get cumbersome if you have a lot of random NPCs closing a lot of random doors at random times.


If you want, you can place this script on your door and they will automatically close and lock (if originally set to be locked) 10 seconds after they are opened.


ScriptName UCDoorScriptFloat TimerBegin OnLoad						; if the player left the door open the last time he was in here, close it.	If GetOpenState == 1		SetOpenState 0		If GetLockLevel > 0			Lock		EndIf	EndIfEndBegin OnActivate							Set Timer to 10				ActivateEndBegin GameMode		If Timer > 0		Set Timer to Timer - GetSecondsPassed	ElseIf GetOpenState == 1		SetOpenState 0		Set Timer to 0		If GetLockLevel > 0			Lock		EndIf	EndIf	If GetOpenState == 3		Set Timer to 0	EndIfEnd

User avatar
x a million...
 
Posts: 3464
Joined: Tue Jun 13, 2006 2:59 pm

Post » Tue May 17, 2011 7:29 am

almost every npc in rivet city close their doors . but there is no animation in doing it. The doors just close by themselves.
User avatar
Blackdrak
 
Posts: 3451
Joined: Thu May 17, 2007 11:40 pm


Return to Fallout 3