ST_B_TurretControl : MF_AbstractPlatformControl
Allows for AI control of the turret. It bridges communication between the turret, weapon, and targeting scripts, and is placed on the same object that holds the MF_B_Turret script. This is designed to be used with the MF_AbstractWeapon, and MF_AbstractTargeting scripts. If you wish to use different scripts, they'll either have to inherit the abstracts, or a new fire control script will need to be written interface it with the turret.
Essentially, this script holds pointers to the weapons this turret has, and includes some aiming and behavior information. It asks the turret if it is aimed at the target. If it is, it then asks the weapon if it is ready to fire. If so, then sends a fire command to the weapon.
Inherited Variables
targetingScript, weapons, aimTime, curWeapon
Inherited Classes
WeaponData
Public Variables
target : Transform
Current target of the turret. This will either be supplied by the targeting script, or be assigned directly. However, if the turret is choosing its own targets with a targeting script, this may immediately be overwritten.
controller : ControlType enum { AI_AutoTarget, None }
AI_AutoTarget: AI will use a scanner and a targeting script to pick targets. If no targeting script is picking targets, you may directly assign a target.
None: Turret is deactivated.
alternatingFire : bool
When using multiple weapons, you can choose to have them all fire at once, or alternate shots between them. If alternating, the delay before the next weapons fires is the cycleTime of the weapon at index 0 divided by the number of weapons. This will produce odd results if you have weapons with different rates of fire.
fullBurst : bool
Upon firing, weapons will finish a full burst according to their burst fire setting.
checkLOS : bool
Uses Raycast to check line of sight before firing.
losCheckInterval : float
Increase time between Raycast line of sight checks to improve performance. 0 = before every shot.
checkTargetSize : bool
This script tries to determine the target size when choosing whether or not to fire. This way, it will fire even if not aimed directly at the target center. It approximates the size of the target using the average dimension of the first root collider found. If no collider is found, it will look for the first collider in the root's children. If none found it will then check the children's children. If still none found, it will use targetSizeDefault.
targetSizeDefault : float
If no target size can be found, you can set a default size for the the weapons to fire at.
Allows for AI control of the turret. It bridges communication between the turret, weapon, and targeting scripts, and is placed on the same object that holds the MF_B_Turret script. This is designed to be used with the MF_AbstractWeapon, and MF_AbstractTargeting scripts. If you wish to use different scripts, they'll either have to inherit the abstracts, or a new fire control script will need to be written interface it with the turret.
Essentially, this script holds pointers to the weapons this turret has, and includes some aiming and behavior information. It asks the turret if it is aimed at the target. If it is, it then asks the weapon if it is ready to fire. If so, then sends a fire command to the weapon.
Inherited Variables
targetingScript, weapons, aimTime, curWeapon
Inherited Classes
WeaponData
Public Variables
target : Transform
Current target of the turret. This will either be supplied by the targeting script, or be assigned directly. However, if the turret is choosing its own targets with a targeting script, this may immediately be overwritten.
controller : ControlType enum { AI_AutoTarget, None }
AI_AutoTarget: AI will use a scanner and a targeting script to pick targets. If no targeting script is picking targets, you may directly assign a target.
None: Turret is deactivated.
alternatingFire : bool
When using multiple weapons, you can choose to have them all fire at once, or alternate shots between them. If alternating, the delay before the next weapons fires is the cycleTime of the weapon at index 0 divided by the number of weapons. This will produce odd results if you have weapons with different rates of fire.
fullBurst : bool
Upon firing, weapons will finish a full burst according to their burst fire setting.
checkLOS : bool
Uses Raycast to check line of sight before firing.
losCheckInterval : float
Increase time between Raycast line of sight checks to improve performance. 0 = before every shot.
checkTargetSize : bool
This script tries to determine the target size when choosing whether or not to fire. This way, it will fire even if not aimed directly at the target center. It approximates the size of the target using the average dimension of the first root collider found. If no collider is found, it will look for the first collider in the root's children. If none found it will then check the children's children. If still none found, it will use targetSizeDefault.
targetSizeDefault : float
If no target size can be found, you can set a default size for the the weapons to fire at.