×
Меню
Индекс

MSFD Force-equipping an Item

Equip, "Object_ID" [count_enum]
 
"Actor_ID"->Equip, "iron dagger"
 
(Also see OnPCEquip function below)
 
Pre-Tribunal: Partly Broken. This could have been an immensely useful function. Unfortunately, most of the potential uses do not work: You can NOT autoequip anything on the Player. You can NOT force the Actors to equip weapons or armor with this (this is completely governed by their skills with armor or weapons). You can NOT make "non-removable" items, like cursed armor, etc. You CAN make Actors swallow potions, or so I heard.
This Function was fixed in Tribunal. You can now force Actors to equip armor, weapons and clothing. So you now CAN do all of the above . Praise to Bethesda.
 
Note:
The Equip function can make someone equip an item they aren't carrying, and it will add it to their inventory. However, if you do that then any scripts on the items won't be run. So you need to use AddItem first, then Equip, even though Equip does seem to add them. The script will start if you take the item off the person or out of your inventory and drop. But while it is in inventories the script doesn't start (Forum info, ThePal).
 
In addition, it appears that Equip will only work on the player after at least one AddItem has been used. -(DinkumThinkum)
 
The count is optional; if it's omitted then one item will be equipped. You can't use this to force equip more than one item if it's not possible to have more than one equipped at a time (e.g. a cuirass) - it doesn't cause problems but it will still equip only one.
 
On using equip with variables: it didn't throw any errors, but I got some strange results. It certainly didn't reliably equip the given number.
 
Note:
If you equip a potion on a NPC, the NPC will not drink it. You could get around this by making a spell with the same effects as the potion, then removing the potion and adding the spell.
 
Sample Script: This script (Tribunal required) curses an item (a Chitin Club) so that it can't be unequipped anymore. Not even using quick-keys. Bugger! Now you have to fight with a chitin club to the end of your days, which will probably come soon  The player can still use magic however.
Begin cursed_item
 
short state
short OnPCEquip
 
 
if ( OnPCEquip == 0 ) ; item is not equipped
     if ( state == 0 ); if club has never been equipped, don't do anything yet.
          return
     else
          Player->Equip, "cursed_club" ; reequip the item!
          MessageBox "The item is cursed, it doesn't leave your hand" ;taunt the player
     endif
else
     if ( state == 0 ) ;first time equipped. The trap snaps shut
          set state to 1
     endif
endif
 
End