Problem with OnlyTargetCategory and current svn Spring
Posted: 13 Oct 2007, 08:31
Looks like svn revision 4517 brought a new problem to Spring. That change was to make units unable to fire at their target move sideways (so they may find a clean line of fire).
However, it doesn't take into account the reasons one unit cannot fire at the other. That's not always caused by blocked line of fire! For example, now units will orbit things they cannot shoot because of OnlyTargetCategory or script-blocked weapons.
My example: I have a unit with 2 weapons, an autocannon and a missile launcher. Missile launcher has a deploying animation (hatches opening, missile loading and such) that takes some time (3 seconds) during which it is jammed by AimWeapon2. Weapons are set up so that autocannon will only fire at light units and the missile will only target heavy units. Now if there is a heavy unit in range, my unit will start to go sideways until the missile deployment anim finishes (since both weapons are considered blocked during that time - OnlyTargetCategory prevents autocannon from firing at heavy things and the missile isn't ready to fire yet). That is not the intended behaviour, the unit can lose line of fire because of that.
This is probably not noticeable in TA-based mods (not many units with different OnlyTargetCategory per-weapon there), but it can affect other mods greatly.
However, it doesn't take into account the reasons one unit cannot fire at the other. That's not always caused by blocked line of fire! For example, now units will orbit things they cannot shoot because of OnlyTargetCategory or script-blocked weapons.
My example: I have a unit with 2 weapons, an autocannon and a missile launcher. Missile launcher has a deploying animation (hatches opening, missile loading and such) that takes some time (3 seconds) during which it is jammed by AimWeapon2. Weapons are set up so that autocannon will only fire at light units and the missile will only target heavy units. Now if there is a heavy unit in range, my unit will start to go sideways until the missile deployment anim finishes (since both weapons are considered blocked during that time - OnlyTargetCategory prevents autocannon from firing at heavy things and the missile isn't ready to fire yet). That is not the intended behaviour, the unit can lose line of fire because of that.
This is probably not noticeable in TA-based mods (not many units with different OnlyTargetCategory per-weapon there), but it can affect other mods greatly.