Random But Persistent Objects
From The Elder Scrolls Construction Set Wiki
You can also use these strategies for other types of items, not just for clothing.
To give non-persistent random clothing:
You can put clothing in a leveled list, and then add that leveled list to an NPC's inventory in the editor. Everytime that NPC refreshes his inventory (if you haven't visited him for a few days), he will have new clothes from the list. This is usually what you want to do because it gives an NPC the appearance of changing clothes every once in a while.
To give static but persistent clothing:
Simply add the base clothing object to the NPC's inventory in the editor.
To give random but persistent clothing:
You can write a script which, based on a random percent, assigns a particular base clothing object to the NPC. See the example script below for inspiration which is attached to the NPC.
short doOnceGetClothes
short pantsPercent
short shirtPercent
short shoesPercent
Begin GameMode
if doOnceGetClothes == 0
set pantsPercent to getRandomPercent
set shirtPercent to getRandomPercent
set shoesPercent to getRandomPercent
if pantsPercent < 25
addItem LowerPants04 1
equipItem LowerPants04
elseif pantsPercent < 50
addItem LowerPants05 1
equipItem LowerPants05
elseif pantsPercent < 75
addItem LowerPants07 1
equipItem LowerPants07
else
addItem LowerPants08 1
equipItem LowerPants08
endif
;and so on for shirt and shoes
set doOnceGetClothes to 1
endif
End GameMode

