Scripting, Exhibitionism, and You

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

After modifying NPCs inventories with scripts (things like removeitem and so on) it seems that they don't actually equip any of the items added to their inventory until they have entered and left the cell, or the player has, and won't even equip any new armour in combat if all their existing armour was taken. Is there any scripted way of forcing the AI to reevaluate what it has equipped, or do you just have to put up with unseemly displays of pants-showing from otherwise respectable guards?

--Mrflippy 16:15, 14 April 2006 (EDT): I am looking for an answer to this question as well.

--JustTim 10:38, 16 April 2006 (EDT): The only way i found to do this is by using the SetLevel function on the NPC.

Talkie Toaster 12:30, 16 April 2006 (EDT): That wouldn't be too useful though, as it could cause problems with level offset NPCs, and the GetLevel article isn't clear about if it returns a level adjustment, format etc.

--Mrflippy 23:33, 19 April 2006 (EDT): What sort of AI package do I need to add and evaluate? I tried just creating a new one with the default settings, and it didn't work.


SOLUTION


The NPCs will change what they're wearing when (if) they reevaluate their AI package. So adding in an AI package with no limits and reevaluating it soon after seems to do the trick.

Make sure it has no constraints, so for example follow, target: Player, with 0 duration, and no "Must complete" or "Must reach location " flags checked. I used one with deequip armour/deequip weapons checked, but that may not be necessary. Talkie Toaster 04:41, 20 April 2006 (EDT)