Problem with OnlyTargetCategory and current svn Spring

Problem with OnlyTargetCategory and current svn Spring

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Problem with OnlyTargetCategory and current svn Spring

Post by yuritch »

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.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

Thank you for brining this to my attention. Can you send me the mod that is breaking so I can fix it?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Ah, that explains why my lolis kept turning to the side... In Lolimod I wont let a weapon fire if the unit is moving.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

ILMTitan wrote:Thank you for brining this to my attention. Can you send me the mod that is breaking so I can fix it?
Check your PM for a link.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

I can't seem to recreate the problem with the script-blocked weapons. Additionally, I can't see how script blocked weapons could cause a problem. TryTarget(...) does not seem to have any calls to the scripts, and only checks if the weapon can hit the target, not if it can fire (unless it has no stockpile).

I do however, see the problem with the OnlyTargetCategory, and am writing code that fixes that now.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

Ok, script-blocked weapons causing the problem might have been my imagination, I'll recheck that when the OnlyTargetCategory fix is in.
Post Reply

Return to “Help & Bugs”