Is it possible to make a weapon only aims specific Targets?

Is it possible to make a weapon only aims specific Targets?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Is it possible to make a weapon only aims specific Targets?

Post by Optimus Prime »

I want to make, that a Weapon ony aims aspecific Unittype, or in other words, that a Weapon dont aims some kind of Units.
Is it possible to make this?
I know that the Flak can only aim Airtargets, but i need something more specifically, for example only Bombers. How can i do that?
User avatar
Min3mat
Posts: 3455
Joined: 17 Nov 2004, 20:19

Post by Min3mat »

u could set it so it priority set to target bombers first then make it do a ridicoulously low damage to anything else
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

how can i set a priority in targeting some units?
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

IIRC the way specific aiming is handled you can put any catagory into the "bad target catagory" value. So all you would have to do is make everything but your special unit a catagory and set that catagory to your units bat target.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

There is a way to do this using (not especially documented) Spring tags:

OnlyTargetCategory<weaponNumber>=<categoryTag>;

:wink:
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

so u mean, if a unit has 3 Weapons and i want to make weapon 2 only fires fighters, i need to add this tag in the Unit .fbi:

OnlyTargetCategoryWeapon2=Fighters;

where Fighters is in the Armor.txt declarated as all Fighterunits i want.
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

The Category in OnlyTargetCategory (only OnlyTargetCategory2 btw) refers to the categories in the units fbi category tag.
Post Reply

Return to “Engine”