Skyline Lua API  Version 1.0
Lua Script Reference for Skyline Game Engine.
sensor Class Reference

#include <LUA_API_Sensor.h>

Public Member Functions

int setVisabilityOffset (int objID, float x, float y, float z)
 Sets Start Offset of the sensor visability raycast. This is for the case where you may have somthing like a gun offset from the character main axis. By using this offset you acn ensure that the gun has line of sight to the target. More...
 
int setVisabilityTargetOffset (int objID, float x, float y, float z)
 Sets Target Offset of the sensors visability raycast. This is for the case where you may have somthing like a gun offset from the character main axis. By using this offset you acn ensure that the gun has line of sight to the target. More...
 
int enableDebugVisibility (int objID, int state)
 Turns on/off the visability ray check debug lines for error checking the Visability Offsets. More...
 
int getSensorMode (int objID)
 Returns the current sensor mode 0 = CLOSEST and 1 = All. More...
 
void setTargetMode_Single (int objID, int target_ID)
 Part of the sensor targeting mode commands. More...
 
void setTargetMode_Faction (int objID, string faction)
 Part of the sensor targeting mode commands. More...
 
void setTargetMode_Closest (int objID)
 Part of the sensor targeting mode commands. More...
 
void setTargetMode_Random (int objID)
 Part of the sensor targeting mode commands. More...
 
void enableVisibilityCheck (int objID, int state)
 Part of the sensor targeting mode commands. More...
 
void isTargetVisible (int objID)
 Returns 1 or 0 if the current target is visible. Must have target enableVisibilityCheck(...) More...
 

Detailed Description

Functions to work inconjuction with the AI Sensor Action. Note: Only objects with the same query flags as the sensors flags will be detected. Ridgid body actions use their collision group flag although only one flag at a time can be used on the ridgid body.
Use as sensor.function()
For more information on how these functions can be used please visit the User Manual - https://home.aurasoft-skyline.co.uk

Member Function Documentation

int sensor::enableDebugVisibility ( int  objID,
int  state 
)

Turns on/off the visability ray check debug lines for error checking the Visability Offsets.

Parameters
obj: ID of the parent scene enitiy that has the sensor
state: 1=on and 0=off sensor.enableDebugVisibility(obj,1);
void sensor::enableVisibilityCheck ( int  objID,
int  state 
)

Part of the sensor targeting mode commands.

Parameters
objID: The ID of the parent scene entity that has this sensor.
state: The 1 or 0 to enable he ray visibility check to see if the AI can see its target or is it blocked?

This command will set the sensor into random check mode. Any available object will be tracked until signal lost or destroyed.

int sensor::getSensorMode ( int  objID)

Returns the current sensor mode 0 = CLOSEST and 1 = All.

Parameters
obj: ID of the parent scene enitiy that has the sensor
void sensor::isTargetVisible ( int  objID)

Returns 1 or 0 if the current target is visible. Must have target enableVisibilityCheck(...)

Parameters
objID: The ID of the parent scene entity that has this sensor.

This command will set the sensor into random check mode. Any available object will be tracked until signal lost or destroyed.

void sensor::setTargetMode_Closest ( int  objID)

Part of the sensor targeting mode commands.

Parameters
objID: The ID of the parent scene entity that has this sensor.

This command will set the sensor into closest object check mode. The object closest to the sensor will be tracked. Only objects with their matching query flags set will be detected.

void sensor::setTargetMode_Faction ( int  objID,
string  faction 
)

Part of the sensor targeting mode commands.

Parameters
objID: The ID of the parent scene entity that has this sensor.
faction: The string faction of this object. This is set in the scene entities base properties "description" option.

This command will set the sensor into Faction mode. Only objects withb their descriptions set to the same as the one passed in the artg, will be tracked. The closest will be primary target.

void sensor::setTargetMode_Random ( int  objID)

Part of the sensor targeting mode commands.

Parameters
objID: The ID of the parent scene entity that has this sensor.

This command will set the sensor into random check mode. Any available object will be tracked until signal lost or destroyed.

void sensor::setTargetMode_Single ( int  objID,
int  target_ID 
)

Part of the sensor targeting mode commands.

Parameters
objID: The ID of the parent scene entity that has this sensor.

This command will set the sensor into single check mode. Only one object with thetarget ID will be tracked.

int sensor::setVisabilityOffset ( int  objID,
float  x,
float  y,
float  z 
)

Sets Start Offset of the sensor visability raycast. This is for the case where you may have somthing like a gun offset from the character main axis. By using this offset you acn ensure that the gun has line of sight to the target.

Note: This requires the sensor to have the command sensor.enableVisibilityCheck(obj, 1); called prior to use.

Parameters
objID: ID of the parent scene enitiy that has the sensor.
x,y,z: Offset of sensor visability raycast.

sensor.setVisabilityOffset(obj,x,y,z);

int sensor::setVisabilityTargetOffset ( int  objID,
float  x,
float  y,
float  z 
)

Sets Target Offset of the sensors visability raycast. This is for the case where you may have somthing like a gun offset from the character main axis. By using this offset you acn ensure that the gun has line of sight to the target.

Note: This requires the sensor to have the command sensor.enableVisibilityCheck(obj, 1); called prior to use.

Parameters
objID: ID of the parent scene enitiy that has the sensor.
x,y,z: Offset of sensor visability raycast.

sensor.setVisabilityTargetOffset(obj,x,y,z);


The documentation for this class was generated from the following file: