Script:equip: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
(Created page with "{{ScriptCommandPage |description=make the player equip or unequip the caller |context=any |special= [-r] player |default=0 |flags= r Unequip the calling entity instead of equipping it |intro=The slot that caller is equipped in depends on the caller's equipment type. {{Command|equip|-r}} sends the {{Event|equipout}} event from the player to the caller and then if the item was actually unequipped sends it from the caller to the player and agai...")
 
mNo edit summary
 
Line 15: Line 15:
This command can only change the player equipment. To have an [[:Category:NPCs|NPC]] equip a weapon use {{Command|setweapon}}.
This command can only change the player equipment. To have an [[:Category:NPCs|NPC]] equip a weapon use {{Command|setweapon}}.
}}
}}
[[Category:Script commands linking entities]]

Latest revision as of 13:03, 19 June 2022

The equip script command is used to make the player equip or unequip the caller for an entity. The slot that caller is equipped in depends on the caller's equipment type.

equip -r sends the equipout event from the player to the caller and then if the item was actually unequipped sends it from the caller to the player and again from the player to the caller. The player will start dragging the unequipped entity if not already dragging anything, even if the mouse is not held down. Otherwise the unequipped item is added to the player inventory. If the item does not fit into the player inventory or cannot be put into inventories then it is dropped in front of the player instead.

equip without -r sends the equipin event from the player to the caller and then unequips any existing equipment in the same slot as if equip -r was called by that entity and equips the new entity. For rings there are two slots and equip will prefer the left slot if empty, otherwise use the right slot if empty if both are full alternates between the two slots.

This command can only change the player equipment. To have an NPC equip a weapon use setweapon.

Usage

equip [-r] player

Context: Any Entity

Flags:

 -r: Unequip the calling entity instead of equipping it