MountedStabilizedTurret

Constructors

Constructor

Description

MountedStabilizedTurret()

Members

Member

Description

activeSightModeIndex

activeSubWeapon

Get the currently active Sub Weapon from the alternativeWeapons list.

activeSubWeaponIndex

Get the currently active Sub Weapon index.

aimCamera

aimChangeSpeed

aimFov

The Field Of View (zoom level) applied to the player when aiming this weapon

alternativeWeapons

ammo

animator

Get the weapon animator.

applyHeat

If true, each shot will heat up the weapon.

baseSpread

bearingTransform

canFire

Returns true if the weapon can be fired.

chargeTime

clampX

clampY

cooldown

currentMuzzleTransform

The muzzle transform that the next projectile will fire from.

currentSpreadMagnitude

The current spread magnitude of a weapon.

currentSpreadMaxAngleRadians

The current maximum spread of a weapon in radians.

difficultyAir

Difficulty of hitting Air target with this weapon.

difficultyAirFastMover

Difficulty of hitting AirFastMover target with this weapon.

difficultyGroundVehicles

Difficulty of hitting GroundVehicles target with this weapon.

difficultyInfantry

Difficulty of hitting Infantry target with this weapon.

difficultyInfantryGroup

Difficulty of hitting InfantryGroup target with this weapon.

effectivenessAir

Effectiveness of this weapon against Air targets.

effectivenessAirFastMover

Effectiveness of this weapon against Airplane targets.

effectivenessArmored

Effectiveness of this weapon against Armored targets.

effectivenessInfantry

Effectiveness of this weapon against Infantry targets.

effectivenessInfantryGroup

Effectiveness of this weapon against InfantryGroup targets.

effectivenessUnarmored

Effectiveness of this weapon against Unarmored targets.

effectiveRange

The range at which the weapon is considered effective.

followupSpread

gameObject

hasAdvancedReload

hasLoadedAmmo

hasSpareAmmo

heat

The current heat value of the weapon if applyHeat is enabled.

heatDrainRate

The rate at which heat drains in units per second.

heatGainPerShot

isAiming

isAuto

isCharged

True if fire input has been held long enough to fire the weapon.

isCoolingDown

isEmpty

isFull

isHoldingFire

True while fire button is held down.

isLocked

Locked weapons cannot be fired by the user.

isLoud

A loud weapon will alert nearby enemies when being fired.

isOverheating

isReloading

isUnholstered

killCredit

The actor that gets damage/kill credits from this weapon.

maxAmmo

maxSpareAmmo

maxTurnSpeed

muzzleTransforms

overrideCamera

pitchTransform

projectilesPerShot

The number of projectiles spawned when the weapons is fired.

recoilBaseKickback

recoilKickbackProneMultiplier

recoilRandomKickback

recoilSnapDuration

recoilSnapFrequency

recoilSnapMagnitude

recoilSnapProneMultiplier

reloadTime

scopeAimObject

seat

sensitivityX

sensitivityY

slot

spareAmmo

springAmount

springDrag

springForce

springMaxOffset

stabilizeX

stabilizeY

thirdPersonOffset

thirdPersonRotation

thirdPersonScale

transform

uiSprite

unholsterTime

useChargeTime

When true, the weapon must charge before firing.

useMaxTurnSpeed

user

useSpring

weaponEntry

vehicleRigidbodyRecoilForce

Events

Event

Description

onFire

Invoked when the weapon is fired.

onSpawnProjectiles

Invoked when the weapon is fired.

Methods

Method

Description

AddSubWeapon(subWeapon)

Add a subweapon to this parent weapon, returning the subweapon index.

CanAimAt(position)

EquipSubWeapon(subWeaponIndex)

Switch to the next Sub Weapon in the Weapon’s alternativeWeapons list.

GenerateWeaponRoleFromStats()

Matches a weapon role based on the weapon’s current stats.

InstantlyReload()

LockWeapon()

Lock the weapon so it cannot be fired.

NextSightMode()

NextSubWeapon()

Switch to the next Sub Weapon in the Weapon’s alternativeWeapons list.

PreviousSightMode()

Reload()

RemoveSubWeapon(subWeaponIndex)

Removes a subweapon from this parent weapon.

RemoveSubWeapon(subWeapon)

Removes a subweapon from this parent weapon.

SetProjectilePrefab(prefab)

Shoot(force)

Shoots this weapon.

ToString()

UnlockWeapon()

Unlock the weapon so it can be fired.

Details

class MountedStabilizedTurret
MountedStabilizedTurret MountedStabilizedTurret()
const int activeSightModeIndex
const Weapon activeSubWeapon

Get the currently active Sub Weapon from the alternativeWeapons list.

const int activeSubWeaponIndex

Get the currently active Sub Weapon index.

const Camera aimCamera
float aimChangeSpeed
float aimFov

The Field Of View (zoom level) applied to the player when aiming this weapon

const array<Weapon> alternativeWeapons
int ammo
const Animator animator

Get the weapon animator. Please note that weapons carried by the AI never have animators. Only player carried weapons and MountedWeapons can have animators.

bool applyHeat

If true, each shot will heat up the weapon. If the heat value reaches 1 the gun overheats, and cannot be fired again until it cools down.

float baseSpread
Transform bearingTransform
const bool canFire

Returns true if the weapon can be fired. Checks ammo, cooldown, overheat, lock, target tracker and misc flags

float chargeTime
MountedStabilizedTurretClamp clampX
MountedStabilizedTurretClamp clampY
float cooldown
const Transform currentMuzzleTransform

The muzzle transform that the next projectile will fire from.

const float currentSpreadMagnitude

The current spread magnitude of a weapon. The spread magnitude is the radius of a sphere 1 meter in front of the muzzle. The projectile may fire towards a random point inside that sphere.

const float currentSpreadMaxAngleRadians

The current maximum spread of a weapon in radians.

Difficulty difficultyAir

Difficulty of hitting Air target with this weapon.

Difficulty difficultyAirFastMover

Difficulty of hitting AirFastMover target with this weapon.

Difficulty difficultyGroundVehicles

Difficulty of hitting GroundVehicles target with this weapon.

Difficulty difficultyInfantry

Difficulty of hitting Infantry target with this weapon.

Difficulty difficultyInfantryGroup

Difficulty of hitting InfantryGroup target with this weapon.

Effectiveness effectivenessAir

Effectiveness of this weapon against Air targets. This value is used by AI and TargetTrackers to prioritize targets.

Effectiveness effectivenessAirFastMover

Effectiveness of this weapon against Airplane targets. This value is used by AI and TargetTrackers to prioritize targets.

Effectiveness effectivenessArmored

Effectiveness of this weapon against Armored targets. This value is used by AI and TargetTrackers to prioritize targets.

Effectiveness effectivenessInfantry

Effectiveness of this weapon against Infantry targets. This value is used by AI and TargetTrackers to prioritize targets.

Effectiveness effectivenessInfantryGroup

Effectiveness of this weapon against InfantryGroup targets. This value is used by AI and TargetTrackers to prioritize targets.

Effectiveness effectivenessUnarmored

Effectiveness of this weapon against Unarmored targets. This value is used by AI and TargetTrackers to prioritize targets.

float effectiveRange

The range at which the weapon is considered effective.

FollowupSpread followupSpread
const GameObject gameObject
const bool hasAdvancedReload
const bool hasLoadedAmmo
const bool hasSpareAmmo
float heat

The current heat value of the weapon if applyHeat is enabled. When heat reaches 1, the weapon cannot be fired until the heat reaches 0 again.

float heatDrainRate

The rate at which heat drains in units per second.

float heatGainPerShot
const bool isAiming
bool isAuto
const bool isCharged

True if fire input has been held long enough to fire the weapon.

const bool isCoolingDown
const bool isEmpty
const bool isFull
const bool isHoldingFire

True while fire button is held down.

bool isLocked

Locked weapons cannot be fired by the user.

bool isLoud

A loud weapon will alert nearby enemies when being fired.

const bool isOverheating
const bool isReloading
const bool isUnholstered
Actor killCredit

The actor that gets damage/kill credits from this weapon. Automatically set to whoever equips this weapon, but can be overridden if required

int maxAmmo
int maxSpareAmmo
float maxTurnSpeed
const array<Transform> muzzleTransforms
const Camera overrideCamera
Transform pitchTransform
int projectilesPerShot

The number of projectiles spawned when the weapons is fired.

float recoilBaseKickback
float recoilKickbackProneMultiplier
float recoilRandomKickback
float recoilSnapDuration
float recoilSnapFrequency
float recoilSnapMagnitude
float recoilSnapProneMultiplier
float reloadTime
const GameObject scopeAimObject
const Seat seat
float sensitivityX
float sensitivityY
const int slot
int spareAmmo
float springAmount
float springDrag
float springForce
Vector2 springMaxOffset
bool stabilizeX
bool stabilizeY
const Vector3 thirdPersonOffset
const Quaternion thirdPersonRotation
const float thirdPersonScale
const Transform transform
const Sprite uiSprite
float unholsterTime
bool useChargeTime

When true, the weapon must charge before firing. Requires the fire button to be held for chargeTime seconds before firing.

bool useMaxTurnSpeed
const Actor user
bool useSpring
const WeaponEntry weaponEntry
float vehicleRigidbodyRecoilForce
const ScriptEvent onFire

Callback Signature:

void callback()

Note

This event can be consumed by calling CurrentEvent.Consume(). Consuming this event stops the weapon from firing.

Invoked when the weapon is fired.

const ScriptEvent onSpawnProjectiles

Callback Signature:

void callback()

Invoked when the weapon is fired. Provides an array of all spawned projectiles.

int AddSubWeapon(Weapon subWeapon)

Add a subweapon to this parent weapon, returning the subweapon index.

bool CanAimAt(Vector3 position)
void EquipSubWeapon(int subWeaponIndex)

Switch to the next Sub Weapon in the Weapon’s alternativeWeapons list.

WeaponRole GenerateWeaponRoleFromStats()

Matches a weapon role based on the weapon’s current stats.

void InstantlyReload()
void LockWeapon()

Lock the weapon so it cannot be fired.

void NextSightMode()
void NextSubWeapon()

Switch to the next Sub Weapon in the Weapon’s alternativeWeapons list.

void PreviousSightMode()
void Reload()
void RemoveSubWeapon(int subWeaponIndex)

Removes a subweapon from this parent weapon.

void RemoveSubWeapon(Weapon subWeapon)

Removes a subweapon from this parent weapon.

void SetProjectilePrefab(GameObject prefab)
bool Shoot(bool force)

Shoots this weapon.If force is true, ignores the CanFire() check. Returns true if shot was fired.

string ToString()
void UnlockWeapon()

Unlock the weapon so it can be fired.