Quick anti-air question

Quick anti-air question

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Deathblane
Posts: 505
Joined: 01 Feb 2006, 01:22

Quick anti-air question

Post 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)?
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post 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.
User avatar
Drone_Fragger
Posts: 1341
Joined: 04 Dec 2005, 15:49

Post by Drone_Fragger »

Ask caydr, He'll know.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

(some) AATA AA guns are toaironly. It does work. Yes, yes it does.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post 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).
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

toaironly=1; is essentially a TDF version of OnlyTargetCategory<x>=VTOL; in the FBI.

Glad to be of service. :wink:
User avatar
Deathblane
Posts: 505
Joined: 01 Feb 2006, 01:22

Post by Deathblane »

OK, cheers for this. I'll implement it in the version of SWTA I've been modding (for lan play).
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post 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.
User avatar
Deathblane
Posts: 505
Joined: 01 Feb 2006, 01:22

Post by Deathblane »

Ok, thanks. I'll get back to you once I've had a few games with the new build.
Post Reply

Return to “Game Development”