Anti-Air only
Moderator: Moderators
Anti-Air only
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!
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.
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)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.
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 CategoryFLOZi 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)

But TEDclass is only one string...Gnome wrote: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 CategoryFLOZi 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)
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?