AITurretShape

consoledoc.h

More...

Public Static Attributes

bool

Disables rendering of all instances of this type.

bool

Disables selection of all instances of this type.

Public Functions

void

Activate a turret from a deactive state.

void

Adds object to the turret's ignore list.

void

Removes all objects from the turret's ignore list.

void

Deactivate a turret from an active state.

Returns the object in the ignore list at index.

Get the turret's current target.

float

Get the turret's defined projectile velocity that helps with target leading.

bool

Indicates if the turret has a target.

int

Returns the number of objects in the turrets ignore list.

void

Recenter the turret's weapon.

void

Removes object from the turret's ignore list.

void

Resets the turret's target tracking.

void
setAllGunsFiring(bool fire)

Set the firing state of the turret's guns.

void
setGunSlotFiring(int slot, bool fire)

Set the firing state of the given gun slot.

void
setTurretState(string newState, bool force)

Set the turret's current state.

void
setWeaponLeadVelocity(float velocity)

Set the turret's projectile velocity to help lead the target.

void

Begin scanning for a target.

void

Have the turret track the current target.

void

Stop scanning for targets.

void

Stop the turret from tracking the current target.

Detailed Description

Public Static Attributes

bool isRenderable 

Disables rendering of all instances of this type.

bool isSelectable 

Disables selection of all instances of this type.

Public Functions

activateTurret()

Activate a turret from a deactive state.

addToIgnoreList(ShapeBase obj)

Adds object to the turret's ignore list.

All objects in this list will be ignored by the turret's targeting. Parameters:

obj

The ShapeBase object to ignore.

clearIgnoreList()

Removes all objects from the turret's ignore list.

All objects in this list will be ignored by the turret's targeting.

deactivateTurret()

Deactivate a turret from an active state.

getIgnoreListObject(int index)

Returns the object in the ignore list at index.

All objects in this list will be ignored by the turret's targeting. Parameters:

index

The index of the object in the ignore list being retrieved.

getTarget()

Get the turret's current target.

return:

The object that is the target's current target, or 0 if no target.

getWeaponLeadVelocity()

Get the turret's defined projectile velocity that helps with target leading.

return:

The defined weapon projectile speed, or 0 if leading is disabled.

hasTarget()

Indicates if the turret has a target.

return:

True if the turret has a target.

ignoreListCount()

Returns the number of objects in the turrets ignore list.

All objects in this list will be ignored by the turret's targeting.

recenterTurret()

Recenter the turret's weapon.

removeFromIgnoreList(ShapeBase obj)

Removes object from the turret's ignore list.

All objects in this list will be ignored by the turret's targeting. Parameters:

obj

The ShapeBase object to once again allow for targeting.

resetTarget()

Resets the turret's target tracking.

Only resets the internal target tracking. Does not modify the turret's facing.

setAllGunsFiring(bool fire)

Set the firing state of the turret's guns.

Parameters:

fire

Set to true to activate all guns. False to deactivate them.

setGunSlotFiring(int slot, bool fire)

Set the firing state of the given gun slot.

Parameters:

slot

The gun to modify. Valid range is 0-3 that corresponds to the weapon mount point.

fire

Set to true to activate the gun. False to deactivate it.

setTurretState(string newState, bool force)

Set the turret's current state.

Normally the turret's state comes from updating the state machine but this method allows you to override this and jump to the requested state immediately. Parameters:

newState

The name of the new state.

force

Is true then force the full processing of the new state even if it is the same as the current state. If false then only the time out value is reset and the state's script method is called, if any.

setWeaponLeadVelocity(float velocity)

Set the turret's projectile velocity to help lead the target.

This value normally comes from AITurretShapeData::weaponLeadVelocity but this method allows you to override the datablock value. This can be useful if the turret changes ammunition, uses a different weapon than the default, is damaged, etc.

note:

Setting this to 0 will disable target leading.

startScanForTargets()

Begin scanning for a target.

startTrackingTarget()

Have the turret track the current target.

stopScanForTargets()

Stop scanning for targets.

note:

Only impacts the scanning for new targets. Does not effect a turret's current target lock.

stopTrackingTarget()

Stop the turret from tracking the current target.