1. HE - for buildings, troops, and general force-fire
2. HEAT/HESH - for light AFV e.g. APCs, Armoured Cars
3. APDS/Other KE rounds - for tanks
Using the weapon slave tags, they can be forced to all target the same unit. Also using the new OnlyTargetCategory<x> tag, HEAT/HESH and APDS can be limited to their appropriate targets.
The problem is making a fire control script that will always leave the same reload time between shots, whether it be 2 shots of HE or a HE then a HEAT etc., not allow multiple ammo types to fire simultaneously and only fire HE when the ground is force-attacked (also bear in mind the tank will probably have a co-axial MG (infantry-only) too).

Having some (more) engine support for such things would be very cool

But perhaps someone can come up with something fairly bulletproof with what is to hand.
Here's what I have so far, but this would probably allow weapon 1 to fire after an illegal reload time. The problem is that HE is allowed to shoot at anything (i could try limiting it to everything BUT the HEAT/HESH and APDS categories... but I would still have an issue with force fire)
Code: Select all
//weapon 1 = HE, 2 = HEAT/HESH, 3 = APDS
#define RELOAD 5000
static-var canFireWeap;
Create() {
canFireWeap = 1;
// ...etc
}
AimWeapon1(heading, pitch) {
if (canFireWeap != 1)
sleep RELOAD;
canFireWeap = 1;
// ...etc
}
AimWeapon2(heading, pitch) {
start-script canFire(2);
// ...etc
}
canFire(x) {
if (canFireWeap != x && x != 1) {
sleep RELOAD;
canFireWeap = x;
}
}