Any way to work around the "Planetary Invasion" requirement for invasions?

I'm currently working on a custom race with a custom tech tree and custom improvements.

I have however encountered a problem: I don't want the military academy for this, and since this requires the planetary invasion tech, I simply created a duplicate tech (as in a copy with a different genericname) and created duplicate transport pods so I could invade planets... Or so I thought.

It turns out there's a HARD-CODED requirement to have the PlanetaryInvasion tech before you can invade. If I try to invade now I get a popup telling me I need the planetary Invasion tech.

 

So here's my question: Is there a way to allow invasions to procede as normal without having that tech? Or is there another way of allowing all other races to operate normally, while my race does not have the academy.

 - As far as I can tell, there is no way in the XML to remove the requirement. Could SD perhaps move the requirement from the TECH to a property on a tech, so that I can also add it to my version of the tech?

- As far as I can tell there is no way to prevent a race from gaining access to an improvement (or any other item). Could negative operators be added the the XML code so that I can say: You get access to this improvement if you have tech A, but not if you have RaceTrait B/Tech C. The closest thing there is now is the preclusions option, but that is limited to other improvements.

 

 

12,000 views 11 replies
Reply #1 Top

I'm. Not a modder, but can't. You just move the tech at the beginning of the tree. Also isn't. There an ability to start out with techs. Maybe this can be modified to include planetary invasion. Also if you do this for your custom race then you should do this for all races. Don't. Forget to reset your tech points to 0.

Reply #2 Top

As a workaround, could you give Planetary Invasion to the race as a starting tech?

Reply #3 Top


It turns out there's a HARD-CODED requirement to have the PlanetaryInvasion tech before you can invade. If I try to invade now I get a popup telling me I need the planetary Invasion tech.

So a ship with a Transport Module still receives this pop-up when invading? If yes, then this sounds like a game bug.

Reply #4 Top

Quoting pendrokar, reply 3


It turns out there's a HARD-CODED requirement to have the PlanetaryInvasion tech before you can invade. If I try to invade now I get a popup telling me I need the planetary Invasion tech.


So a ship with a Transport Module still receives this pop-up when invading? If yes, then this sounds like a game bug.

 

Surprise surprise.

Reply #5 Top

I want to make sure we are on the same page here before I start offering suggestions.   Did you try to modify the following stat block (TransportModule found in ShipComponentDefs.xml)?

<ShipComponent>
<InternalName>TransportModule</InternalName>
<DisplayName>TransportModule_Name</DisplayName>
<Description>TransportModule_Dec</Description>
<ArtDefine>Transport_01</ArtDefine>
<Category>Modules</Category>
<Type>TransportModule</Type>
<PlacementType>Module</PlacementType>
<Stats>
<EffectType>Value</EffectType>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>10</Value>
</Stats>
<Stats>
<EffectType>ManufacturingCost</EffectType>
<Scope>Queue</Scope>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>27</Value>
</Stats>
<Stats>
<EffectType>SupportMass</EffectType>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>25</Value>
</Stats>
<Stats>
<EffectType>CanInvade</EffectType>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>1</Value>
</Stats>
<Stats>
<EffectType>PopulationCap</EffectType>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>3</Value>
</Stats>
<Stats>
<EffectType>Maintenance</EffectType>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>0.25</Value>
</Stats>
<Prerequ>
<Techs>
<Option>PlanetaryInvasion</Option>
</Techs>
</Prerequ>
</ShipComponent>

And change 

<Techs>

<Option>PlanetaryInvasion</Option>

</Techs>

to

<Techs>

<Option>RaceFluffPlanetaryInvasion</Option>

</Techs>

While also changing 

<InternalName>TransportModule</InternalName>
<DisplayName>TransportModule_Name</DisplayName>
<Description>TransportModule_Dec</Description>

But leaving 

<Type>TransportModule</Type>

alone?

I'm busy on my mac side of my computer, so I can't look at this for a while, but it seems to me that this should work.  

What exactly is the game saying when you try to invade a planet?  Does the ship say it can invade planets as one of its abilities when you get the info for it?

And is there anything interesting in the debug.err file when you try to invade the planet?

====

Alternatively what you COULD do is just change the prereq for the Military Academy to something else that all the other factions get and then in turn make sure that either your custom race doesn't get that tech, or you create a race specific version of it without the Militarty Academy.   

 

 

Reply #6 Top

I can't give the tech, as that would give the custom race the academy as well, since the academy has PlanetaryInvasion as a prereq and that's something I'm specifically trying to avoid.

 

What I did was: Create a duplicate tech with a DIFFERENT GenericName. I duplicated the transport module and made my new tech show up. The game even uses the replacement module on transport ships. However, as soon as you fly your transport to a hostile planet (after first clearing any defenders of course) you get a pop up along the lines of:

"The Planetary Invasion technology is required to invade."

 

I would have assumed

<Stats>
<EffectType>CanInvade</EffectType>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>1</Value>
</Stats>

on the module would have been enough to allow it to be used in an invasion, but sadly this does not seem to be the case.

Reply #7 Top

Quoting TMPhoenix, reply 6

I can't give the tech, as that would give the custom race the academy as well, since the academy has PlanetaryInvasion as a prereq and that's something I'm specifically trying to avoid.

This is more or less what I was suggesting.  In ImprovementDefs.xml change the xml for MilitaryAcademy from:

<Prerequ>
<Techs>
<Option>PlanetaryInvasion</Option>
</Techs>
</Prerequ>

to 

<Prerequ>
<Techs>
<Option>SomeOtherTech</Option>
</Techs>
</Prerequ>

With "SomeOtherTech" being just about anything in that area.  My rationale is IF planetary invasion is hard coded, then simply attach the Military Academy improvement to something that isn't hard coded and make a fluff version of that tech for your custom race so they won't get it whilst everyone else will.

You shouldn't even need to change any of the other races since they'll follow the xml def in ImprovementDefs.xml.

That's the workaround that immedately comes to mind.  Basically nothing says that the Military Academy HAS to be attached to the Planetary Invasion tech.  As long as it is more or less researchable at the same point in the Military Tree and the tech is available to everyone else, I don't see a particular reason why it can't be shifted.  Annoying that one has to do this, yes.  But that's why it is called a workaround, I suppose.

What I did was: Create a duplicate tech with a DIFFERENT GenericName. I duplicated the transport module and made my new tech show up. The game even uses the replacement module on transport ships. However, as soon as you fly your transport to a hostile planet (after first clearing any defenders of course) you get a pop up along the lines of:


"The Planetary Invasion technology is required to invade."

 

I would have assumed

<Stats>
<EffectType>CanInvade</EffectType>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>1</Value>
</Stats>

on the module would have been enough to allow it to be used in an invasion, but sadly this does not seem to be the case.

This does sound like a bug, so perhaps you should send a ticket to Stardock about it.  I am curious though if the ship itself says it can invade planets when you click on it/pull up details about it.  If it doesn't, then perhaps something is wrong with the XML parsing somewhere.  If it does, then it is very probably a bug and something SD should be made aware of.

Reply #8 Top

The ship does show the invasion icon and loads population as normal.

Reply #9 Top

Simple answer that should work, though i'd need to test it to be sure, add a preclusion specifying the relevant tech tree of your race to the military academy.

Reply #10 Top

You can't change the genericName of the techtree though and preclusions (and pretty much everything else) only work on the generic level and not at the specific internalname level.

Also, preclusions are always improvements right now. Don't know how adding a tech would work.

Reply #11 Top

I decided to make a ticket:

#URG-630-11157

But I would imagine this kind of thing doesn't get as much of a priority as fixing vanilla game issues, understandably so.