News

Population Change Problems in Some Events

Posted on Saturday, August 24, 2019

Some events that are supposed to change population on a planet don't work right.  The code used in the Crises works correctly, so I made a mod that uses that code to replace the code in the events that didn't work right.  They now change population correctly in the mod.

These are the events that have the problem:
StartingEventDefs in the base game
  <InternalName> is CloningEvent; <Type> is Merciless
  <InternalName> is PrecursorArtifactEvent; <Type> is Merciless
  <InternalName> is PrecursorRelicEvent; <Type> is Merciless
  <InternalName> is FamineEventNew; <Type> is Merciless

EarlyEventDefs in the Intrigue Expansion
  <InternalName> is FamineEvent; <Type> is Merciless


In all cases the events are supposed to cause a flat change, either an increase or decrease, in the population.  The code from the crises that I used and works is this:
      <Trigger>
        <OnEvent>OnEventChoice</OnEvent>
        <Target>
          <TargetType>Colony</TargetType>
        </Target>
        <Lifetime>Instant</Lifetime>
        <Modifier>
          <EffectType>Population</EffectType>
          <Target>
            <TargetType>Colony</TargetType>
          </Target>
          <BonusType>Flat</BonusType>
          <Value>-1</Value>
        </Modifier>
      </Trigger>

NOTE: The <Value> needs to be adjusted to match the <Value> in the event.