Buff Pickiness Problems (attached example code)

After having some lucky success with making abilities actually work (and not minidump), I ran into a problem that makes no sence.

   I'm trying to do a simple conversion of one of my working abilities:

   The design is that the fleet ships have the ability infrastructure built in, but the power for those abilities comes form the base (sort of like the Starwars Droid Command Center, but not so extreme)

   The attached code works, but gives antimatter to the fleet.
  It should drain the fleet's antimatter when the base explodes...


AbilityEntokEnable.Entity

TXT
entityType "Ability"
buffInstantActionType "ApplyBuffToTargetsInRadius"
instantActionTriggerType "AlwaysPerform"
buffType "BuffEntokEnable"
targetFilter
    numOwnerships 1
    ownership "Friendly"
    numObjects 2
    object "CapitalShip"
    object "Frigate"
    numConstraints 1
    constraint "HasAntiMatterShortage"
range
    Level:0 50000.000000
    Level:1 50000.000000
    Level:2 50000.000000
maxTargetCount
    Level:0 -1.000000
    Level:1 -1.000000
    Level:2 -1.000000
effectInfo
    effectAttachInfo
        attachType "Center"
    smallEffectName "CapitalAbility_AntiMatterRestoreActivate"
    largeEffectName "CapitalAbility_AntiMatterRestoreActivate"
    soundID "EFFECT_ANTIMATTERRECHARGE"
needsToFaceTarget FALSE
canCollideWithTarget TRUE
moveThruTarget FALSE
isUltimateAbility FALSE
maxNumLevels 1
levelSourceType "Intrinsic"
minExperienceLevelRequired
    Level:0 0.000000
    Level:1 0.000000
    Level:2 0.000000
aiUseTime "Anytime"
aiUseTargetCondition "Any"
isAutoCastAvailable TRUE
isAutoCastOnByDefault TRUE
pickRandomPlanetToExploreForAutoCastTarget FALSE
ignoreNonCombatShipsForAutoCastTarget TRUE
onlyAutoCastWhenDamageTakenExceedsPerc 0.000000
isPassive FALSE
antiMatterCost
    Level:0 0.000000
    Level:1 0.000000
    Level:2 0.000000
cooldownTime
    Level:0 0.000000
    Level:1 0.000000
    Level:2 0.000000
researchPrerequisites
    NumResearchPrerequisites 0
nameStringID "IDS_ABILITY_ANTIMATTERRESTORE_NAME"
descStringID "IDS_ABILITY_ANTIMATTERRESTORE_DESCRIPTION"
hudIcon "HUDICON_ABILITY_ANTIMATTERRESTORE"
smallHudIcon "HUDICON_ABILITY_ANTIMATTERRESTORE"
infoCardIcon ""


BuffEntokEnable.Entity

TXT
entityType "Buff"
onReapplyDuplicateType "StackNewBuff"
buffExclusivityForAIType "NotExclusive"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 1
instantAction
    buffInstantActionType "RestoreAntiMatter"
    instantActionTriggerType "OnDelay"
    delayTime 0.000000
    antiMatter
        Level:0 20.000000
        Level:1 20.000000
        Level:2 20.000000
    effectInfo
        effectAttachInfo
            attachType "Aura"
        smallEffectName ""
        largeEffectName ""
        soundID ""
numPeriodicActions 0
numOverTimeActions 0
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 1
finishCondition
    finishConditionType "AllOnDelayInstantActionsDone"


**********************************************************************************
   These are the changes I made to it:



AbilityEntokDisable.Entity

TXT
entityType "Ability"
buffInstantActionType "ApplyBuffToTargetsInRadius"
instantActionTriggerType "OnOwnerDeath"
buffType "BuffEntokDisable"
targetFilter
    numOwnerships 1
    ownership "Friendly"
    numObjects 2
    object "CapitalShip"
    object "Frigate"
    numConstraints 1
    constraint "HasAntiMatterPool"
range
    Level:0 50000.000000
    Level:1 50000.000000
    Level:2 50000.000000
maxTargetCount
    Level:0 -1.000000
    Level:1 -1.000000
    Level:2 -1.000000
effectInfo
    effectAttachInfo
        attachType "Center"
    smallEffectName ""
    largeEffectName ""
    soundID ""
needsToFaceTarget FALSE
canCollideWithTarget TRUE
moveThruTarget FALSE
isUltimateAbility FALSE
maxNumLevels 1
levelSourceType "Intrinsic"
minExperienceLevelRequired
    Level:0 0.000000
    Level:1 0.000000
    Level:2 0.000000
aiUseTime "Invalid"
aiUseTargetCondition "Invalid"
isAutoCastAvailable FALSE
isAutoCastOnByDefault FALSE
pickRandomPlanetToExploreForAutoCastTarget FALSE
ignoreNonCombatShipsForAutoCastTarget TRUE
onlyAutoCastWhenDamageTakenExceedsPerc 0.000000
isPassive TRUE
researchPrerequisites
    NumResearchPrerequisites 0
nameStringID "IDS_ABILITY_ANTIMATTERRESTORE_NAME"
descStringID "IDS_ABILITY_ANTIMATTERRESTORE_DESCRIPTION"
hudIcon "HUDICON_ABILITY_ANTIMATTERRESTORE"
smallHudIcon "HUDICON_ABILITY_ANTIMATTERRESTORE"
infoCardIcon ""


BuffEntokDisable.Entity

TXT
entityType "Buff"
onReapplyDuplicateType "StackNewBuff"
buffExclusivityForAIType "NotExclusive"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 1
instantAction
    buffInstantActionType "RemoveAntiMatter"
    instantActionTriggerType "OnDelay"
    delayTime 0.000000
    antiMatter
        Level:0 20.000000
        Level:1 20.000000
        Level:2 20.000000
    effectInfo
        effectAttachInfo
            attachType "Aura"
        smallEffectName ""
        largeEffectName ""
        soundID ""
numPeriodicActions 0
numOverTimeActions 0
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 1
finishCondition
    finishConditionType "AllOnDelayInstantActionsDone"



It should work...   ...unless of course there is some kind of formatting error (I tried several variations, and it seems to stick on the  "OnOwnerDeath" condition, but that's the point of the ability, to undo the base's power when it explodes...

   Please point me in the right direction :)



  

  
5,790 views 2 replies
Reply #1 Top
Hey Helioforge,

Apparently "OnOwnerDeath" can be used as a trigger type for buffs but not for abilities. What you will need to do is to have the ability constantly putting a buff on itself - the buff can have an action with the "OnOwnerDeath" condition, which when triggered will apply a second buff to nearby ships which actually removes the antimatter.
+1 Loading…
Reply #2 Top
COOL (well, it's cool that I can fix it) :CONGRAT:

thanks so much, the local militias thank you, (well, they dont really, as it makes them less powerful, but that's tough for the local militias :NOTSURE: