Making Abilities Cost Resources - How To (please help)

Hi,

 

I would like to make an ability that costs resources. Can anyone help me do this?  Let's use "ABILITYREPAIRPLATFORMTEC"

 

TXT
entityType "Ability"
buffInstantActionType "ApplyBuffToTarget"
instantActionTriggerType "AlwaysPerform"
buffType "BuffRepairPlatformTech"
targetFilter
 numOwnerships 1
 ownership "Friendly"
 numObjects 4
 object "CapitalShip"
 object "Frigate"
 object "PlanetModule"
 object "StarBase"
 numSpaces 1
 space "Normal"
 numConstraints 2
 constraint "NotSelf"
 constraint "HasHullDamage"
range
 Level:0 12000.000000
 Level:1 12000.000000
 Level:2 12000.000000
effectInfo
 effectAttachInfo
  attachType "Ability"
  abilityIndex 0
 smallEffectName "Ability_RepairPlatformTechActivate"
 largeEffectName "Ability_RepairPlatformTechActivate"
 soundID "EFFECT_REPAIR_TECH"
needsToFaceTarget FALSE
canCollideWithTarget TRUE
moveThruTarget FALSE
isUltimateAbility FALSE
maxNumLevels 3
levelSourceType "ResearchWithBase"
baseSourceResearchSubject "RESEARCHSUBJECT_PLANETMODULEACCESS_REPAIRPLATFORMTECH"
improveSourceResearchSubject "RESEARCHSUBJECT_PLANETMODULEIMPROVEMENT_TECHREPAIRPLATFORM"
aiUseTime "Anytime"
aiUseTargetCondition "HullDamageExceedsAmount"
onlyAutoCastWhenTargetHullDamageExceedsAmount
 Level:0 100.000000
 Level:1 150.000000
 Level:2 200.000000
isAutoCastAvailable TRUE
isAutoCastOnByDefault TRUE
pickRandomPlanetToExploreForAutoCastTarget FALSE
ignoreNonCombatShipsForAutoCastTarget TRUE
onlyAutoCastWhenDamageTakenExceedsPerc 0.000000
useCostType "AntiMatter"
antiMatterCost
 Level:0 20.000000
 Level:1 20.000000
 Level:2 20.000000
cooldownTime
 Level:0 6.000000
 Level:1 6.000000
 Level:2 6.000000
orderAcknowledgementType "ONGENERALORDERISSUED"
researchPrerequisites
 NumResearchPrerequisites 1
 ResearchPrerequisite
  Subject "RESEARCHSUBJECT_PLANETMODULEACCESS_REPAIRPLATFORMTECH"
  Level 1
nameStringID "IDS_SUPPORTABILITY_REPAIRTECHPLANETMODULE_NAME"
descStringID "IDS_SUPPORTABILITY_REPAIRTECHPLANETMODULE_DESCRIPTION"
hudIcon "HUDICON_SUPPORTABILITY_REPAIRTECHPLANETMODULE"
smallHudIcon "HUDICON_SUPPORTABILITY_REPAIRTECHPLANETMODULE"
infoCardIcon ""

 

BUFF

REPAIRPLATFORMTECH

TXT
entityType "Buff"
onReapplyDuplicateType "PrioritizeNewBuffs"
buffStackingLimitType "ForAllPlayers"
stackingLimit 1
allowFirstSpawnerToStack FALSE
buffExclusivityForAIType "ExclusiveForAllPlayers"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 0
numPeriodicActions 0
numOverTimeActions 1
overTimeAction
 buffOverTimeActionType "RestoreHull"
 hullRestoreRate
  Level:0 20.000000
  Level:1 30.000000
  Level:2 40.000000
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 2
finishCondition
 finishConditionType "TimeElapsed"
 time
  Level:0 10.000000
  Level:1 10.000000
  Level:2 10.000000
finishCondition
 finishConditionType "OwnerChanged"

12,959 views 9 replies
Reply #1 Top

Is it as simple as changing:

 

useCostType "AntiMatter"
antiMatterCost
 Level:0 20.000000
 Level:1 20.000000
 Level:2 20.000000

 

to

 

useCostType "Resources"
antiMatterCost
 Level:0 Credits: 200.000000

Metal: 10.000000

Crystal: 5.000000


 Level:1 Credits: 200.000000

Metal: 10.000000

Crystal: 5.000000
 Level:2 Credits: 200.000000

Metal: 10.000000

Crystal: 5.000000

Reply #2 Top

:)  very cool, thank you for the tip!! 

-Teal

 

Reply #3 Top

Is it as simple as changing
End of quote

Just look at AbilityFleetBeacon and its buff files. I think that's the name of Returning Armada. It'll have resource usage. I don't have 1.1 files here at work :P

+1 Loading…
Reply #4 Top

What about changing the vasari explosive mines to do damage as a phaes missle style - sometiems bypassing shields?

my solution kept causing a minidump :)

Reply #5 Top

Sweet. Thanks Annatar. I couldn't figure out what ability used resources.

Reply #6 Top

Quoting k33bz, reply 4
my solution kept causing a minidump
End of k33bz's quote

That's how you know it works!

;)

Fairly awesome mine that can actually "damage" the computer, though.  :)

Reply #7 Top

What about changing the vasari explosive mines to do damage as a phaes missle style - sometiems bypassing shields?
End of quote

I don't think there's a clean way of doing it. You can make the ability have an OnChance to do hull damage bypassing shields, but to my knowledge you can't guarantee Shields or Hull but never both. You can do always shields and sometimes hull, or sometimes hull sometimes shields and sometimes both :P

Reply #8 Top

Well I was trying to figure out how the phase missles worked for the LRM and the likes - basically I feel that the explosive mine should be nothing more than a rocket launcher floating in space with a payload of say 6 missles and a short range

that way upto 6 target can be hit, the more ships nearby the less damage spread out - and 6 beefy phase missles say 500 dam each should do the trick - 1 ship would be toast but 6 ships shoudl skate by fine

at least it seemed like something the vasari would do

i tried replaceing the stuff from the frm damage into the mine and making it missle damage but well that didn't work. short of creating a new weapon inside the mine (i havn't learned enough on how the entity fiels work yet) im not sure how to replace the explode to be 6 missles.

Reply #9 Top

The two aren't compatible. The conventional weapons get modified through research. But this can't apply to mines because they detonate as an ability and it's a simple "DoDamage" - you can't assign any weapon properties to an ability, so you can't make it behave like a phase missile.