Ability Creation - Assistance required

Capturing Neutrals and Spawning Starbases

How would you go about making a capture neutral ability that spawns a starbase. It needs to also be restricted by the starbase maximum.

 

We've tried combining the two abilities and buffs but we get an error. I'll post it here if needed, I just don't have the error on file now. I believe it was generic.

 

TXT

entityType "Buff"

onReapplyDuplicateType "PrioritizeNewBuffs"

buffStackingLimitType "ForAllPlayers"

stackingLimit 1

allowFirstSpawnerToStack FALSE

buffExclusivityForAIType "ExclusiveForAllPlayers"

isInterruptable FALSE

isChannelling FALSE

numInstantActions 2

instantAction

buffInstantActionType "ChangePlayerIndexToFirstSpawner"

instantActionTriggerType "OnDelay"

delayTime 0.000000

instantAction

buffInstantActionType "CreateStarBase"

instantActionTriggerType "OnDelay"

delayTime 0.000000

starBaseType "StarBaseColony"

placementRadius

Level:0 1000.000000

Level:1 1000.000000

Level:2 1000.000000

numPeriodicActions 0

numOverTimeActions 0

numEntityModifiers 0

numEntityBoolModifiers 0

numFinishConditions 1

finishCondition

finishConditionType "AllOnDelayInstantActionsDone"

 

 

19,073 views 29 replies
Reply #1 Top

what does the error say?

Reply #2 Top

I don't have access to it on my laptop so I'll have to get it later. It was na @Assert error. Mostly referring to the starbase and it's spawning.

 

Really sorry I can't get the error now.

Reply #3 Top

I created a new buff in Entrenchment. I get no errors, but it also does nothing but capture the neutral entity. No starbase is spawned and no error occurs. It just ignores the second instant action.

 

 

TXT

entityType "Buff"

onReapplyDuplicateType "PrioritizeNewBuffs"

buffStackingLimitType "ForAllPlayers"

stackingLimit 1

allowFirstSpawnerToStack FALSE

buffExclusivityForAIType "ExclusiveForAllPlayers"

isInterruptable FALSE

isChannelling FALSE

numInstantActions 2

instantAction

buffInstantActionType "ChangePlayerIndexToFirstSpawner"

instantActionTriggerType "OnDelay"

delayTime 0.000000

instantAction

buffInstantActionType "CreateStarBase"

instantActionTriggerType "AlwaysPerform"

starBaseType "StarBaseImp"

placementRadius

Level:0 1000.000000

Level:1 1000.000000

Level:2 1000.000000

numPeriodicActions 0

numOverTimeActions 0

numEntityModifiers 0

numEntityBoolModifiers 0

numFinishConditions 1

finishCondition

finishConditionType "AllOnDelayInstantActionsDone"

 

Reply #4 Top

Might be because of the trigger, try and set it to OnDelay.

Reply #5 Top

I'll see if that works. Thanks!

Reply #6 Top

I've explored using the CreateStarbase line a couple of times without success (to my own bemusement), but looking through the files to find an answer to your question, it may have to do with the fact that the stock ability is just that: a single ability with no buff.  I'm guessing the problem has to do with your buffInstantActionType line in the Ability file, which is probably ApplyBuffToTarget.  This is filtering down to the Starbase creation buff, and that's what I'm betting is the problem.

Without looking through the list of modifers I'm not sure what to suggest at the moment, but I'll take a look.

Reply #7 Top

That would be so awesome Mystic Angel. I'm really stumped on this one and it's critical to the mod.


Really appreciate it.

Reply #8 Top

Here's a thought that works out in my head without any testing:

Ability (ApplyBufftoSelf)

\/

Buff 1 (2 buffInstantActiontypes)

\/

buffInstantActionType "ApplyBufftoSelf" > Buff 2a (buffInstantActionType "CreateStarbase")

&

bufInstantActionType"ApplyBufftoTarget" > Buff 2b (buffInstantActionType "ChangePlayerIndextoFirstSpawner")

 

Now, the CreateStarbase uses AlwaysPerform in the stock files, so I'd stick with that.  I also extended the desired action it to a 2nd level sub-buff because I didn't want it to finish out before the capturing buff, which has to go through the 2nd level sub-buff.  You could always try replacing the 2nd ApplyBufftoSelf with CreateStarbase and see what it does, especially if you want to experiment with OnDelay, but it's up to you. 

Like I said, this is totally theoretically and should would work with nearly any other instant action types, but I'm just not sure about CreateStarbase.  Good luck with it!

 

P.S.  I'd love to hear some other ideas that people might have, because I'm always looking for cutting edge ability/buff set-ups to incorporate into my own mod.

Reply #9 Top

You may have done this but just in case you haven't. Have you writen in the "creationSourceAbility" line of the star base's entity file the name of the ability you are creating?

Reply #10 Top

Quoting SuperZERO0, reply 9
You may have done this but just in case you haven't. Have you writen in the "creationSourceAbility" line of the star base's entity file the name of the ability you are creating?
End of SuperZERO0's quote

That's actually a good tip.  Make sure that's set correctly before you try messing around with what I posted earlier.

With that said, however, the success of such a change would depend entirely on the function of the starbase you're trying to create with the ability.  For instance, is this the same type of starbase as the race's normal one?  If so, I bet you'll need an entirely different entity file just for a different creationSourceAbility line.  Which then might lead to other problems, like whether it'll work because the player entity file actually specifies the race's starbase type (a single type, unfortunately).

If it's a different starbase, then there shouldn't be a problem.

Reply #11 Top

@OP- also, you don't need to change the player index to the 1st spawner. When an SB is spawned, it is automatically set to be indexed to the player who spawned it.

Reply #12 Top

Here's the error I get:

 

Assert @ c:\gs\entrenchment\CodeSource\GS/Entity/EntitySystemHelpers.cpp(678)

 

sourceAbility->GetIAbilityPtr()->GetDef()->m_buffApplyAction.buffInstantActionType == BuffInstantActionType::CreateStarBase

Reply #13 Top

 

Assert @ c:\gs\entrenchment\CodeSource\GS/Entity/EntitySystemHelpers.cpp(679)

 

starBaseName == sourceAbility->GetIAbilityPtr()->GetDef()->m_buffApplyAction.entityTypeToCreate

 

These happen when loading the mod only. When I try to use the ability nit captures the neutral extractor and nothing else. This is after changing the creationSourceAbility

 

Reply #14 Top

 

Assert @ c:\gs\entrenchment\CodeSource\GS/Entity/Interfaces/IBuff.cpp(4405)

 

allStarBases.Find(def.entityTypeToCreate) != allStarBases.ConstEnd()

 

 

 

Ok this is the error I get. It's kind of odd because I finally got the starbase to spawn. LOL the weird thing is, it doesn't capture the neutral extractor, it spawns a starbase where the extractor should be AHHAH It's kinda cool.

 

Ability

 

TXT

entityType "Ability"

buffInstantActionType "ApplyBuffToTarget"

instantActionTriggerType "AlwaysPerform"

buffType "BuffInvasionSelf"

targetFilter

numOwnerships 2

ownership "Enemy"

ownership "NoOwner"

numObjects 1

object "PlanetModule"

numSpaces 1

space "Normal"

numConstraints 1

constraint "CanBeCaptured"

 

 

BuffInvasionSelf

 

buffExclusivityForAIType "ExclusiveForAllPlayers"

isInterruptable FALSE

isChannelling FALSE

numInstantActions 2

instantAction

buffInstantActionType "ChangePlayerIndexToFirstSpawner"

instantActionTriggerType "OnDelay"

delayTime 0.000000

instantAction

buffInstantActionType "ApplyBuffToSelf"

instantActionTriggerType "OnDelay"

delayTime 0.000000

buffType "BuffInvasion1"

effectInfo

effectAttachInfo

attachType "Center"

smallEffectName ""

largeEffectName ""

soundID ""

numPeriodicActions 0

numOverTimeActions 0

numEntityModifiers 0

numEntityBoolModifiers 0

numFinishConditions 1

finishCondition

finishConditionType "AllOnDelayInstantActionsDone"

 

 

BuffInvasion1

 

TXT

entityType "Buff"

onReapplyDuplicateType "PrioritizeNewBuffs"

buffStackingLimitType "ForAllPlayers"

stackingLimit 1

allowFirstSpawnerToStack FALSE

buffExclusivityForAIType "ExclusiveForAllPlayers"

isInterruptable FALSE

isChannelling FALSE

numInstantActions 1

instantAction

buffInstantActionType "CreateStarBase"

instantActionTriggerType "OnDelay"

delayTime 0.000000

starBaseType "StarBaseImp"

placementRadius

Level:0 1000.000000

Level:1 1000.000000

Level:2 1000.000000

numPeriodicActions 0

numOverTimeActions 0

numEntityModifiers 0

numEntityBoolModifiers 0

numFinishConditions 1

finishCondition

finishConditionType "AllOnDelayInstantActionsDone"

 

 

I'm testing what happens when it blows up now. LOL this is actually kinda funny. 

 

Reply #15 Top

What if... I changed applyBuffToSelf to ApplyBuffToTargetsInRadius and made the radius small and equal to the range of the capture ability? Then make it Friendly only, 1 target and hopefully it's only ever the caster that is in range.

 

Thoughts?

Reply #16 Top

What have you set as the creationSourceAbility to in the StarBase entity? I think that Have to be either the Ability OR the name of the file (so in this case the buff) that contains the CreateStarBase instant action.

Btw, it might be funny for one ability, but try to imagine roughly 100 each acting this way QQ

Reply #17 Top

I thought it had to be the Ability. I wasn't sure if I had to change the buff. And since it worked with the ability when it was the secondary buff, but maybe now that it's tertiary buff it has to be the buff in the crationsourceability.

 

HAHA I don't know if multiples will cause a crash or only one will initiate the Starbase since only 1 is allowed per gravity well. Either way I'll leave it at 1.

 

The method I described above doesn't seem to work by the way. It only captures the neutral extractor and then nothing. I'll try changing the sourceability.

 

EDIT

 

If the creationSourceAbility is a buff it minidumps on load up

Reply #18 Top

Good luck, I cross fingers for the sake of your, and ours, sanity ;)

Reply #19 Top

I GOT IT!!!!!!!!

Reply #20 Top

CONGATULATIONS!!!!!!!  Now, I personally would like to know exactly what pieces of the puzzle fit where in order for it to work, if you don't mind.

Reply #21 Top

CONGRATULATIONS!!!!!!!  Now, I personally would like to know exactly what pieces of the puzzle fit where in order for it to work, if you don't mind.

Reply #22 Top

AbilityInvasion

TXT

entityType "Ability"

buffInstantActionType "ApplyBuffToTarget"

instantActionTriggerType "AlwaysPerform"

buffType "BuffInvasionSelf"

targetFilter

numOwnerships 2

ownership "Enemy"

ownership "NoOwner"

numObjects 1

object "PlanetModule"

numSpaces 1

space "Normal"

numConstraints 1

constraint "CanBeCaptured"

range

Level:0 1000.000000

Level:1 0.000000

Level:2 0.000000

effectInfo

effectAttachInfo

attachType "Invalid"

smallEffectName ""

largeEffectName ""

soundID ""

needsToFaceTarget TRUE

canCollideWithTarget TRUE

moveThruTarget FALSE

isUltimateAbility FALSE

maxNumLevels 1

levelSourceType "FixedLevel0"

aiUseTime "Anytime"

aiUseTargetCondition "Any"

isAutoCastAvailable TRUE

isAutoCastOnByDefault TRUE

pickRandomPlanetToExploreForAutoCastTarget FALSE

ignoreNonCombatShipsForAutoCastTarget TRUE

onlyAutoCastWhenDamageTakenExceedsPerc 0.000000

useCostType "AntiMatter"

antiMatterCost

Level:0 40.000000

Level:1 0.000000

Level:2 0.000000

cooldownTime

Level:0 60.000000

Level:1 0.000000

Level:2 0.000000

orderAcknowledgementType "ONGENERALORDERISSUED"

researchPrerequisites

NumResearchPrerequisites 0

nameStringID "ABILITY_CAPTURENEUTRALS_NAME"

descStringID "ABILITY_CAPTURENEUTRALS_DESC"

hudIcon "HUDICON_ABILITY_CAPTURENEUTRALENTITY"

smallHudIcon "HUDICON_ABILITY_CAPTURENEUTRALENTITY"

infoCardIcon ""


BuffInvasionSelf


TXT

entityType "Buff"

onReapplyDuplicateType "PrioritizeNewBuffs"

buffStackingLimitType "ForAllPlayers"

stackingLimit 1

allowFirstSpawnerToStack FALSE

buffExclusivityForAIType "ExclusiveForAllPlayers"

isInterruptable FALSE

isChannelling FALSE

numInstantActions 2

instantAction

buffInstantActionType "ApplyBuffToTargetsInRadius"

instantActionTriggerType "OnDelay"

delayTime 0.000000

buffType "BuffInvasion2"

targetFilter

numOwnerships 1

ownership "Friendly"

numObjects 1

object "Frigate"

numSpaces 1

space "Normal"

numConstraints 1

constraint "HasWeapons"

range

Level:0 8000.000000

Level:1 8000.000000

Level:2 8000.000000

maxTargetCount

Level:0 1.000000

Level:1 1.000000

Level:2 1.000000

effectInfo

effectAttachInfo

attachType "Invalid"

smallEffectName ""

largeEffectName ""

soundID ""

instantAction

buffInstantActionType "ChangePlayerIndexToFirstSpawner"

instantActionTriggerType "OnDelay"

delayTime 0.000000

numPeriodicActions 0

numOverTimeActions 0

numEntityModifiers 0

numEntityBoolModifiers 0

numFinishConditions 1

finishCondition

finishConditionType "AllOnDelayInstantActionsDone"

BuffInvasion2
TXT
entityType "Buff"
onReapplyDuplicateType "PrioritizeNewBuffs"
buffStackingLimitType "ForAllPlayers"
stackingLimit 1
allowFirstSpawnerToStack FALSE
buffExclusivityForAIType "ExclusiveForAllPlayers"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 1
instantAction
buffInstantActionType "ApplyBuffToSelf"
instantActionTriggerType "OnDelay"
delayTime 0.000000
buffType "BuffInvasion1"
effectInfo
effectAttachInfo
attachType "Invalid"
smallEffectName ""
largeEffectName ""
soundID ""
numPeriodicActions 0
numOverTimeActions 0
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 1
finishCondition
finishConditionType "AllOnDelayInstantActionsDone"
BuffInvasion1
TXT
entityType "Buff"
onReapplyDuplicateType "PrioritizeNewBuffs"
buffStackingLimitType "ForAllPlayers"
stackingLimit 1
allowFirstSpawnerToStack FALSE
buffExclusivityForAIType "ExclusiveForAllPlayers"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 1
instantAction
buffInstantActionType "CreateStarBase"
instantActionTriggerType "OnDelay"
delayTime 0.000000
starBaseType "StarBaseImp"
placementRadius
Level:0 1000.000000
Level:1 1000.000000
Level:2 1000.000000
numPeriodicActions 0
numOverTimeActions 0
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 1
finishCondition
finishConditionType "AllOnDelayInstantActionsDone"

Sorry 'bout the formatting

Reply #23 Top

Also, something about the starbase is causing a minidump when the game ends and goes to the game review screen.

 

 

DISASTROUS UPDATE

 

The AI will not use this ability (in developer anyways). For some reason it won't use it to capture neutrals.

 

NOT SO DISASTROUS UPDATE

 

The AI WILL use this ability to capture neutrals.

Reply #24 Top

When it produces a starbase, does the original frigate disappear like a Starbase Constructor cruiser?  If so, I'm curious as to whether you've tested this out with multiple ships in the same gravity well.  I only ask because a range of 8000 seems a bit excessive considering the range for the ability itself is only 1000.

 

 

Reply #25 Top

The range of 8000 was only a placeholder until I got the ability working (It was copied and pasted from another ability). It's now changed to 1100. 

 

The ship that creates the starbase instantly turns into a starbase without any type of construction. 

 

The biggest issue though, is that this ability can be used regardless of how many starbases are in a gravity well. I think the limit is imposed on the "CreateStarbase" ability, not on a buff.

 

I'm really hoping there is a workaround because the entire mod is based on not having another starbase being built until the starbase is destroyed.