Trouble with restore buff

I want to make an ability that constantly restores another ship's antimatter reserves while draining the ship's own. Obviously once the ship's own runs out, the ability will cease. However, every time it runs, the buff lasts for a fraction of a second on the target, while the drain seemingly keeps going on the ship with the ability. Help?

Ability file:

TXT
entityType "Ability"
buffInstantActionType "ApplyTargettedBuffToSelf"
instantActionTriggerType "AlwaysPerform"
buffType "BuffPowerRestoreCaster"
targetFilter
    numOwnerships 1
    ownership "Friendly"
    numObjects 2
    object "Frigate"
    object "CapitalShip"
    numConstraints 2
    constraint "HasAntiMatterShortage"
    constraint "NotSelf"
range
    Level:0 2000.000000
    Level:1 0.000000
    Level:2 0.000000
effectInfo
    effectAttachInfo
        attachType "Invalid"
    smallEffectName ""
    largeEffectName ""
    soundID "EFFECT_TRANSFERANTIMATTER"
needsToFaceTarget FALSE
canCollideWithTarget TRUE
moveThruTarget FALSE
isUltimateAbility FALSE
maxNumLevels 1
levelSourceType "FixedLevel0"
aiUseTime "Anytime"
aiUseTargetCondition "IsDifferentRoleType"
isAutoCastAvailable TRUE
isAutoCastOnByDefault TRUE
pickRandomPlanetToExploreForAutoCastTarget FALSE
ignoreNonCombatShipsForAutoCastTarget TRUE
onlyAutoCastWhenDamageTakenExceedsPerc 0.000000
useCostType "AntiMatter"
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_POWERRESTORE_NAME"
descStringID "IDS_ABILITY_POWERRESTORE_DESCRIPTION"
hudIcon "HUDICON_ABILITY_TRANSFERANTIMATTER"
smallHudIcon "HUDICON_ABILITY_TRANSFERANTIMATTER"
infoCardIcon ""

Caster file:

TXT
entityType "Buff"
onReapplyDuplicateType "ReplaceWithNewBuff"
buffExclusivityForAIType "ExclusiveForAllPlayers"
isInterruptable TRUE
isChannelling FALSE
numInstantActions 2
instantAction
    buffInstantActionType "PlayPersistantAttachedEffect"
    instantActionTriggerType "OnDelay"
    delayTime 0.000000
    effectInfo
        effectAttachInfo
            attachType "Ability"
            abilityIndex 0
        smallEffectName "Buff_TransferAntiMatterChanneling"
        largeEffectName "Buff_TransferAntiMatterChanneling"
        soundID "EFFECT_TRANSFERANTIMATTER"
instantAction
    buffInstantActionType "ApplyBuffToTargetNoFilterNoRange"
    instantActionTriggerType "OnDelay"
    delayTime 0.000000
    buffType "BuffPowerRestoreTarget"
numPeriodicActions 0
numOverTimeActions 1
overTimeAction
    buffOverTimeActionType "DrainAntiMatter"
    drainAntiMatterRate
        Level:0 5.000000
        Level:1 0.000000
        Level:2 0.000000
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 1
finishCondition
    finishConditionType "AntiMatterDepleted"

Target file:

TXT
entityType "Buff"
onReapplyDuplicateType "ReplaceWithNewBuff"
buffExclusivityForAIType "ExclusiveForAllPlayers"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 1
instantAction
    buffInstantActionType "PlayPersistantAttachedEffect"
    instantActionTriggerType "OnDelay"
    delayTime 0.000000
    effectInfo
        effectAttachInfo
            attachType "Above"
        smallEffectName "Buff_TransferAntiMatterTarget"
        largeEffectName "Buff_TransferAntiMatterTarget"
        soundID ""
numPeriodicActions 0
numOverTimeActions 1
overTimeAction
    buffOverTimeActionType "RestoreAntiMatter"
    antiMatterRestoreRate
        Level:0 3.000000
        Level:1 0.000000
        Level:2 0.000000
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 2
finishCondition
    finishConditionType "FirstSpawnerNoLongerHasBuff"
    buffTypeToQuery "BuffPowerRestoreCaster"
finishCondition
    finishConditionType "OutOfRange"

edit: well I tweaked a few things and now it works, I'm not quite sure how I did it, though :|

edit 2: looks like it was the OutOfRange condition. is this a bug with the buff system? OutOfRange seems to always return true, whether on caster or target, in range or not. is there a better way to do this to keep the caster in range?

5,022 views 2 replies
Reply #1 Top

not sure, "Out of Range" has always worked for me.

Does it apply when RIGHT on the line of being in range, then the ships move a little?

 

Maby it has to do with the "Apply Buff to target No filter NO RANGE"

Admitidly that seems strange due to the range being set by the ability, but it is possible.

Reply #2 Top

Yeah, that's probably it, I never even looked to see what buffInstantActionType I was using, I'll try messing around with that. Just don't want it to be able to dump antimatter into the other ship from all the way across the gravity well.

And if I have the outofrange thing on, it fails within a second (probably at the first 'tick'), just applying for that minute amount of time.

Now I have to figure out some way to get autocast to work on this..the computer likes to cast it every second since it has no cooldown :)