This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.

Random But Persistent Objects

From the Oblivion ConstructionSet Wiki
Revision as of 23:47, 31 May 2008 by imported>Wrye (Random But Persistant Objects moved to Random But Persistent Objects: Spelling.)
Jump to navigation Jump to search

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