Gauss module to target fighters only

So I have looked all over the forum and simply cannot figure out this one problem.  I am trying to create a new module type that can ONLY attack fighters, not other ships.

Q: How do I limit the damage to one type of object, in this case a fighter?

Here is what I have done so far....

  1. Created a new planet module type calld anti-fighter gauss weapon
  2. limited that weapon to have 0 damage and only 1 target on the front bank
  3. set the CanFireAtFighter TRUE
  4. created a new ability called "antifighter" in which I have the following...

targetFilter
 numOwnerships 1
 ownership "Enemy"
 numObjects 1
 object "Fighter"
 numSpaces 1
 space "Normal"
 numConstraints 0

However when I try to force the gun to target and shoot an enemy fighter I get a "ability cannot target this type of object" message.  What is interesting is if I change the weapon banks to do damage, lets say 4 banks at 50 each with 1 target per bank, the guns will absolutely decimate the fighters, however this is AFTER they tear through all the frigates (I have the attack type set to "ANTILIGHT".

Hopefully someone has come across this.  I wish there was a way to change the targets and priorities of the turrets like you can in the ability (and there does not appear to be a "FIGHTER" constraint anywhere :(

6,138 views 12 replies
Reply #1 Top

have you tried the ANTIVERYLIGHT type?

harpo

 

Reply #2 Top

that I know of, thier is no way to get a NORMAL weapon to only fire at a fighter.

Abilities are differnt, in the Ability file, thier should be a couple lines that list the types of targets that can be targeted. This can be manipulated so the ability can only target fighters.

 

Have you read Ironclads Introduction to modding? If not, I sugest you do.  

Reply #3 Top

Hmm. Now I'm wondering about the flipside: Is there a way to have a special ability buff grant the ability to attack Fighters with normal weapons?

Reply #4 Top

Quoting EvilTesla-RG, reply 2
that I know of, thier is no way to get a NORMAL weapon to only fire at a fighter.

Abilities are differnt, in the Ability file, thier should be a couple lines that list the types of targets that can be targeted. This can be manipulated so the ability can only target fighters.

 
Have you read Ironclads Introduction to modding? If not, I sugest you do.  
End of EvilTesla-RG's quote

have you read the original post? if not, I suggest you do. the OP used an ability and (assumedly) linked it to weapons fire (using the incendiary fire ability's buff type) then set constraints properly, this is not a stupid newbie issue.

it's easy to make hit and run posts like this considering how many of the same questions get asked over and over but come on.

Reply #5 Top

I had suggested the AttackType "ANTIVERYLIGHT" from the antifighter frigates of each race in the weapon 1 part of each antifighter frigate.

harpo

Reply #6 Top

have you tried harpo's suggestion first?

 

has anyone tried creating an AttackType? you could make it....ANTIFIGHTER let's say

 

        DamagePercentBonus:ANTIFIGHTER:CapitalShip 0.0
        DamagePercentBonus:ANTIFIGHTER:VeryLight 2.0
        DamagePercentBonus:ANTIFIGHTER:Light 0.0
        DamagePercentBonus:ANTIFIGHTER:Medium 0.0
        DamagePercentBonus:ANTIFIGHTER:Heavy 0.0
        DamagePercentBonus:ANTIFIGHTER:VeryHeavy 0.0
        DamagePercentBonus:ANTIFIGHTER:Module 0.0
End of quote

 

it should not attack anything else first at this point. of course, i have never tried this.

 

also, what is the "buffInstantActionType"? does that have something to do with it? i have noticed that some abilities i create don't work properly until i change this property.

Reply #7 Top

why not add the ability "AbletoTagetFighter" to true or something like that

Reply #8 Top

the code from the phase antifighter frigate is

Weapon
    WeaponType "Missile"
    damageEnums
        AttackType "ANTIVERYLIGHT"
        DamageAffectType "AFFECTS_SHIELDS_AND_HULL"
        DamageApplyType "BACKLOADED"
        DamageType "PHYSICAL"
        WeaponClassType "PHASEMISSILE"
    DamagePerBank:FRONT 24.500000
    DamagePerBank:BACK 24.500000
    DamagePerBank:LEFT 24.500000
    DamagePerBank:RIGHT 24.500000
    Range 3250.000000

as you can see it uses attack type 'ANTIVERYLIGHT' which from what I understand from reading most of the threads & REMEMBERING them it targets all craft that use VERYLIGHT armour ie fighters & bombers and can also damage light armour as well

harpo

Reply #9 Top

Yes, that would be an easy way to do it but would require all antilight weaponry to not do damage. Also annoying I suspect because it would target those ships just not do any damage.

Reply #10 Top

The AttackType does not matter. Any damage type can hurt fighters/bombers, some are just better at it than others. 

However, a weapon with a damage value of zero cannot fire.  You need to have it do SOME damage. 0.01 is enough, even.  You can't limit it to just fighters that way though.

If you want to do an anti-fighter-only weapon it needs to be a pure ability, not an ability linked to a weapon.

 

 

Reply #11 Top

Quoting harpo99999, reply 1
have you tried the ANTIVERYLIGHT type?

harpo

 
End of harpo99999's quote

I have set the attacktype already to "ANTILIGHT" as is indicated in the original post, however the guns will still target other ships, just do less damage then they will fighters.  While this is useful, not exactly what I was looking for.   I will try the ANTIVERYLIGHT damage type to see if there is any significant change.  Though I suspect I will only see a 10% increase in damage to the interceptor as indicated in the gameplay.constants (still a better option then what I have set already though, not quite sure why I didn't set it this way initially). 

 DamageData
  ChanceToHitTargetType:ANTIVERYLIGHT
   CAPITALSHIP 1.00000
   INTERCEPTOR 0.750000
   BOMBER 0.750000
  ChanceToHitTargetType:ANTILIGHT
   CAPITALSHIP 1.00000
   INTERCEPTOR 0.650000
   BOMBER 0.75

I could setup a different attack type with a 0 damage to other ships, but that doesn't mean that the guns would not target those ships and try to kill them even though it cannot damage it (as carbon has indicated further up)

Quoting Mooster, reply 7
why not add the ability "AbletoTagetFighter" to true or something like that
End of Mooster's quote

This is already done per the original post (see line 3)

Quoting EvilTesla-RG, reply 2
Have you read Ironclads Introduction to modding? If not, I sugest you do.  
End of EvilTesla-RG's quote

As already indicated, please re-read the initial post where I already describe changing the abilities files correctly. :S  

Thanks for the replies so far.  Glad to see I was not missing something obvious.

Again I really wish that per each damage type you could set additional constraints and an order of priority to help better manipulate the AI.  Overall though modding this game has brought many hours of additional enjoyment to the game!

Reply #12 Top

Quoting harpo99999, reply 8
the code from the phase antifighter frigate is

Weapon
    WeaponType "Missile"
    damageEnums
        AttackType "ANTIVERYLIGHT"
        DamageAffectType "AFFECTS_SHIELDS_AND_HULL"
        DamageApplyType "BACKLOADED"
        DamageType "PHYSICAL"
        WeaponClassType "PHASEMISSILE"
    DamagePerBank:FRONT 24.500000
    DamagePerBank:BACK 24.500000
    DamagePerBank:LEFT 24.500000
    DamagePerBank:RIGHT 24.500000
    Range 3250.000000

as you can see it uses attack type 'ANTIVERYLIGHT' which from what I understand from reading most of the threads & REMEMBERING them it targets all craft that use VERYLIGHT armour ie fighters & bombers and can also damage light armour as well

harpo
End of harpo99999's quote

It looks as this is the case.  I see the "anti-fighter" guns now attacking fighters & bombers first, I have yet to see them attack any other ships.  Thx Harpo.