So, I have a T1 Aerial unit that is Direct Fire & Groundfire, like a gunship. Building, targeting, and movement are all fine, but it does not actually attack the targets.
I created a custom weapon file in /hook/lua:
- Code: Select all
TIEBolt = Class(DefaultProjectileWeapon) {
FxMuzzleFlash = EffectTemplate.ADisruptorCannonMuzzle01,}
Linked it to script:
- Code: Select all
local TAirUnit = import('/lua/terranunits.lua').TAirUnit
local TIEBolt = import('/lua/aeonweapons.lua').TIEBolt
GEA0102 = Class(TAirUnit)
Weapons = {
MainGun = Class(TIEBolt) {
},
},
TypeClass = GEA0102
And this is the weapon in .bp (Note: In Blender, I have two weapon muzzle bones [Muzzle_01 & Muzzle_02] parented to 'Turret' bone, and that to the unit's main GEA0102 bone):
- Code: Select all
Weapon = {
{
AboveWaterTargetsOnly = true,
Audio = {
MuzzleChargeStart = Sound {
Bank = 'UALWeapon',
Cue = 'UAL0201_Cannon_Disruptor',
LodCutoff = 'Weapon_LodCutoff',
},
},
BallisticArc = 'RULEUBA_none',
CollideFriendly = false,
Damage = 10,
DamageRadius = 3,
DamageType = 'Normal',
DisplayName = 'Disruptor Cannon',
FireTargetLayerCapsTable = {
Air = 'Land|Water|Seabed',
Land = 'Land|Water|Seabed',
},
FiringTolerance = 2,
Label = 'MainGun',
MaxRadius = 25,
MuzzleSalvoSize = 1,
MuzzleVelocity = 30,
ProjectileId = '/projectiles/ADFDisruptor01/ADFDisruptor01_proj.bp',
ProjectileLifetimeUsesMultiplier = 1.15,
ProjectilesPerOnFire = 2,
RackBones = {
{
MuzzleBones = {
'Muzzle_01',
'Muzzle_02',
},
RackBone = 'Turret',
},
},
RackFireTogether = true,
RackRecoilDistance = 0,
RackReloadTimeout = 10,
RackSalvoChargeTime = 0,
RackSalvoReloadTime = 0,
RackSalvoSize = 1,
RackSlavedToTurret = false,
RangeCategory = 'UWRC_DirectFire',
RateOfFire = 5,
SlavedToBody = true,
SlavedToBodyArcRange = 5,
TargetCheckInterval = 1,
TargetPriorities = {
'SPECIALHIGHPRI',
'STRUCTURE',
'SPECIALLOWPRI',
'ALLUNITS',
},
TargetRestrictDisallow = 'UNTARGETABLE',
TrackingRadius = 1.15,
TurretBoneMuzzle = 'Muzzle_01',
TurretBonePitch = 'Turret',
TurretBoneYaw = 'Turret',
TurretDualManipulators = false,
TurretPitch = 0,
TurretPitchRange = 20,
TurretPitchSpeed = 60,
TurretYaw = 0,
TurretYawRange = 10,
TurretYawSpeed = 60,
Turreted = true,
WeaponCategory = 'Direct Fire',
},
The unit will be built, can target enemies, will fly toward them, but will not fire down on them at all. The .bp (less the weapon above) is just a Gunship with the circling removed, so it just goes by like a bomber. Any ideas?