Remove all AI packages?

Post » Wed Oct 19, 2011 4:31 am

I'm trying to find a way to arbitrarily remove all AI Packages from any given NPC... using a script. All I can find is the RemoveScriptPackage function... and that only pulls off the currently running package. This would be just fine if every NPC had only a single package... but many of them have more than that.

What I want to do in the game is pick a completely arbitrary NPC. Generic, Unique, Quest, whatever. And I want to use a script (from an item, of course) to remove every script package they have (and then attach some others, depending). The problem is, with any given NPC, I have no idea how to determine (using a script in a running game) how many packages they have. I want to do this without manually deleting anything in the GECK and without having to use Console Commands in the game.

Is there a way (in a script) to either:

1) iterate the script packages on a reference
or
2) remove all script packages in one fell swoop (like how RemoveFromAllFactions works)

I'm cool with using NVSE, but from what I've seen, it doesn't have the functionality I need either.
User avatar
Trent Theriot
 
Posts: 3395
Joined: Sat Oct 13, 2007 3:37 am

Return to Fallout: New Vegas