TheNonsenseFactory Posted February 28, 2015 Share Posted February 28, 2015 Hi all, I know there is a script extender function to go from a reference to the base object, but how do I go the other way? I have a Form reference, and I want to find out how many instances of that form are in the game, so I can determine if it is a unique NPC. If it is a NPC and there is only one in the game then I want to perform some reference functions on it, so I need it as a reference, not Form. Grateful for any assistance! Link to comment Share on other sites More sharing options...
Hemingway308 Posted February 28, 2015 Share Posted February 28, 2015 So, essentially you want a function to return the 'Count' in GECK. I do not think there is one. Also, some unique NPCs are not unique (There are 3 Bennies and 2 Fantastics) and some generic named ones are. You could: 1) Create a form list "Unique NPCs" or "Non-Unique NPCS" and check actors against it. Simple, but problematic for mod-added NPCs. 2) Create an array with the names of all generic actors ("Wastelander", "Fiend", "NCR Trooper", etc), if the name of an NPC is not in it, assume they are unique. Make sure you get the names from NPCs in game rather than typing them in, if you want compatability with other language games. let Generic_Names := Ar_List $1EFiendMeleeAAM, $1ERefugeeAAF...if eval (Ar_Find $SomeActor, Generic_Names) == -1 ; SomeActor is unique, they do not have a generic name -- There could be an easier solution, what purpose do you have? Link to comment Share on other sites More sharing options...
TheNonsenseFactory Posted March 1, 2015 Author Share Posted March 1, 2015 My purpose is to find out if an interior cell can be considered "abandoned" or not. I know I could hand-code it for each cell, or make a list of each unique NPC, but I was hoping there was a nice dynamic script solution like so:Check what cell the player is in Get owner of that cell If owner is unique, is not the player and is dead then cell is abandoned.I can do 1 and 2, but since the result from 2 is a Form then I can't do 3. The end goal is my own curiosity and helping out GodOfWolves with his Massive Object Ownership Revamp mod (if he hasn't figured it out himself already). Link to comment Share on other sites More sharing options...
Recommended Posts