Skip to content

Class: patrol ​

Patrol path parameters used by movement actions.

Source ​

src/xrAICore/Navigation/PatrolPath/patrol_path_params_script.cpp, CPatrolPathParams binding.

Custom Constructor ​

patrol

Remarks ​

The Lua-visible patrol class stores a patrol path name, start mode, route mode, randomization flag, and optional custom point index. Movement action constructors copy those values into the native movement action.

Extends ​

Constructors ​

Constructor ​

ts
new patrol(
   name?: string, 
   startType?: TXR_patrol_start_type, 
   routeType?: TXR_patrol_route_type, 
   random?: boolean, 
   customPointIndex?: number): patrol;

Create patrol path parameters.

Parameters ​

ParameterTypeDescription
name?stringPatrol path name.
startType?TXR_patrol_start_typePatrol start mode.
routeType?TXR_patrol_route_typePatrol route mode.
random?booleanWhether random point selection is enabled.
customPointIndex?numberCustom start point index.

Returns ​

patrol

Remarks ​

The native constructor resolves name through patrol path storage. Missing patrol paths can assert in debug builds. Use patrol.custom with customPointIndex to start from an explicit patrol point.

Overrides ​

EngineBinding.constructor

Methods ​

count() ​

ts
count(): number;

Returns ​

number

Number of points in the patrol path.


flag() ​

Call Signature ​

ts
flag(value1: number, value2: number): boolean;

Check a patrol point flag by numeric index.

Parameters ​
ParameterTypeDescription
value1numberPatrol point index.
value2numberFlag index.
Returns ​

boolean

Whether the flag is set.

Call Signature ​

ts
flag(value1: number, value2: string): boolean;

Check a patrol point flag by name.

Parameters ​
ParameterTypeDescription
value1numberPatrol point index.
value2stringFlag name.
Returns ​

boolean

Whether the flag is set.


flags() ​

ts
flags(point_index: number): flags32;

Get all flags for a patrol point.

Parameters ​

ParameterTypeDescription
point_indexnumberPatrol point index.

Returns ​

flags32

Point flags.


game_vertex_id() ​

ts
game_vertex_id(value: number): number;

Get game graph vertex id for a patrol point.

Parameters ​

ParameterTypeDescription
valuenumberPatrol point index.

Returns ​

number

Game graph vertex id.


get_nearest() ​

ts
get_nearest(vector: vector): number;

Find nearest patrol point to a position.

Parameters ​

ParameterTypeDescription
vectorvectorPosition to test.

Returns ​

number

Patrol point index.


index() ​

ts
index(value: string): number;

Find patrol point index by name.

Parameters ​

ParameterTypeDescription
valuestringPatrol point name.

Returns ​

number

Patrol point index.


level_vertex_id() ​

ts
level_vertex_id(value: number): number;

Get level vertex id for a patrol point.

Parameters ​

ParameterTypeDescription
valuenumberPatrol point index.

Returns ​

number

Level vertex id.


name() ​

ts
name(point_index: number): string;

Get patrol point name.

Parameters ​

ParameterTypeDescription
point_indexnumberPatrol point index.

Returns ​

string

Point name.


point() ​

ts
point(index: number): vector;

Get patrol point position.

Parameters ​

ParameterTypeDescription
indexnumberPatrol point index.

Returns ​

vector

Point position.


terminal() ​

ts
terminal(point_index: number): boolean;

Check whether a patrol point is terminal.

Parameters ​

ParameterTypeDescription
point_indexnumberPatrol point index.

Returns ​

boolean

Whether the point ends the route.

Properties ​

__name ​

ts
readonly __name: string;

LuaBind instance constructor name.

Inherited from ​

EngineBinding.__name


__name ​

ts
readonly static __name: string;

LuaBind class constructor name.

Inherited from ​

EngineBinding.__name


continue ​

ts
readonly static continue: 1;

Engine enum value for patrol.continue.


custom ​

ts
readonly static custom: 3;

Engine enum value for patrol.custom.


dummy ​

ts
readonly static dummy: -1;

Engine enum value for patrol.dummy.


nearest ​

ts
readonly static nearest: 2;

Engine enum value for patrol.nearest.


next ​

ts
readonly static next: 4;

Engine enum value for patrol.next.


start ​

ts
readonly static start: 0;

Engine enum value for patrol.start.


stop ​

ts
readonly static stop: 0;

Engine enum value for patrol.stop.

Source ​

src/xrAICore/Navigation/PatrolPath/patrol_path_params_script.cpp, route stop enum.