1.03 XML issues and workarounds

So I've decided to look at some of the issues I've discovered in game that seem like errors. Some MAY be working as intended but they don't make sense to me so I've changed them for now. Here is a list of some of the "workarounds" I've made. I'll try to clean it up later and add some more but it's bedtime, there's a couple of credits to add also :)

Fixes for:

  • Cultural traits granted to one too many colonies
  • 2nd Trader Ideology not granting trade bonus
  • Orbital Specialization 1 and Logistical Optimization 3 are not granting bonus military production (logistical may have been intended to be shipyard decay but the code was closer to military production so I've gone with that for now). This seems to affect all tech trees.
  • Hyperion Supply System and Hyperion Shipyard aren't granting level bonuses
  • Mega Resort and Biomass Resequencer unbuildable, Food Distribution able to build after upgrading
  • Trade buildings aren't granting level bonuses
  • Tidally Locked worlds aren't granting trade bonus
  • Research Cloisters, Quantum Research Foundation, Ascension Gate anomalies (granting total faction research bonus seems very unbalanced)

CultureTraitDefs>
AffinityTrait2, AffinityTrait3, ProminenceTrait2, MotivationTrait2, MotivationTrait3: Set Stats>Target>TargetOrdinalConstraint
GreedTrait2: Set Triggers>PerformAction>ValueParam ***the first one***
Reduce values by one, ie 1 to 0 or 5 to 4

CultureTraitDefs>InternalName: TradersTrait2
Problem: Not giving trade route bonus
Cause: Stats>EffectType incorrect "TradeRouteIncome"
Cause: Stats>Target>TargetType incorrect "Colony"
Solution: Set Stats>EffectType to "TradeRouteValueRaw"
Solution: Set Stats>Target>TargetType to "TradeRoute"

TerranTechDefs>InternalName: TerranOrbitalSpecialization1 (affects other tech trees too)
TerranTechDefs>InternalName: TerranLogisticalOptimization3 (affects other tech trees too)
Problem: Not providing military bonus
Cause: Stats>Target>TargetType incorrect "Ship"
Solution: Set Stats>Target>TargetType to "Colony"

Improvement>InternalName: HyperionSupplySystem
Problem: Level effect not working
Cause: LevelEffectTriggers>Lifetime set to "Instant"
Solution: Set LevelEffectTriggers>Lifetime to "Target"

Improvement>InternalName: HyperionShipyard
Problem: Level effect not working
Cause: LevelEffectTriggers>Lifetime set to "Instant"
Solution: Set LevelEffectTriggers>Lifetime to "Target"

Improvement>InternalName: MegaResort
Problem: Unable to construct
Cause: Prerequ>UpgradesFrom incorrect "Amusement Park"
Solution: Set Prerequ>UpgradesFrom to "AmusementPark"

Improvement>InternalName: FoodDistribution
Problem: Able to build again after upgrading
Cause: Preclusions>Improvement incorrect "XenoIrrigation"
Solution: Set Preclusions>Improvement to "XenoIrrigation "

Improvement>InternalName: BiomassResequencer
Problem: Unable to construct
Cause: Prerequ>UpgradesFrom incorrect "XenoIrrigation"
Solution: Set Prerequ>UpgradesFrom to "XenoIrrigation "

Improvement>InternalName: TradePost
Improvement>InternalName: TradeCenter
Improvement>InternalName: CustomsOffice
Improvement>InternalName: GalacticBazar
Improvement>InternalName: TradeCapital
Problem: Level effect not working
Cause: LevelEffectStats>EffectType incorrect "TradeRouteIncome"
Cause: LevelEffectStats>TargetType incorrect "Colony"
Solution: Set LevelEffectStats>EffectType to "TradeRouteValueRaw"
Solution: Set LevelEffectStats>TargetType to "TradeRoute"

Improvement>InternalName: ResearchCloisters
Improvement>InternalName: QuantumResearchFoundation
Improvement>InternalName: AscensionGate
Problem: Giving total faction research bonus
Cause: Stats>Target>TargetType set to "Faction"
Solution: Add Stats>Scope to "Global"
Solution: Set Target>TargetType to "Colony"

Improvement>InternalName: AscensionGate
Problem: Not an upgrade of QuantumResearchFoundation
Cause: No Prerequ
Solution: Add Prerequ>UpgradesFrom to "QuantumResearchFoundation"

PlanetTraitDef>InternalName: TidallyLockedWorld
Problem: Trade route bonus not applied
Cause: EffectModifier>EffectType>TargetType incorrect "Colony"
Solution: Set EffectModifier>EffectType>TargetType to "TradeRoute"

62,190 views 15 replies +2 Loading…
Reply #1 Top

Would suggest you write up the code changes and submit a link to them in the patch notes thread the Devs really seem to appreciate that.

Reply #2 Top

Could the Malevolent option for the "Ship Design Revolution" event be fixed via XML?  It currently does not work -- it is supposed to reduce the mass of all ship components by 10%, but appears to have no effect whatsoever.

Reply #3 Top

Also, good work.  I like this idea.  A lot of this is probably bound to be fixed eventually, but if not, I think it'd be a great idea to have an "unofficial vanilla patch" going for these XML fixes.

Reply #4 Top

Actually I may have found it?  I don't know squat about XML, but did a little poking around ... someone correct me if  I'm wrong here?

Here's the code for the event from IdeologicalGalacticEventDefs.xml


<GameEvent>
<InternalName>DesignRevolutionEvent</InternalName>
<DisplayName>DesignRevolutionEvent_Name</DisplayName>
<Description>DesignRevolutionEvent_Dec</Description>

[...]

<Type>Merciless</Type>

[...]

<Lifetime>Target</Lifetime>
<Modifier>
<EffectType>MassCap</EffectType>
<Scope>Global</Scope>
<Target>
<TargetType>Faction</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>-0.1</Value>
</Modifier>
</Trigger>
</Choice>
</GameEvent>


I didn't think much of it as I read it.  The event description says it reduces the mass of all components by 10% ... so -0.1.  But ... MassCap?  Durr, could that actually be the Mass Capacity of ships, which choosing this event actually /reduces/ (giving you -less- space)?  So I looked up, for comparison, a tech that increases capacity from TechDefs.xml:


<Tech>
<InternalName>GenericOrbitalSpecialization2</InternalName>

[...]

<EffectType>MassCap</EffectType>
<Scope>Global</Scope>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.1</Value>

[...]


Here it increases MassCap by 0.1 (multiplier) -- so yeah, the event choice that's supposed to reduce the mass of ship components, instead reduces the capacity to put stuff on!

 

Unless I'm reading that wrong?

 

Reply #5 Top

Quoting Chibiabos, reply 4

Here it increases MassCap by 0.1 (multiplier) -- so yeah, the event choice that's supposed to reduce the mass of ship components, instead reduces the capacity to put stuff on!

 

Unless I'm reading that wrong?
End of Chibiabos's quote

 

Looks right, as its affecting Ships, rather than modules at all - I'm just not sure its working at all right now.

 

I may take a look at this sometime soon. Right now I barely get any ideology points at all because I play with a lot of opponents, so there's little colonizing opportunity. 

 

Won't be hard to fix the above issues in a mod.

Reply #6 Top

Note:

"Tariff Stations" (tech available to Altarians) describes "All starbases now give a significant boost to the trade income of colonies with their Area of Effect." but the only effect unlocked is "Research +10%" (nothing unlocked for boosting trade income)

Probably something else to look at in the XML?

Reply #7 Top

Quoting Chibiabos, reply 6

Note:

"Tariff Stations" (tech available to Altarians) describes "All starbases now give a significant boost to the trade income of colonies with their Area of Effect." but the only effect unlocked is "Research +10%" (nothing unlocked for boosting trade income)

Probably something else to look at in the XML?
End of Chibiabos's quote

If I remember correctly it does nothing right now, you don't even get the 10% boost to research.

I have no idea how that could be applied since all AreaEffect modifiers are actually starbase modules. This is a tech that is trying to modify all starbases and I think starbases are simply too reliant on modules to give their bonuses. The same applies to the precursor focus specializations. I can't think of a way to do this except by giving you another module to build on an existing starbase.

Reply #8 Top

Perhaps it could be modded to give the basic starbase econ ring that bonus?

Reply #9 Top

Quoting TurielD, reply 8

Perhaps it could be modded to give the basic starbase econ ring that bonus?
End of TurielD's quote

The problem is it needs to apply only when the technology is unlocked, so you would need a way to tie this in. I'll have to think on it or someone else could maybe come up with a solution.

You can have a technology unlock a starbase module for building, but not modify an existing module. At least I don't currently know of a way how. The closest I can get at the moment is create a new module to build on starbases that does the same job and doesn't cost a constructor point. It would however mean clicking through each one of your starbases and building it. Alternatively, I could make it a flat 10% colony bonus which I will do for my game now, it's boring I know but I'm sure most people would prefer that to building those modules individually.

Reply #10 Top

From what I have learned in my own modding this fix will work because something targeted at "AreaEffect" will alter the values that all AOE applies.

Every race has a similar tech and I cannot fathom why it would be set to effect Research.

I think what you may not be realizing is AreaEffect is a code object just like starbases ships and colonies, it is generated only by starbases but anything that uses AreaEffect as Scope will apply to every zone generated by every one of that factions starbases and will be applied to whatever the TargetType is within that AreaEffect.

<Stats>
<EffectType>TradeRouteRaw</EffectType>
<Scope>AreaEffect</Scope>
<Target>
<TargetType>Colony</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.1</Value>
</Stats>

Reply #11 Top

Quoting Chibiabos, reply 4


<Lifetime>Target</Lifetime>
<Modifier>
<EffectType>MassCap</EffectType>
<Scope>Global</Scope>
<Target>
<TargetType>Faction</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>-0.1</Value>
</Modifier>
</Trigger>
</Choice>
</GameEvent>


End of Chibiabos's quote

 

Yes this is quite broken, first because it is reducing MassCap which is a ship attribute and in order to simulate reducing mass of modules you would need to increase the ship MassCap not reduce it.  Every module has a Mass attribute such as ShipRangeMass but to my knowledge there is no global module mass attribute.

Second this is broken because it's TargetType is Faction which again as far as I understand it won't apply the MassCap change to anything.

Reply #12 Top

Quoting Deathwynd, reply 10

From what I have learned in my own modding this fix will work because something targeted at "AreaEffect" will alter the values that all AOE applies.
Every race has a similar tech and I cannot fathom why it would be set to effect Research.
I think what you may not be realizing is AreaEffect is a code object just like starbases ships and colonies, it is generated only by starbases but anything that uses AreaEffect as Scope will apply to every zone generated by every one of that factions starbases and will be applied to whatever the TargetType is within that AreaEffect.
TradeRouteRaw AreaEffect Colony Multiplier 0.1
End of Deathwynd's quote

At first glance I thought there might be a global AreaEffect scope too, but take note that it's currently not providing even the incorrect research bonus. Changing the EffectType, while correct, will not remedy the problem because AreaEffect scope seems to be starbase dependant. If you manage to get it to work let me know.

Reply #13 Top

Quoting rspiccaver, reply 12

Quoting Deathwynd, reply 10

From what I have learned in my own modding this fix will work because something targeted at "AreaEffect" will alter the values that all AOE applies.
Every race has a similar tech and I cannot fathom why it would be set to effect Research.
I think what you may not be realizing is AreaEffect is a code object just like starbases ships and colonies, it is generated only by starbases but anything that uses AreaEffect as Scope will apply to every zone generated by every one of that factions starbases and will be applied to whatever the TargetType is within that AreaEffect.
TradeRouteRaw AreaEffect Colony Multiplier 0.1

At first glance I thought there might be a global AreaEffect scope too, but take note that it's currently not providing even the incorrect research bonus. Changing the EffectType, while correct, will not remedy the problem because AreaEffect scope seems to be starbase dependant. If you manage to get it to work let me know.

End of rspiccaver's quote

The solution is to delete the stat from the TradeFocus1 tech and create a star base module that is depended on that tech.

In all the *TechDefs.xml files delete for the TradeFocus1 tech the entire stat that reads:

<Stats>
<EffectType>ColonyGrossIncome</EffectType>
<Scope>AreaEffect</Scope>
<Target>
<TargetType>Colony</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.1</Value>
</Stats>

Note: above text must be deleted from the xml file.

Add to the StarbaseModuleDefs.xml file or create an additional xml that matches the outlay, add the star base module.

<!-- Module -->

<StarbaseModule>
<InternalName>TariffStationModule</InternalName>
<DisplayName>TariffStationModule_Name</DisplayName>
<Description>TariffStationModule_Dec</Description>
<Icon>GC3_Trade_Route_Value_Icon.png</Icon>
<SpecializationType>Economic</SpecializationType>
<RequiredTarget>Colony</RequiredTarget>

<!-- Stats -->

<Stats>
<EffectType>ModuleConstructionPoints</EffectType>
<Scope>Queue</Scope>
<Target>
<TargetType>StarbaseModule</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>1</Value>
</Stats>

<Stats>
<EffectType>TradeRouteValueRaw</EffectType>
<Scope>AreaEffect</Scope>
<Target>
<TargetType>TradeRoute</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.1</Value>
</Stats>

<Prerequ>
<Techs>
<Option>TradeFocus1</Option>
</Techs>
<StarbaseModule>EconomicRingModule</StarbaseModule>
</Prerequ>

</StarbaseModule>

Of course you must supply the text fields in the StarbaseModuleText.xml:

<StringTable>
<Label>TariffStationModule_Name</Label>
<String>Tariff Stations</String>
</StringTable>

<StringTable>
<Label>TariffStationModule_Dec</Label>
<String>By establishing a tariff stations on our starbases we have been able to increase our cut of trade route profits.</String>
</StringTable>

 

Reply #14 Top

Quoting Thecw, reply 13

The solution is to delete the stat from the TradeFocus1 tech and create a star base module that is depended on that tech.
End of Thecw's quote

This was the only way I can think to fix this problem also, however as I stated in a previous post, that requires you to build the module on all the starbases you want it on. Granted since it affects traderoutes you shouldn't have that many places you want it.

Personally I don't want yet another module, we have far too many as it is, my low overhead solution was just to grant a global bonus and be done with it. Changing the entry in TechDefs to:

<Stats>
<EffectType>TradeRouteValueRaw</EffectType>
<Scope>Global</Scope>
<Target>
<TargetType>TradeRoute</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.1</Value>
</Stats>

Reply #15 Top

I know, but a module is the closest that we can come and still be true to the description text.

"By establishing a tariff stations on our starbases we have been able to increase our cut of trade route profits."