Difference between revisions of "How to give an NPC random but persistent clothing"

no edit summary
imported>Qazaaq
(End GameMode...? even if that works, let's not give the confusing examples)
imported>Omzy
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:


<b>To give random but persistent clothing:</b><br/>
<b>To give random but persistent clothing:</b><br/>
<b>Method 1:</b>
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.
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.


Line 45: Line 47:
</pre>
</pre>


[[Category:Solutions]]
<b>Method 2:</b>
You can simply write a script which uses [[AddItem]] with a leveled list as ObjectID. Items added this way are not considered part of the NPC's original inventory and will not get refreshed. A downside of this method is that you cannot force the NPC to equip newly added items as the exact forms being added are undeterminable. Below is an example script which adds a complete set of persistent raider gear to an NPC.
 
<pre>
short doOnceGetClothes
 
Begin GameMode
    if doOnceGetClothes == 0
 
addItem Raider1ArmorComplete 1
addItem Raider1WeaponGun 1
 
set doOnceGetClothes to 1
    endif
End
</pre>
 
 
[[Category:Advanced_Modding_Techniques]]
Anonymous user