Disabling multiple NPCs

Post » Tue Jun 08, 2010 6:25 pm

I'm trying to disable everyone in the Citadel.
Now, so far I got a script which individually disables all the residents, but the list is long, confusing and there are some NPCs I've missed.

So I thought about a single script which would eliminate them all.
Now, they all have in common that they belong to the list NPCCitadelResidentList. They all also belong to the faction CitadelResidentFaction.
Would I have the chance of making a script which disables everyone belonging to that list/faction?

I don't want to use an enable marker since it would make my mod incompatible with so, so many mods.
User avatar
Rude Gurl
 
Posts: 3425
Joined: Wed Aug 08, 2007 9:17 am

Post » Tue Jun 08, 2010 6:47 pm

You could do it with the http://fose.silverlock.org/fose_command_doc.html commands GetFirstRef & GetNextRef along with a label and an http://geck.gamesas.com/index.php/IsInList command.

EDIT:Or you could use http://geck.gamesas.com/index.php/GetInFaction with the above.
User avatar
Laura Hicks
 
Posts: 3395
Joined: Wed Jun 06, 2007 9:21 am

Post » Tue Jun 08, 2010 12:08 pm

All right.
Now... How would the script be made? :P

I've never used FOSE in my modding yet so I'm noob on that front.
User avatar
Harry-James Payne
 
Posts: 3464
Joined: Wed May 09, 2007 6:58 am

Post » Tue Jun 08, 2010 10:24 am

Use this code to step through all the actors in a cell, just declare the rCurRef variable.

		set rCurRef to GetFirstRef 200 0 0	;All actors		Label 10		if rCurRef			if (rCurRef.IsInList NPCCitadelResidentList)				rCurRef.disable				Goto 10			else				set rCurRef to GetNextRef				Goto 10			Endif		Endif

User avatar
Far'ed K.G.h.m
 
Posts: 3464
Joined: Sat Jul 14, 2007 11:03 pm

Post » Tue Jun 08, 2010 5:11 pm

Got it. Thanks.
User avatar
MR.BIGG
 
Posts: 3373
Joined: Sat Sep 08, 2007 7:51 am

Post » Tue Jun 08, 2010 11:10 am

Bethesda had to selectively enable and disable enemy Enclave soldier NPCs for the walk with Liberty Prime. If I remember correctly, they both used enable parenting, and, they would run a disable on the named REFs. Just so you know, in case complications come in the future, maybe it will mean something.

That or maybe I'm remembering wrong =p
User avatar
George PUluse
 
Posts: 3486
Joined: Fri Sep 28, 2007 11:20 pm

Post » Tue Jun 08, 2010 12:40 pm

Changing the "GetFirstRef 200 0 0" to "GetFirstRef 42 0 0" might be slightly more effecient as that will only look for NPCs as opposed to all actors (which includes creatures).
User avatar
Rachel Tyson
 
Posts: 3434
Joined: Sat Oct 07, 2006 4:42 pm


Return to Fallout 3