Exactly. Is there a limit on weapon ids? If not, then simply having the unit switch weapons, ieknorke wrote:With that you would not even have to check where the projectiles impacted.To be fair, having to zoom in on an individual target to aim for the treads / turret / whatever would be a bit of a bitch in large-scale engagements anyway; better implemented as a 'aim for turret / body' option in the attacking unit (kinda like hold fire and movestates etc) I'd've thought. Or at least, that's how Mech Commander did it...
You could just do
If AttackingUnit was aiming for Head then ExplodeHead
If AttackingUnit was aiming for Arm then ExplodeArm
Id 10 - Cannon, aiming default
Id 11 - Cannon, aiming for head / critical target (ie the turret)
Id 12 - Cannon, aiming for mobility (treads, legs etc)
Id 13 - Cannon, aiming for weapons
Then use hitbyweapid to find out what the attacking unit was aiming for. Have a script that applies damage to either normal, critical, mobility or weaponry randomly (with 'normal' being heavily weighted, obviously) with what the attacker was aiming for adding some form of bonus. Equally, as they are technically separate weapons, you could slightly tweak reloadtimes and accuracy as penalties for increased chance to damage the target's abilities.
Downside is A) a lot of weapon files and B) a lot of weaponids to handle.
The 'Flozi Method' could still be used on units sufficiently big to warrant it, ie gigantic Superheavy tanks with a lot of volume to try and destroy.