Reducing overkill
Moderator: Moderators
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Code: Select all
AimWeapon1(heading,pitch,RandomSeed)
{
RandomSeed = RAND(0,4)
If(RandomSeed > 1)
(
SET BlockShot1(TARGET_ID,1)
} else {
//DO AIMING CODE HERE
}
Return(1);
}
Probably something like
I think unitID was > 0 for aircraft. So this would make the unit stop targeting it's current target if it was an aircraft. I'd like to know what unitID is good for other than the obvious...
Anyway, you could count the amount of rounds you fired and if it exceeds a certain number have BlockShotX() pick another target and reset the counter. It's always getting called by the way, before AimWeaponX() I think.
Code: Select all
BlockShotX(unitID, blockShot) {
if (unitID) blockShot = TRUE;
}
Anyway, you could count the amount of rounds you fired and if it exceeds a certain number have BlockShotX() pick another target and reset the counter. It's always getting called by the way, before AimWeaponX() I think.