Difference between revisions of "Force an actor to equip new stuff"
Jump to navigation
Jump to search
imported>SnakeChomp (Create) |
imported>Omzy |
||
Line 7: | Line 7: | ||
This will cause the actor to re-evaluate what items it should equip based on what is left in the actor's inventory. Use this trick after adding armor to an actor from a leveled list to make the actor equip it. | This will cause the actor to re-evaluate what items it should equip based on what is left in the actor's inventory. Use this trick after adding armor to an actor from a leveled list to make the actor equip it. | ||
[[Category: | [[Category:Advanced_Modding_Techniques]] |
Latest revision as of 03:33, 10 August 2010
If you add armor to an actor via a script, the actor will not automatically equip that armor. If you add a specific armor by name, it is easy to call EquipItem to make the actor equip that specific piece of armor. But what if you added a random piece of armor from a leveled list? In this case, here is what you can do to force the actor to decide what armor (and weapons) it should be wearing:
actor.AddItem ArmorLeather 1 ;Add a known armor to the actor actor.EquipItem ArmorLeather ;Equip the armor we added actor.RemoveItem ArmorLeather 1 ;Remove the armor we added
This will cause the actor to re-evaluate what items it should equip based on what is left in the actor's inventory. Use this trick after adding armor to an actor from a leveled list to make the actor equip it.