Class: CALifeMonsterPatrolPathManager
ALife monster patrol-path manager binding.
Source
C++ class CALifeMonsterPatrolPathManager
Custom Constructor
CALifeMonsterPatrolPathManager
Remarks
Patrol target getters require a patrol path and a selected current patrol vertex.
Constructors
Constructor
new CALifeMonsterPatrolPathManager(): CALifeMonsterPatrolPathManager;Returns
CALifeMonsterPatrolPathManager
Methods
actual()
actual(): boolean;Check whether the patrol target is still actual.
Returns
boolean
Whether the patrol path is actual.
completed()
completed(): boolean;Check whether patrol movement reached the target.
Returns
boolean
Whether patrol movement is complete.
path()
path(path_name: string): void;Set the patrol path by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
path_name | string | Patrol path name. |
Returns
void
Throws
If path_name is not a registered patrol path.
route_type()
Call Signature
route_type(type: TXR_patrol_route_type): void;Set patrol route behavior.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_patrol_route_type | Patrol route type. |
Returns
void
Call Signature
route_type(): TXR_patrol_route_type;Get patrol route behavior.
Returns
Patrol route type.
start_type()
Call Signature
start_type(type: TXR_patrol_start_type): void;Set how the patrol path starts.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_patrol_start_type | Patrol start type. |
Returns
void
Call Signature
start_type(): TXR_patrol_start_type;Get how the patrol path starts.
Returns
Patrol start type.
start_vertex_index()
start_vertex_index(index: number): void;Set the starting patrol point.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | Patrol point index. |
Returns
void
Remarks
Used when start type is the explicit point mode. The index must exist in the current patrol path.
target_game_vertex_id()
target_game_vertex_id(): number;Get the current patrol target game vertex.
Returns
number
Target game graph vertex id.
Throws
If no patrol path is assigned or the current vertex is not selected.
target_level_vertex_id()
target_level_vertex_id(): number;Get the current patrol target level vertex.
Returns
number
Target level vertex id.
Throws
If no patrol path is assigned or the current vertex is not selected.
target_position()
target_position(): vector;Get the current patrol target position.
Returns
Target position.
Throws
If no patrol path is assigned or the current vertex is not selected.
use_randomness()
Call Signature
use_randomness(enabled: boolean): void;Enable or disable random patrol point selection.
Parameters
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | New randomness state. |
Returns
void
Call Signature
use_randomness(): boolean;Check whether random patrol point selection is enabled.
Returns
boolean
Whether randomness is enabled.