» Wed Dec 07, 2011 4:11 pm
Decrepit, thank you for mentioning Active Inventory Spell. Opening it in the construction set shows me that the spell does the following:
1. Spell hits actor, which references the npc and enables a persistent box. xAccess short variable is set to 1.
2. All items are moved from the npc to the box and the box then activates the player, opening a menu. xAccess set to 2.
3. The player does what they want to and then closes the menu
4. After the menu is closed then the box moves what is inside it back to the npc, and the box is disabled. xAccess set to 3.
5. An unscripted ring is added to the npc, equipped, and removed ( I don't understand what this step is for, probably for testing and was never removed ). xAccess is set to 4.
6. xAccess is set back to 1 when the spell is used again.
Then I assume the npc will proceed like normal and choose to equip whatever clothing is more expensive, whichever armor is more protective, and the weapon that is deadlier.
I wonder if this mod can be further improved. Since it references the actor it hits then equipitem can be used in the script, if there is a way to get the base object of the item in the box you want them to equip.