Skip to content

Equip Hero

Equip Hero

Assigns a piece of equipment from the inventory to a specific equipment slot on a hero.

Properties

System

Name Explanation Type
Equipment The equipment to assign to the hero. Equipment
Equipment Slot The equipment slot on the hero where the equipment will be placed. Equipment Slot
Hero The hero who will receive the equipment. Character
Ignore Constraints When enabled, equipment restrictions such as class or level requirements are bypassed. Toggle
Require Unequipped When enabled, the equipment must not already be equipped by another party member. Toggle
Result The switch to store whether the equip operation succeeded. Switch or Value
Store Results When enabled, the success or failure of the equip operation is stored in a switch. Toggle

Examples

Equip Hero 0 with Equipment 0 in Equipment Slot 0

This assigns equipment at index 0 to the first equipment slot on hero 0.

equip_item(hero(0), equipment(0), equip_slot(0));
{"Data":{"Equipment":{"ReferenceType":0,"Index":0,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"EquipmentSlot":{"ReferenceType":0,"Index":0,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"Hero":{"ReferenceType":0,"Index":0,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"IgnoreConstraints":false,"IsConstrainedToUnequipped":false,"Result":{"IsGlobalSwitch":true,"IsLocalSwitch":false,"IsValue":false,"Value":false,"SwitchIndex":0,"Metadata":null},"StoreResults":false,"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Inventory.EquipItemCommand"}

Equip Hero 1 Ignoring Constraints and Store the Result

This equips hero 1 with equipment 2 in equipment slot 0, bypassing restrictions, and stores whether the operation succeeded in Global Switch 0.

$gs[0] = equip_item(hero(1), equipment(2), equip_slot(0), ignore_constraints);
{"Data":{"Equipment":{"ReferenceType":0,"Index":2,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"2","VariableIndex":0,"Metadata":null},"Metadata":null},"EquipmentSlot":{"ReferenceType":0,"Index":0,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"Hero":{"ReferenceType":0,"Index":1,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"1","VariableIndex":0,"Metadata":null},"Metadata":null},"IgnoreConstraints":true,"IsConstrainedToUnequipped":false,"Result":{"IsGlobalSwitch":true,"IsLocalSwitch":false,"IsValue":false,"Value":false,"SwitchIndex":0,"Metadata":null},"StoreResults":true,"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Inventory.EquipItemCommand"}

Equip Hero 0 Requiring the Equipment to Be Unequipped

This equips hero 0 with equipment 1 in equipment slot 0, but only if the equipment is not already worn by another party member.

equip_item(hero(0), equipment(1), equip_slot(0), require_unequipped);
{"Data":{"Equipment":{"ReferenceType":0,"Index":1,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"1","VariableIndex":0,"Metadata":null},"Metadata":null},"EquipmentSlot":{"ReferenceType":0,"Index":0,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"Hero":{"ReferenceType":0,"Index":0,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"IgnoreConstraints":false,"IsConstrainedToUnequipped":true,"Result":{"IsGlobalSwitch":true,"IsLocalSwitch":false,"IsValue":false,"Value":false,"SwitchIndex":0,"Metadata":null},"StoreResults":false,"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Inventory.EquipItemCommand"}