Anti-Air only

Anti-Air only

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
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Anti-Air only

Post by krogothe »

What tags are used to specify if a unit can only hit air/subs/ground, and where? I hear it can be in the fbi file but also in the scripts etc. The more i know the better i can deal with it, thanks!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

It's store ditnernally to but it's all in category variables like int notargetcat; and there's no clue as to what value relates to which...
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

You have two ways to do it:

1) Add the tag "toairweapon=1;" to the weapon's TDF entry. This will make all instances of this weapon on all units only fire on air units. This is the same as "OnlyTargetCategoryX=VTOL;".

2) Add the tag "OnlyTargetCategoryX=VTOL;" to the unit's FBI file. 'X' is the correlating weapon slot (if you want Weapon2 to be AA only, use OnlyTargetCategory2). You must do this for each weapon slot on each unit you wish to be AA-only. It offers more control but can be more time consuming. In theory you can also specify any class, not just VTOL (OnlyTargetCategory=TANK; for example), but I've not tried that personally.

In BOTH instances, you must set up the "Category" tags in the FBI files for the target group of units correctly. Let's say you want to make ARMSAM anti-air only, so you go to its FBI and add "OnlyTargetCategory1=VTOL;". Then, you must open each air unit's FBI file and verify the Category tag contains the string "VTOL" in it. In fact, that's all the information it needs: Category=VTOL;. But as long as the string matches, you're fine.

Why they didn't just use the TEDClass tag I'll never know.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Gnome wrote:You have two ways to do it:

1) Add the tag "toairweapon=1;" to the weapon's TDF entry. This will make all instances of this weapon on all units only fire on air units. This is the same as "OnlyTargetCategoryX=VTOL;".

2) Add the tag "OnlyTargetCategoryX=VTOL;" to the unit's FBI file. 'X' is the correlating weapon slot (if you want Weapon2 to be AA only, use OnlyTargetCategory2). You must do this for each weapon slot on each unit you wish to be AA-only. It offers more control but can be more time consuming. In theory you can also specify any class, not just VTOL (OnlyTargetCategory=TANK; for example), but I've not tried that personally.

In BOTH instances, you must set up the "Category" tags in the FBI files for the target group of units correctly. Let's say you want to make ARMSAM anti-air only, so you go to its FBI and add "OnlyTargetCategory1=VTOL;". Then, you must open each air unit's FBI file and verify the Category tag contains the string "VTOL" in it. In fact, that's all the information it needs: Category=VTOL;. But as long as the string matches, you're fine.

Why they didn't just use the TEDClass tag I'll never know.
As i've told you a million times, because TA doesn't and category strings are much more useful. Shame it's not documented that a category can only be 8 characters, mind. (or so it seems)
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

FLOZi wrote:As i've told you a million times, because TA doesn't and category strings are much more useful. Shame it's not documented that a category can only be 8 characters, mind. (or so it seems)
Yeah, but it's not like the units lack the TEDClass tags, and it'd surely be easier to read that than parse the crap out of Category :P
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Gnome wrote:
FLOZi wrote:As i've told you a million times, because TA doesn't and category strings are much more useful. Shame it's not documented that a category can only be 8 characters, mind. (or so it seems)
Yeah, but it's not like the units lack the TEDClass tags, and it'd surely be easier to read that than parse the crap out of Category :P
But TEDclass is only one string...

e.g.

you have infantry which can be shot at only by smallarms
you have artillery that can be shot at only by smallarms and tank guns
you have tanks that can only be shot at by tank guns

How do you do that with just TEDclass?
Post Reply

Return to “Game Development”