UseRabbitHoleTask ​
Inherits: BehaviorTask < Resource
Use rabbit hole for teleportation Enhanced with proper signal-based movement handling
Properties ​
int | rabbit_hole_id | 0 |
bool | local_teleport_only | true |
bool | move_to_rabbit_hole | true |
float | interaction_distance | 2.0 |
float | teleport_timeout | 10.0 |
bool | fail_on_cross_map_for_non_player | true |
Variables ​
InteractableObject | target_rabbit_hole | null |
Timer | teleport_timer | null |
bool | teleportation_started | false |
bool | teleportation_completed | false |
Vector3 | rabbit_hole_position | Vector3.ZERO |
float | interaction_range | 2.0 |
bool | movement_completed | false |
bool | rabbit_hole_interaction_completed | false |
Methods ​
void | execute_task_start() |
void | execute_task_complete() |
void | execute_task_interrupt() |
void | execute_task_fail() |
InteractableObject | get_target_rabbit_hole() |
bool | is_teleportation_in_progress() |
bool | is_rabbit_hole_accessible() |
float | get_distance_to_rabbit_hole() |
bool | is_in_rabbit_hole_interaction_range() |
void | set_rabbit_hole_id( new_id: int ) |
void | set_local_teleport_only( local_only: bool ) |
void | set_interaction_distance( distance: float ) |
void | cleanup_timers() |
Property descriptions ​
Target
int rabbit_hole_id = 0 ​
The unique ID of the rabbit hole to use
bool local_teleport_only = true ​
Whether to only allow local teleportation (NPCs should set this true)
bool move_to_rabbit_hole = true ​
Whether to move to rabbit hole before using
float interaction_distance = 2.0 ​
Interaction distance from rabbit hole
Behavior
float teleport_timeout = 10.0 ​
Maximum time to wait for teleportation to complete
bool fail_on_cross_map_for_non_player = true ​
Whether to fail if rabbit hole leads to different map and entity is not player
Variable descriptions ​
InteractableObject target_rabbit_hole = null ​
The rabbit hole the entity uses.
Timer teleport_timer = null ​
The timer of the travel.
bool teleportation_started = false ​
True once the travel has started.
bool teleportation_completed = false ​
True once the travel is done.
Vector3 rabbit_hole_position = Vector3.ZERO ​
The position of the rabbit hole.
float interaction_range = 2.0 ​
How close the entity must be to use the rabbit hole.
bool movement_completed = false ​
True once the entity arrived.
bool rabbit_hole_interaction_completed = false ​
True once the rabbit hole was used.
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.
InteractableObject get_target_rabbit_hole() ​
The rabbit hole the entity uses.
bool is_teleportation_in_progress() ​
Is the entity travelling now?
bool is_rabbit_hole_accessible() ​
Can the rabbit hole be used now?
float get_distance_to_rabbit_hole() ​
The distance to the rabbit hole (-1 when there is none).
bool is_in_rabbit_hole_interaction_range() ​
Is the entity close enough to use the rabbit hole?
void set_rabbit_hole_id( new_id: int ) ​
Set the target rabbit hole ID dynamically
void set_local_teleport_only( local_only: bool ) ​
Set local teleport only flag dynamically
void set_interaction_distance( distance: float ) ​
Set interaction distance dynamically
void cleanup_timers() ​
Frees the timers of the task.