GwNavBot - stingray.GwNavBot object reference - Stingray Lua API Reference

stingray.GwNavBot object reference

Description

Represents a Navigation bot.

Functions

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

destination :

stingray.Vector3

The desired endpoint of the path.

Returns

boolean

Tells if a new path computation path was successfully added.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

delta_time :

number

The delta time in seconds since the last frame.

velocity :

stingray.Vector3?

Optional velocity to apply, if not provided bot's output velocity is used.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

stingray.Vector3

The position on the NavMesh.

In the event that no position can be found, the input position is returned.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

distance :

number

The distance to move on the spline.

Returns

stingray.Vector3?

If the move succeeded, returns the position on the spline. Otherwise returns nil.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

stingray.Vector3?

If the move succeeded, returns the tangent of the position on the spline. Otherwise returns nil.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

astar :

stingray.GwNavAStar

A GwNavAStar to run whose found path will be followed by the bot, hence it should be set to run on the same database than the bot (Already done if init_astar_query is used).

Returns

boolean

Tells if the query was successfully added for computation.

Parameters

database_or_world :

any(stingray.GwNavWorld, stingray.GwNavDatabase)

Specifies the GwNavDatabase the Bot will use to compute new destination. If a GwNavWorld, the default GwNavDatabase will be used.

The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.

height :

number

The height of the bot.

radius :

number

The radius of the bot.

max_speed :

number

The maximum linear speed of the bot.

position :

stingray.Vector3

The position where the bot should be spawned.

Returns

stingray.GwNavBot

The new GwNavBot.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

smart_object_interval :

stingray.GwNavSmartObjectInterval

The interval to write into

max_distance :

number

The maximum distance in meters we want to look ahead.

Returns

boolean

true if we successfully retrieved the current or next GwNavSmartObjectInterval, false otherwise.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.GwNavDatabase

The GwNavDatabase used by this bot.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

repath_distance :

number?

The distance in meters used by the bot to check if the path must be recomputed in case a crowd dispersion passage is over crowded, default to 5

The ? notation indicates that this type is optional: there may be zero or one instances of it.

no_repath_distance :

number?

The distance in meters used by the bot to stick to the current path even though it was considered overcrowded and the bot was currently computing an alternative path, default to 1

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

smart_object_interval :

stingray.GwNavSmartObjectInterval

The smart object interval on which the bot will be on manual control

Returns

boolean

true if we successfully entered manual control, false otherwise.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

true if we successfully exited manual control, false otherwise.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.GwNavAStar

The GwNavAStar query held by the bot.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

The remaining distance from bot progress on path to end of path.

Or, nil if there's no path or GetProgressOnLivePathStatus is not valid.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

astar :

stingray.GwNavAStar

the GwNavAStar which will be initialized with this bot pathfinder settings.

destination :

stingray.Vector3

The desired endpoint of the path.

Returns

boolean

Indicates if the query was sucessfully initialized

It can then be set using GwNavAStar.set* functions, and it should preferably be computed using compute_path_async which keeps the Bot status updated with the running query, or run using GwNavAStar.compute_blocking and then set as path to follow using inject_path.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

astar :

stingray.GwNavAStar

The [GwNavAstar] that has computed the path to set.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

true if the bot is currently computing a path.

As such this function allows us to know if the computation has finished.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

true if the bot currently has a path.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

true if the bot needs to re-path because the path has been invalidated.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.GwNavTagLayerCostTable

The GwNavTagLayerCostTable for this bot.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Vector3

The velocity that Navigation suggests should be applied for this bot.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

try_can_go_mode :

stingray.GwNavAStar.TryCanGoMode

Determines if thea RayCanGo query is ran before running an AStar query.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

enable_slowing :

boolean

If set to true, velocity candidates with reduced speed will be considered; else only velocity candidate with Bot::GetDesiredSpeed() length will be considered.

enable_forcing :

boolean

If set to true, solutions with collisions are allowed if no other solutions are found after a while.

enable_stop :

boolean

If set to true, null velocity candidate will be considered; else the AvoidanceSolver will never consider stopping the Bot resulting in sometimes making it force its way through colliders.

stop_wait_time_s :

number

If the entity stopped, wait this time in seconds before moving again.

forcing_time_s :

number

If enable_forcing is true, passage is forced for at most this time in seconds only after forcing_wait_time_s seconds delay.

forcing_wait_time_s :

number

If enable_forcing is true, passage will be forced after this time in seconds

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

half_height :

number

Defines the height above and below the Bot altitude in which potential colliders will be collected. In meters.

radius :

number

Defines the radius around the Bot in which potential colliders will be collected. In meters.

frame_delay :

number

Defines the number of frames between two consecutive collection of potential colliders.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

angle_span :

number

The span of the cone in front of the bot which the computer will use to calculate candidates in degrees.

time_to_collision :

number

If an obstacle may collide in < time_to_collision seconds, take it into account.

sample_count :

number

Avoidance computer sample count (e.g. how many samples within the cone specified by angle_span).

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

turn_sampling_angle :

number

Turns greater than this value will be split into equal fans. In degrees.

channel_smoothing_angle :

number

The maximal angle of the Channel, taken with path edge direction as reference, when entering or quiting open space. Range: [1, 89].

min_distance_between_gates :

number

This distance defines minimum distance between two consecutive gates that are added during the widening between two "turn gates".

max_distance_between_gates :

number

This distance defines maximum distance between two consecutive gates that are added during the widening between two "turn gates".

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

channel_radius :

number

The distance between the path and the Channel borders. In meters.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

max_linear_speed :

number

The maximum linear speed the bot can attain.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

cost_table :

stingray.GwNavTagLayerCostTable

The GwNavTagLayerCostTable to be used by this GwNavBot's GwNavTraverseLogicData.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

from_outside_navmesh_distance :

number

The maximum distance from the start along the X axis and along the Y axis that will be searched for NavMesh, if the start point is outside the NavMesh. The search looks for triangles in an axis-aligned bounding box around the start point, with a half extent on the x and y axes equal to from_outside_navmesh_distance. To disable this feature, you can set this value to 0.f

to_outside_navmesh_distance :

number

The maximum distance from the destination along the X axis and along the Y axis that will be searched for NavMesh, if the destination point is outside the NavMesh. The search looks for triangles in an axis-aligned bounding box around the destination point, with a half extent on the x and y axes equal to to_outside_navmesh_distance. To disable this feature, you can set this value to 0.f

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

propagation_box_extent :

number

The distance between the propagation oriented 2d box boundaries and the [start, dest] segment. The astar propagation does not go outside the box.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

animation_driven :

boolean

Choose whether you want to directly read your velocity from the spline or if you are animation driven instead.

max_distance_to_spline_position :

number

If the bot is more than this distance in meters from its position on the spline, then the spline will be recomputed.

spline_length :

number

The distance we look ahead on the channel when computing the spline. Should be greater than the longest straight line the bot will encounter on its path to avoid adding artificial turns due to myopia.

spline_distance_to_borders :

number

The minimum ideal distance of the spline from the borders of the Channel (when there is sufficient room).

spline_recomputation_ratio :

number

Once the bot has moved spline_length * spline_recomputation_ratio meters along the spline it will be recomputed.

target_on_spline_distance :

number

The target is a point along the spline that is used to compute the final velocity. This parameter controls the distance this target is from the bot's position on the spline when animation_driven is true. When animation_driven is false the target position is as close as possible to the bot and this distance is therefore not used.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

use_avoidance :

boolean

Whether the bot should avoid other bots and obstacles or not.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

use_channel :

boolean

Whether we use the channel or not.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.GwNavTraverseLogicData

The GwNavTraverseLogicData for this bot.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

integer

it can be one of the following values: - 0: No action has to be taken - 1: A path must be recomputed in order to find an alternative - 2: If a path is being computed due to GameKitCrowdDispersionLogic_RecomputePath, it should be cancelled out. no action otherwise.

Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

position :

stingray.Vector3

The position of the game entity that the GwNavBot represents.

delta_time :

number

The time step that the GwNavBot should use when updating, in seconds.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavBot

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Vector3

The velocity that this bot is moving at since the last frame.