Logo Platform
logo amplifiers simplified

Minor pop bonus not working with anomalies

Reply
Copied to clipboard!
5 years ago
Feb 6, 2020, 11:28:31 PM

I'm having an issue with my Endless Moons mod.
Minor pop bonuses that looks for an anomaly aren't working.

Endless Moons makes a slight change with what counts as an anomaly, namely the moons no longer count. To accomplish this, PlanetAnomaly no longer adds to OwnedAnomalies, and instead the individual anomalies add it themselves.


For every other use, this works and counts correctly (it works for system improvements, laws, and minor assimilation affinitys) But for some reason it doesn't work with population bonuses such as Pilgrims' ClassPopulationPlanetModifiersTraitSecondaryScienceAnomaly01 (This particular item adds BonusPopulationScience of 3 * PlanetHasAnomaly)


I've looked at the in-game values using the modding tools, and all the relevant values of AnomalyCount, OwnedAnomalies, PlanetHasAnomaly are correct. (In the above case, PlanetHasAnomaly is indeeed 1, both on the planet and population properties)


I constructed a test where the pop bonus trait instead just adds a flat value so as not to rely on anomalies. It still would not show up.

This seems to mean it's not the anomaly counting math.


I have no idea the problem, and I'm starting to think there's an undocumented DatabasePlugin that needs to be loaded because I made changes to PlanetAnomaly.


Any ideas?


Updated 5 years ago.
0Send private message
0Send private message0Send private message
5 years ago
Feb 7, 2020, 4:55:33 AM

I compared what you had to what the game loads, it doesn't appear as if there is anything else relating to anomalies that you are misisng (there's some random ones under EntityActions but you probably already know that).


The only thing I could immediately see could cause problems is that you might've removed the following line from SimulationDescriptors[Planet] line 172

<Modifier TargetProperty="PlanetHasAnomaly"            Operation="Addition"    Value="$(PlanetHasAnomaly)" Path="ClassPlanet/ClassPopulationPlanet" TooltipHidden="true"/>

Reason I think this is is because System Improvements, Laws, and Assimilation Traits all use the ClassPlanet value (or at the very least, should), whereas the Population Modifier Trait version uses the ClassPopulationPlanet value. This is the only thing I could find relating to PlanetHasAnomaly that could cut the connection between the ClassPlanet and ClassPopulationPlanet version, so if that's not missing it's probably something a lot more complicated.

Updated 5 years ago.
0Send private message
5 years ago
Feb 7, 2020, 5:04:39 AM

I haven't modified ClassPlanet.

I did notice that PlanetHasAnomaly was used in two places, and the value appears to be correct in both.


Because PlanetHasAnomaly value is correct, I'm assuming the check is failing for some other reason.


Perhaps something with the path in SimulationDescriptors[PopulationModifierTraits].xml line 404 ?

        <Modifier TargetProperty="BonusPopulationScience"   Operation="Addition"    Value="3"   Path="PopulationGrowthScoreBoosted/./ClassEmpire/ClassColonizedStarSystem/PlanetAnomaly/ClassPopulationPlanetModifiersTraitSecondaryScienceAnomaly01,ClassPopulation" TooltipHidden="true"/>


My guess was that PlanetAnomaly was failing the path somehow, but I dunno.


0Send private message
0Send private message0Send private message
5 years ago
Feb 21, 2020, 12:01:13 PM

Ok, I tracked the bug down.
It had to do with some old mod code that used to be necessary, but somewhere along the line of updates, became obsolete and was interfereing.

0Send private message
?

Click here to login

Reply
Comment