ChanceToIgnoreShields

I have a certain weapon in my mod that has the ability to pass through shields.  Unlike the phase missile, this weapon is acquired near the end of the research tree and is just a modification of another weapon type that is available from the game's beginning.  Further still, it's only available to a select few ship types with access to the original weapon.  For example, ships A, B, C, E, and G all have access to weapon 1.  Only ships B and G will gain access to the modified warhead that penetrates shields, however. 

As I currently have set up, I would ideally like it to be a at-will ability so the ships can apply to shield-penetrating warheads when needed and then revert to the stock torpedoes the rest of the time.  My issue is that I can't get the modified weapon to penetrate an enemy ship's shields.  I've tried many different variations that involve applying the "ChancetoIngoreShieldsAsDamageTarget" as the Defeat Shields ability uses in combination with  "ApplyBuffToTargetOnWeaponFired".  Obviously, I didn't have any luck with that attempt.

My current strategy switches the buff to my ship using "ChanceToIgnoreShieldsAsDamageDealer".  I've tried several different finishing conditions to make sure the buff is active when needed, I've tried adjusting the percentage on the entity modifier, and I've doubled checked the ship entity file to make sure everything is in order.  I'm hoping there's just a tiny detail that I missed somewhere, but I'd really appreciate any kind of help.

Here are my current entity files.  They are still in a testing stage, so include references to stock icons and such.

TXT
entityType "Ability"
buffInstantActionType "ApplyOrRemoveBuffToSelf"
instantActionTriggerType "AlwaysPerform"
buffType "BuffTransphasicWarhead"
effectInfo
    effectAttachInfo
        attachType "Invalid"
    smallEffectName ""
    largeEffectName ""
    soundID ""
toggleStateOnNameStringID ""
toggleStateOnDescStringID ""
needsToFaceTarget FALSE
canCollideWithTarget TRUE
moveThruTarget FALSE
isUltimateAbility FALSE
maxNumLevels 3
levelSourceType "Intrinsic"
minExperienceLevelRequired
    Level:0 0.000000
    Level:1 2.000000
    Level:2 4.000000
aiUseTime "OnlyInCombat"
aiUseTargetCondition "Any"
isAutoCastAvailable TRUE
isAutoCastOnByDefault FALSE
pickRandomPlanetToExploreForAutoCastTarget FALSE
ignoreNonCombatShipsForAutoCastTarget TRUE
onlyAutoCastWhenDamageTakenExceedsPerc 0.000000
useCostType "AntiMatter"
antiMatterCost
    Level:0 25.000000
    Level:1 25.000000
    Level:2 25.000000
cooldownTime
    Level:0 0.000000
    Level:1 0.000000
    Level:2 0.000000
orderAcknowledgementType "ONGENERALORDERISSUED"
researchPrerequisites
    NumResearchPrerequisites 0
nameStringID "IDS_ABILITY_NANONANODISRUPTOR_NAME"
descStringID "IDS_ABILITY_NANONANODISRUPTOR_DESCRIPTION"
hudIcon "HUDICON_ABILITY_NANODISRUPTOR"
smallHudIcon "HUDICON_ABILITY_NANODISRUPTOR"
infoCardIcon ""

TXT
entityType "Buff"
onReapplyDuplicateType "PrioritizeNewBuffs"
buffStackingLimitType "ForAllPlayers"
stackingLimit 1
allowFirstSpawnerToStack
buffExclusivityForAIType "ExclusiveForAllPlayers"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 1
instantAction
    buffInstantActionType "ApplyBuffToSelf"
    instantActionTriggerType "OnWeaponFired"
    numWeaponClasses 1
    weaponClassForWeaponPassive "PHASEMISSILE"
    passiveWeaponEffectChance
        Level:0 1.000000
        Level:1 1.000000
        Level:2 1.000000
    buffType "BuffTransphasicShift"
    effectInfo
        effectAttachInfo
            attachType "Invalid"
        smallEffectName ""
        largeEffectName ""
        soundID ""
numPeriodicActions 0
numOverTimeActions 0
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 0

 

TXT
entityType "Buff"
onReapplyDuplicateType "PrioritizeNewBuffs"
buffStackingLimitType "ForAllPlayers"
stackingLimit 1
allowFirstSpawnerToStack FALSE
buffExclusivityForAIType "ExclusiveForAllPlayers"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 0
numPeriodicActions 0
numOverTimeActions 0
numEntityModifiers 1
entityModifier
    buffEntityModifierType "ChanceToIgnoreShieldsAsDamageDealer"
    value
        Level:0 1.000000
        Level:1 1.000000
        Level:2 1.000000
numEntityBoolModifiers 0
numFinishConditions 1
finishCondition
    finishConditionType "LastSpawnerNoLongerHasBuff"
    buffTypeToQuery "BuffTransphasicWarhead"

5,914 views 7 replies
Reply #1 Top

Sorry, I'm at work and can't test anything, but I have a couple of comments/questions.

The ability is setup with a 25 AntiMatter cost with an instant action to apply the buff on weapon fired. Is it possible the BuffTransphasicWarhead is finished prior to any onWeaponFiredFired event occuring due the lack of a duration?

Does this work when the ability is changed to a passive versus anti-matter for useCostType? If so, maybe it is a timing issue.

You mentioned you tried various finish conditions on BuffTransphasicShift. Did you try adding a cooldown time on the ability and duration on the secondary buff to basically give you time to apply the passiveWeaponEffectChance?

My thinking is if the weapon has a cooldown time of 6.5 seconds and your ability and buff has a duration of 10 seconds for example this would give you time to fire one volley with the passive buff in place.

Just some thoughts, sorry I can't test them.

Reply #2 Top

Thanks for the response!  I had the same thought at first, actually.  The buff would appear for an instant and then be gone.  I've now changed the finish condition to antimatter depletion, with the result that both buffs now remain active after initially firing the weapon.  Unfortunately, there's still no shield penetration.

Changing the ability to passive (and changing the buff type to ApplyBufftoSelf) created an odd error where the buff kept being applied and removed, even outside of a battle situation, and the ship itself would stop moving.  I didn't want to take the time to figure out what was going on there since I don't want it to be a passive ability anyway, so I scrapped that. 

 

Edit:  Turns out that I needed the base IgnoreShield research subject in my faction's research tree.  Go figure...  I'll have to work through whether I want to add the transphasic part of the ability through the research itself while making it toggle-able in an ability, or simply add a 0% ignore shield chance for the weapon class with research and then use the ability to increase that to 100%.

A final question though:  Obviously, my understanding of the "ChanceToIgnoreShields" entity modifiers is wrong.  What does it do if not allow a weapon class to puncture through shields?

 

 

Reply #3 Top

It only works on phasemissile weapons, also change the PrioritizeNewBuffs to PrioritizeOldBuffs.

Another thing, why have you made it so that the ignore buff is only added after the weapon is fired? If you just want it to ignore shields when activated then remove BuffTransphasicWarhead and make the ability refer to BuffTransphasicShift with no finishconditions.

Reply #4 Top

I got it figured out a few days ago, but thanks.  I had the weapon class set to phase missile, but it required the base phase missile research, which is what initially allows phase missiles to ignore shields.   Without the research no amount of percentage increase was going to cause the torpedoes to ignore shields.

It's set to activate on a specific weapon firing because I don't want every weapon to penetrate the shields.  This is the only way to specify a weapon type, and it doesn't activate after the weapon is fired but when it is fired.  This ensures that the torpedoes fired when the ability is active penetrate shields while no other weapons do. 

I can look into removing the first buff, but that will force me to use the "OnWeaponFired" trigger in the ability file.  I've never seen that used for an ability activation (only a buff), but I'll give it a try. 

As it stands, the ability works perfectly and as intended.

 

Reply #5 Top

Not sure if this is useful, but you can make weapons and abilities affect only shields or only hull all of the time quite easily- just change the damage type to AFFECTS_ONLY_HULL or AFFECTS_ONLY_SHIELDS.

Reply #6 Top

Yeah, I tried that approach.  Unfortunately, weapons set to AFFECTS_ONLY_HULL have absolutely no effect if shields are still present, and weapons set to AFFECTS_ONLY_SHIELDS obviously has not effect on a hull once shields are gone.

Thanks for the helpful offer, though.  As I said, it was just a matter of giving the faction the necessary research that enabled the "phase" part of phase missiles.  Once I had done that, everything worked as intended.

Reply #7 Top

Quoting Mystic, reply 6
Yeah, I tried that approach.  Unfortunately, weapons set to AFFECTS_ONLY_HULL have absolutely no effect if shields are still present...

That doesn't sound right. The damage type is used by the Jarrasul Nano-Disassembler, so for buffs at least it goes right through shields, with devastating effects. I just tried it with a scout set to AFFECTS_ONLY_HULL damage and amount of 180 (7 second cooldown), killed a Krosov within seconds, no damage to shields.

Edit: Only one problem with this: You can't change the weapon damage type on the fly, so you must either have the ships start with it or add it as an ability that deals a fixed amount of damage. Technically you can make 5 abilities that do this, with 3 levels each, allowing you a maximum of 15 "upgrade levels" on a ship with 0 actual abilities. Be careful though, you must limit each individual "weapon damage upgrade" research to 3 levels max, as that is the max ability level.