CreateItemTask ​
Inherits: BehaviorTask < Resource
Emit signals for item creation instead of directly creating items Allows external systems to handle item creation logic (inventory, drops, rewards, etc.) Focuses on single item creation with configurable quantity
Properties ​
int | item_id | 0 |
int | quantity | 1 |
bool | target_self | true |
bool | validate_item_exists | true |
bool | fail_on_invalid_item | true |
Variables ​
bool | signal_emitted | false |
bool | item_validated | false |
String | validation_error | "" |
Methods ​
void | execute_task_start() |
void | execute_task_complete() |
void | execute_task_interrupt() |
void | execute_task_fail() |
void | set_item( new_item_id: int, new_quantity: int = 1 ) |
bool | is_item_valid() |
String | get_item_name() |
String | get_task_description() |
bool | was_signal_emitted() |
bool | was_item_validated() |
String | get_validation_error() |
Dictionary | get_configuration() |
Property descriptions ​
Item Configuration
int item_id = 0 ​
Item ID to create (0 = no item)
int quantity = 1 ​
Quantity to create (must be positive)
Target
bool target_self = true ​
Whether to target the executing entity (true) or emit signal with null entity (false)
Validation
bool validate_item_exists = true ​
Whether to validate that the item ID exists in the database before emitting signal
bool fail_on_invalid_item = true ​
Whether to fail the task if item validation fails
Variable descriptions ​
bool signal_emitted = false ​
True once the task emitted its signal.
bool item_validated = false ​
True once the item was checked.
String validation_error = "" ​
Why the item did not pass the check.
Method descriptions ​
void execute_task_start() ​
Starts the task.
void execute_task_complete() ​
Called when the task finishes well.
void execute_task_interrupt() ​
Called when something interrupts the task.
void execute_task_fail() ​
Called when the task fails.
void set_item( new_item_id: int, new_quantity: int = 1 ) ​
Set the item and quantity to request
bool is_item_valid() ​
Check if the configured item ID exists in the database
String get_item_name() ​
Get the item name for display purposes
String get_task_description() ​
Get a description of what this task will do
bool was_signal_emitted() ​
Check if signal was emitted in last execution
bool was_item_validated() ​
Check if item was validated in last execution
String get_validation_error() ​
Get validation error from last execution
Dictionary get_configuration() ​
Get the current configuration as a dictionary