I'm trying to make a "charge" type weapon, resembling something like a tesla coil or a prism tower from RA2. The idea is that the weapon needs to "charge" or "lock on" for a few seconds before firing. After charging it fires 3 energy pulses in a single salvo, then it needs to charge again before firing another 3.
The weapon works fine so far, but there's a few small problems. First, I want it to play a sound when it charges, so the enemy knows they have been targeted and get out of range quickly. But the only sound (that I know of) you can play with a weapon is when it actually fires, not before it fires. And the second problem is more of an annoyance: when you manually select a new target while the weapon is charging, the charging starts all over again. I want it to just remain charged so you can select a target if you see a better one, without disrupting the charging process alltogether.
Here's the code, if that helps.
Code:
Weapon LaserPulseWeapon
PrimaryDamage = 150.0
PrimaryDamageRadius = 10.0
AttackRange = 225.0
DamageType = LASER ;this damage type has been changed
DeathType = LASERED
WeaponSpeed = 999999.0 ; dist/sec
DelayBetweenShots = 200 ; time between shots, msec
ClipSize = 3 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 500 ; how long to reload a Clip, msec
AutoReloadsClip = Yes
AutoReloadWhenIdle = 600
PreAttackDelay = 4000
PreAttackType = PER_CLIP
LaserName = BigLaserBeam
FireSound = LaserPulseFireSound
End