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

New method for random but persistent items with leveled lists directly added to NPC's inventory
imported>Qazaaq
(End GameMode...? even if that works, let's not give the confusing examples)
imported>StayLight
(New method for random but persistent items with leveled lists directly added to NPC's inventory)
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 40: Line 42:
         ;and so on for shirt and shoes
         ;and so on for shirt and shoes
set doOnceGetClothes to 1
    endif
End
</pre>
<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
set doOnceGetClothes to 1
     endif
     endif
Anonymous user