Sins of a Solar Empire : Real-Time Strategy. Unrivalled Scale.
© 2003-2016 Ironclad Games Corporation Vancouver, BC. All rights reserved.
© 2006-2016 Stardock Entertainment

"respawning" destroyed starbase

By on May 28, 2014 10:52:59 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

furyofthestars

Join Date 08/2012
+14

So, long story short, I've given Pirates a starbase in a mod I'm working on, but want it so when it's destroyed (after a delay) a new one will spawn in (seems the Pirates won't construct another on their own).

I've already got an ability setup that I'm fairly sure will work (haven't actually fully tested it, yet) that when the starbase is about to die, it should throw a buff to the planet (assuming the planet hasn't already been lost).  After a timed delay, I want that buff to then spawn in a new starbase.  I already have something similar working for spawning in orbital structures.

Unfortunately, it almost seems as though the buffInstantActionType "CreateStarBase" was meant for use directly from an ability, not a buff.  Of the lines that seem as though they should matter:

buffInstantActionType "CreateStarBase"
instantActionTriggerType "AlwaysPerform"
starBaseType "StarBasePirate"
placementRadius
    Level:0 1000.000000
    Level:1 1000.000000
    Level:2 1000.000000
    Level:3 1000.000000

 

If I do not include the placementRadius, dev.exe complains that it is missing.  If I include it, the game MDs.  Was wondering if anyone had some suggestions?  I'm open even to completely alternate methods.  It'd actually be good to find a way to limit it to 1 starbase per grav well, but not sure how to get the ability/buff to check prior to applying.  The whole point behind this is to make it so the Pirate bases are not only harder to defeat, but also make it so one can't simply "whittle" away at it and expect it to remain the same as how they had left it.

 

Pastebins of a few relevant files:

FrigatePirateStarBaseConstructor.entity

AbilityDeployStarBasePirate.entity

AbilityPirateStarBaseRespawn.entity

BuffPirateStarBaseRespawnPlanet.entity (this version spawns constructor frigate.  Frigate spawns, but never builds starbase)

BuffPirateStarBaseRespawnPlanet.entity (this was supposed to be the version that spawned the starbase directly, but doesn't work)

Locked Post 8 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
May 28, 2014 11:53:10 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

buffInstantActionType "CreateStarBase"
instantActionTriggerType "AlwaysPerform"
starBaseType "StarBasePirate"
placementRadius
    Level:0 1000.000000
    Level:1 1000.000000
    Level:2 1000.000000
    Level:3 1000.000000

The bold is your problem. I have a Starbase spawned via a buff working just fine in E4X. The issue is that using "AlwaysPerform" usually does not work in a buff for instantActionTriggerType. Unless you can see from a vanilla buff that it works for the InstantActionType, always use OnDelay for buffs.

Reason for Karma (Optional)
Successfully updated karma reason!
May 29, 2014 12:37:41 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Thanks for the reply, Goa.  Unfortunately, I already tried that at "OnDelay" in the buff version (see last pastebin link).  Obviously I've tried reduced times from that so I wouldn't be sitting around forever waiting... lol

 

But I'll take a look at your mod, next.  Aside from going to bed right now, I just got through d/l'ing Sins of a Galactic Empire and have looked through its files for how to limit the number that spawn (using their "titans" as an example).  I think I've found the relevant files, but pieces of it are confusing me a little and stopping me from fully understanding how it works. (Looked through the files regarding spawning the SSD Executer.)

  1. The disable construction buff that gets applied back to the last spawner (which I would assume is the "Titan" foundry as that's where the ability resides that eventually creates the disable buff) has a bool of "DisableAbilitiesUltimate".  Yet, both abilities on it have their isUltimateAbility set to FALSE.
  2. Why there is (with all 0 delays the whole way up through to the final ship spawn) a "placeholder" version of the ship that gets spawned and then killed after a time delay, which kind of couples with...
  3. Why a couple of their buffs for spawning the "placeholder" and actual vessel have a finish condition of "TimeElapsed", seems, to my knowledge, this does not delay the actual spawning of the ship or anything.

I realize you probably wouldn't be able to answer those questions, but I'm just putting those out there (might help me remember later where I was getting stumped... lol  Very possible, even, 2 & 3 are completely irrelevant.).  Other than those 3 issues, I think I understand fairly well how it works.  However, I'm going to shelve that until I can get the starbase spawning to actually work.  I'll have a look through your mod tomorrow (hopefully) when I have time to find the missing pieces, then I'll revisit the "limit 1" thing.

Reason for Karma (Optional)
Successfully updated karma reason!
May 29, 2014 12:52:41 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting furyofthestars,
Thanks for the reply, Goa.  Unfortunately, I already tried that at "OnDelay" in the buff version (see last pastebin link).  Obviously I've tried reduced times from that so I wouldn't be sitting around forever waiting... lol

Well this is from E4X and works like a charm. In this case I had to do it this way because I wanted a non-zero delay. Also another thing that might be causing your issue is that you have to list any Starbases a faction can build in their player entity file, so if you haven't done that and the pirates don't have a starbase that could prevent it from spawning.

TXT
entityType "Buff"
onReapplyDuplicateType "PrioritizeOldBuffs"
buffStackingLimitType "ForAllPlayers"
stackingLimit 1
allowFirstSpawnerToStack FALSE
buffExclusivityForAIType "NotExclusive"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 1
instantAction
buffInstantActionType "CreateStarBase"
instantActionTriggerType "OnDelay"
delayTime 180.000000
starBaseType "StarBase_E4X_TechLoyalsStart"
placementRadius
Level:0 1000.000000
Level:1 1000.000000
Level:2 1000.000000
Level:3 1000.000000
numPeriodicActions 0
numOverTimeActions 0
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 1
finishCondition
finishConditionType "OwnerChanged"

Quoting furyofthestars,
But I'll take a look at your mod, next.  Aside from going to bed right now, I just got through d/l'ing Sins of a Galactic Empire and have looked through its files for how to limit the number that spawn (using their "titans" as an example).  I think I've found the relevant files, but pieces of it are confusing me a little and stopping me from fully understanding how it works. (Looked through the files regarding spawning the SSD Executer.)

Ah, I developed that system too and it is indeed probably the most confusing monstrosity I've ever worked on.   Though the Executor might not be the best to look at, if you just want to limit to a SINGLE ship, there are much easier ways to do that than what SoGE does. The reason theirs had to be so complicated was that different titans had to have different titan limits, for some different titans you can get 4 of them.

Quoting furyofthestars,
Why there is (with all 0 delays the whole way up through to the final ship spawn) a "placeholder" version of the ship that gets spawned and then killed after a time delay, which kind of couples with...

Lavo wanted to simulate the construction time of titans. If for whatever reason you do not have enough fleet supply to spawn a titan when the buff is called, nothing happens, so the place holder titan allows for the fleet supply to be "reserved" so that he can destroy the place holder and ensure the player has enough fleet supply for the real titan. If the ship is spawned instantly when the ability is used like my hero units this is a non-issue.

Quoting furyofthestars,
Why a couple of their buffs for spawning the "placeholder" and actual vessel have a finish condition of "TimeElapsed", seems, to my knowledge, this does not delay the actual spawning of the ship or anything.

Time Elapsed is simply used to end the buff. If you have a buff with both "OnDelay" and "OnCondition" instant actions you cannot use the usual "OnAllOnDelayInstantActionsDone" or whatever because the buff would end before the conditions have a chance to work.

Reason for Karma (Optional)
Successfully updated karma reason!
May 29, 2014 8:39:28 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Then I must have missed something somewhere.  I know I added the starbase to the PlayerPirate.entity file... but it's entirely possible I forgot to rename it (added it as StarBaseTech until after I had finished my tweaks and actually renamed the entity file itself... possible I forgot to update the Player file).  Cause otherwise, what you see in that file I pastebined, causes a MD when the delay time runs out.

Hmm... the ability of yours that creates that buff... what does it apply the buff to?  Mine goes to the planet of the grav well.  Just curious if that could be a difference....

 

Re: limits... essentially, again, seems the Pirates will not rebuild on their own, I want something that will simulate rebuilding after a failed assault on their base.  In this way, I hope to make Pirate bases slightly tougher to crack because you can't just simply jump in, destroy a couple things, jump out to repair/replace, rinse & repeat.  Obviously I'll have delays on things rebuilding so they are less inclined to respawn while the attacking fleet is still present (seems you can't block their construction like a normal AI), but if they linger long enough then they get to deal with the fact that they're "taking too long".

The issue (to me) becomes... if I have the structure itself (ie, the starbase) cast its own respawn buff on the condition of about to die, but then the attacking fleet is either defeated or withdraws before actually destroying it... well, then we'll have an extra that will spawn in the grav well a bit later.  Starbases I want limited to 1, but then the other structures (hanger defense, gauss cannons, etc) should have a higher limit than that (the default base has something like 19 gauss, 3 hangers, and 2 repair platforms).  I'm also adding in extra structures that "summon" reinforcements when the grav well is under attack, so these will need to be replaced and, of course, I don't want too many reinforcements in the grav well at once.

Yeah, it's probably a lot and pretty ambitious considering some of the limitations we have with modding this game, but it's my "end goal".  Some of it I'm already expecting not being able to do (limit # of reinforcements) so have already worked up alternatives I hope will suffice.  Course, now that I'm thinking about all of this, I think I'm starting to come up with interesting alternatives to the alternatives....  Hmm....

Reason for Karma (Optional)
Successfully updated karma reason!
May 29, 2014 10:43:35 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting furyofthestars,
Hmm... the ability of yours that creates that buff... what does it apply the buff to?  Mine goes to the planet of the grav well.  Just curious if that could be a difference....

Um well yes, you can only create a Starbase from a Starbase constructor. You can't spawn it like a planet module which I guess is what you're trying to do?

Reason for Karma (Optional)
Successfully updated karma reason!
May 29, 2014 1:29:29 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Ahh!  Yes... yeah, my starbase has the AbilityPirateStarBaseRespawn, which then throws the BuffPirateStarBaseRespawnPlanet at the planet to respawn the starbase.  But to note, my buff is structured identically to yours.

But spawning in a constructor wasn't doing anything... it wouldn't build.  The first link I have up there shows how my constructor was configured.

Eh, when I get home I'll figure out what nonsense I did wrong from your files.  I'm at work and will be for the next... 3.5 hrs, then I have some errands to run.

Reason for Karma (Optional)
Successfully updated karma reason!
May 29, 2014 9:13:29 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Ok, I see the difference now.  In your ability, you had the cost type as passive, whereas I was setting mine to no cost.  Once I set that to passive, it works.  Course, like yours, I have to set the constructor to cast the buff onto itself... otherwise the starbase builds inside the planet... lol

Now, curiosity question (and if the answer is "no" I won't fret... this will still work as is)... is it possible to give a spawned frigate a small "push" so that it drifts just a little bit further away from the planet that spawned it?  I see the "impulse" value, but setting that appears to have no affect?

Got it now... just wasn't applying a large enough impulse modifier.

Reason for Karma (Optional)
Successfully updated karma reason!
May 29, 2014 10:50:39 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Ok, with all that working, and knowing that I have a long drive ahead of me tomorrow for work, I'm calling it quits early.

Goa, if I may ask one more thing of you... the limiting of how many of an entity is built through automated buff-spawning.

Given the knowledge that you designed (or helped design) the "titan" limit buffs in SoGE and the following scenario:

In the Pirate grav wells I will have a structure (or more than one, if needed/easier), with an invisible mesh & have it be invincible, to be destroyed on loss of planet, that will be responsible for the spawning and maintaining the limit counts of other structures in the grav well.  This could be anywhere from 1 of the structure to x (where x is > 1) of it.

What "titans" would you recommend I focus on studying in SoGE to understand and come up with the right buff systems to accomplish the structure limits from the above scenario?

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108433  walnut3   Server Load Time: 00:00:00.0000187   Page Render Time: