Page 1 of 1

Quick anti-air question

Posted: 10 Apr 2006, 00:49
by Deathblane
How do you make a unit shoot only at air targets?
For my own use I've tried to make the aa units in SWTA shoot at only air targets but all I've managed to do is completely stop them fireing.
I've set the 'badtargetcatagory=NotAir' and added 'toaironly=1;' to their weapons but now they won't fire at all.
Is there an easy way to make this work or do you need to add 'dud' weapons the the model (as per many of the anti-air units in AA)?

Posted: 12 Apr 2006, 12:52
by Gnomre
I have no idea how. That's why SWTA AA units fire at everything, unfortunately. I'd be more than happy to make them toaironly again if anyone could show me a working unit with that property.

Posted: 12 Apr 2006, 13:14
by Drone_Fragger
Ask caydr, He'll know.

Posted: 12 Apr 2006, 15:13
by FLOZi
(some) AATA AA guns are toaironly. It does work. Yes, yes it does.

Posted: 13 Apr 2006, 01:15
by Gnomre
With FLOZi's help, I've found the cause of this. Spring doesn't use TEDClass to denote what type of unit it is, like you would expect. At least, not for toaironly=1; and OnlyTargetCategoryX=VTOL; weapons.

This is from the P-51D FBI file (yay exclusive AATA builds):
Category=ARM VTOL LEVEL1 WEAPON NOTSUB CTRL_Y;

And this is from the X-Wing:
Category=REB CTRL_W CTRL_V LEVEL3 NOTSUB NOTSTRUCTURE;

Notice the key difference. The X-Wing lacks the "VTOL" part. That is the problem. Once I put "VTOL" in the X-Wing's category line, toaironly=1; weapons fired perfectly and as expected.

So, there you go kids. I'm not sure it was a problem for anyone else, but that's what causes it. It'll be fixed in the next version of SWTA (which should hopefully be soon, we're just trying to finish a couple new units and models now).

Posted: 13 Apr 2006, 01:19
by FLOZi
toaironly=1; is essentially a TDF version of OnlyTargetCategory<x>=VTOL; in the FBI.

Glad to be of service. :wink:

Posted: 13 Apr 2006, 13:50
by Deathblane
OK, cheers for this. I'll implement it in the version of SWTA I've been modding (for lan play).

Posted: 14 Apr 2006, 01:03
by Gnomre
Well, we're not too far off from another version which has already incorporated that.

But, I guess if you don't want to wait... I can send you a PM.

Posted: 14 Apr 2006, 13:00
by Deathblane
Ok, thanks. I'll get back to you once I've had a few games with the new build.