EquipItemTask ​
Inherits: BehaviorTask < Resource
Equip or unequip equipment items from the entity's inventory
Properties ​
int | item_id | 0 |
EquipType | equip_option | EquipType.EQUIP |
bool | fail_if_item_not_found | true |
bool | fail_on_action_error | true |
Variables ​
ItemDefinitionEquipment | target_item | null |
bool | action_completed | false |
Methods ​
void | execute_task_start() |
void | execute_task_complete() |
void | execute_task_interrupt() |
void | execute_task_fail() |
void | set_item_id( new_item_id: int ) |
void | set_equip_action( action: EquipType ) |
bool | is_item_equipped( check_item_id: int ) |
bool | is_item_in_inventory( check_item_id: int ) |
bool | was_action_completed() |
Enumerations ​
enum EquipType ​
The options of equip type: equip, unequip.
- EQUIP =
0 - UNEQUIP =
1
Property descriptions ​
Target
int item_id = 0 ​
The item ID to equip/unequip
EquipType equip_option = EquipType.EQUIP ​
What action to perform with the item
Behavior
bool fail_if_item_not_found = true ​
Whether to fail if the item is not found in inventory (for equip) or not equipped (for unequip)
bool fail_on_action_error = true ​
Whether to fail if the action cannot be completed
Variable descriptions ​
ItemDefinitionEquipment target_item = null ​
The item the entity equips or takes off.
bool action_completed = false ​
True once the item is equipped or taken off.
Method descriptions ​
void execute_task_start() ​
Execute the task - equip or unequip the specified item
void execute_task_complete() ​
Task completed successfully
void execute_task_interrupt() ​
Nothing to interrupt for equipment actions
void execute_task_fail() ​
Nothing to clean up for equipment actions
void set_item_id( new_item_id: int ) ​
Set the item ID to equip/unequip dynamically
void set_equip_action( action: EquipType ) ​
Set the equip action dynamically
bool is_item_equipped( check_item_id: int ) ​
Check if the specified item is currently equipped
bool is_item_in_inventory( check_item_id: int ) ​
Check if the specified item is in inventory
bool was_action_completed() ​
Get whether the last action was completed successfully