Logo Platform
logo amplifiers simplified

Problems with creating a custom race/population

Reply
Copied to clipboard!
7 years ago
Apr 13, 2018, 5:19:42 PM

I could'nt find an already existing mod or a thread about this problem and I could'nt figure it comepletely out by myself.


I know you can create a custom population ingame for a custom major faction. But I want to create a custom race/population aside from this.

A population you can get from a curiosity, a starting trait for a custom major faction or from a quest. Maybe even meet as a minor faction.


In short:

I have a problem with creating a new population. It is because of the PopulationModifiersTraitPopulationCount and the PopulationCollectionBonusTrait.


In long:

I figured out myself that the most important thing to create a new population is to create a new PopulationDefinition in PopulationDefinitions.xml.

To make things easier I copied almost everything Pulsos related from the hole Public folder and gave them new names and stuff like that, so that I dont override the Pulsos population, but create a comepletely new one.

After that the most important part of a population, the PopulationDefinition in the PopulationDefinitions.xml looked like this:


<PopulationDefinition AffinityName="AffinityTest" Standard="true">
        <DefaultPolitics>
            <Politics PoliticsReference="Politics01" BaseScore="1" BaseTrend="0"/>
        </DefaultPolitics>

        <Trait Name="PopulationPoliticalTraitIndustrialist"/>
        <Trait Name="PopulationPoliticalTraitAntiEcologist"/>
        <Trait Name="PopulationPoliticalTraitScientificToIndustrialist"/>

        <Trait Name="PopulationModifiersTraitTestCount"/>
        <Trait Name="PopulationModifiersTraitTest"/>

        <Trait Name="PopulationModifiersTraitPrimaryIndustry"/>
        <Trait Name="PopulationModifiersTraitSecondaryScienceAnomaly02"/>

        <Trait Name="PopulationCollectionBonusTraitTest" />
       
        <Desires>
       
        </Desires>

        <Wills>
       
        </Wills>

        <AffinityMapping Name="AffinityMappingTest"/>

        <GrowthBoostLuxuryOptions>
            <Luxury>Luxury1</Luxury>
            <Luxury>Luxury2</Luxury>
            <Luxury>Luxury3</Luxury>
            <Luxury>Luxury4</Luxury>
            <Luxury>Luxury5</Luxury>
            <Luxury>Luxury6</Luxury>
            <Luxury>Luxury7</Luxury>
            <Luxury>Luxury8</Luxury>
        </GrowthBoostLuxuryOptions>
    </PopulationDefinition>

When I started the game, to test it, I created a custom major faction and added a trait to spawn this new race at the start of the game on my home planet.

The game started and it looked like this:



The population was on the planet. With all the stats and Gui-Elements I gave it.

But there were 3 Problems.

  1. The Empire population count of this race was 0. (on the left bottom of the picture)
  2. On the star system view on the population panel the new race wasn't shown at all. (on the left of the picture)
  3. Like on the population panel, the new population also wasn't to find on the population overview


I figured out pretty fast, that the problem was the PopulationModifiersTraitTestCount, but I could'nt find the problem with it.

Here are all my changes on the PopulationModifiersTaits:


 <PopulationModifiersTrait Name="PopulationModifiersTraitTest" SubCategory="Affinity" ShowInCustom="false">
        <Modifiers>
            <Modifier Class="ClassPopulationEmpire">
                <SimulationDescriptorReference Name="ClassPopulationEmpireAffinityTest"/>
            </Modifier>
            <Modifier Class="ClassPopulationStarSystem">
                <SimulationDescriptorReference Name="ClassPopulationStarSystemGrowthTypeDust"/>
                <SimulationDescriptorReference Name="ClassPopulationStarSystemAffinityTest"/>
            </Modifier>
        </Modifiers>

        <AssimilatedModifiers>
            <Modifier Class="ClassPopulationEmpire">
                <SimulationDescriptorReference Name="ClassPopulationAssimilatedEmpireAffinityPulsos"/>
            </Modifier>
        </AssimilatedModifiers>
    </PopulationModifiersTrait>
   
    <PopulationModifiersTrait Name="PopulationModifiersTraitTestCount" SubCategory="Count">
        <Modifiers>
            <Modifier Class="ClassPopulationPlanet">
                <SimulationDescriptorReference Name="ClassPopulationPlanetAffinityTestCount"/>
            </Modifier>
            <Modifier Class="ClassPopulationStarSystem">
                <SimulationDescriptorReference Name="ClassPopulationStarSystemAffinityTestCount"/>
            </Modifier>
            <Modifier Class="ClassPopulationEmpire">
                <SimulationDescriptorReference Name="ClassPopulationEmpireAffinityTestCount"/>
            </Modifier>
        </Modifiers>
    </PopulationModifiersTrait>

And my changes for the SimulationDescriptors:


<SimulationDescriptor Name="ClassPopulationPlanetAffinityTestCount" Type="ClassPopulationPlanet">
        <Modifier       TargetProperty="PopulationCount"          Operation="Addition"    Value="$(PopulationCount)" Path="../ClassStarSystem/ClassPopulation,ClassPopulationStarSystemAffinityTestCount" TooltipHidden="true"/>
        <Modifier       TargetProperty="PopulationCountTest"    Operation="Addition"    Value="$(PopulationCount)" Path="../ClassPlanet"  TooltipHidden="true"/>
    </SimulationDescriptor>

    <SimulationDescriptor Name="ClassPopulationStarSystemAffinityTestCount" Type="ClassPopulationStarSystem">
        <Modifier         TargetProperty="PopulationCount"             Operation="Addition"     Value="$(PopulationCount)" Path="./!ClassExploitedStarSystem/../ClassEmpire/ClassPopulation,ClassPopulationEmpireAffinityTestCount" TooltipHidden="true"/>
    </SimulationDescriptor>

    <SimulationDescriptor Name="ClassPopulationEmpireAffinityTestCount" Type="ClassPopulationEmpire">
        <Modifier TargetProperty="NetPopulationScore" Operation="Multiplication" Value="$(PopulationGrowthScoreModifier)" Path="../ClassEmpire/ClassColonizedStarSystem/ClassPopulationStarSystemAffinityTestCount" Priority="100" TooltipHidden="true"/>
    </SimulationDescriptor>

For test purposes I changed the PopulationModifiersTraitTestCount to PopulationModifiersTraitPulsosCount in the PopulationDefinitions.xml.

And suprisingly all the previous problems were gone:


There are 3 posibilitys.

  1. I made a mistake or forgot to add something. (But I checked multiple times to make sure, that I copied everything of the pulsos (except the hero and quest things) and customized them.
  2. Something that I need ist hardcoded and I cant access it.
  3. I dont know what the problem is...


But with the change to the PopulationModifiersTraitPulsosCount I encountered 4 new problems:

  1. The new population counts as as an pulsos population. (This problem was to aspect)
  2. The population count of the pulsos was weirdly 4. (Probably Pulsos population + new population * 2)
  3. The Collection status area was almost empty. (Does'nt work if I change the PopulationCollectionBonusPulsosTest to PopulationCollectionBonusPulsosTest)
  4. The icon next to the race name was the craver icon. I set the icon there to the craver icon, but i could'nt figure out to set a custom icon on this position.

Here is my new added PopulationCollectionBonusTrait:


<PopulationCollectionBonusTrait Name="PopulationCollectionBonusTraitTest" Cost="0" ShowInCustom="false">
        <CollectionBonus Threshold="10">
            <SimulationDescriptorReference Name="PopulationCollectionBonusPulsos1"/>
            <SimulationDescriptorReference Name="PopulationCollectionBonusLevel1"/>
        </CollectionBonus>

        <CollectionBonus Threshold="20">
            <SimulationDescriptorReference Name="PopulationCollectionBonusPulsos2"/>
            <SimulationDescriptorReference Name="PopulationCollectionBonusLevel2"/>
        </CollectionBonus>

        <CollectionBonus Threshold="50">
            <SimulationDescriptorReference Name="PopulationCollectionBonusLevel3"/>
            <SimulationDescriptorReference Name="PopulationCollectionBonusPulsos3"/>
        </CollectionBonus>
    </PopulationCollectionBonusTrait>

(I didnt change PopulationCollectionBonusPulsos1/2/3 because I dont believe that is the problem. But maybe I am wrong with this one)



So thats everything i could figure out by myself. I hope somebody can help me. I would be very happy about an answer to my questions and a solution to my problems.

0Send private message
7 years ago
Apr 16, 2018, 8:05:27 AM

Hello Julze!


You add 2 new PopulationModifierTraits, but add the SimulationDescriptors only for the second one. Maybe this is the issue?

Alternatively, you can look at the logs in My documents/Endless Space 2/Temporary Files, to see what went wrong (if I'm correct, it should say "cannot find the SimulationDescriptor XXX" several times).


Also, when you use the modifier trait of the pulsos for your test affinity, the empire population count is combined because both Pulsos and Test system populations add their count to the corresponding empire populations (corresponding = valid simulation descriptor applied on it).

Since both empire populations are identical (same descriptors because same modifier trait), they both match and it combines the count.

0Send private message
7 years ago
Apr 16, 2018, 8:11:46 AM

Regarding the population collection bonuses, have you declared GuiElements for all of the required elements?

I can't find any situation where it shouldn't appear besides "the population is not present in the empire" (but since it is shown on your screenshots that's probably not the issue).

I think looking at the Diagnostics will help here too.

0Send private message
7 years ago
Apr 19, 2018, 5:02:58 PM

Thank you MonAdmiral for your response.


But sadly, it didn't fixed my problems.


I didn't had a SimulationDescriptor for any of my PopulationModifiersTraits. Only for their subelements.

But I dont think this is the main problem here. (Maybe a part of the problem, but I'm not sure).

My PopulationModifiersTraitTest works fine. My Systems with my new population give it their bonuses perfectly fine. But the PopulationModifiersTraitTestCount seems to doesn't work.

The logs, dont show something mod related except: "[AI0] Faction affinity AffinityTest is not know from AI please add it".

I don't know how to fix this problem, but I dont think this is the source of the other problems I have here. (Maybe I'm wrong)

So I still dont know how I get my custom PopulationModifiersTraitTestCount working.


Im pretty sure, that I have declared all GuiElements for all my new Elements.

But the PopulationCollectionBonuses also dont work, if I change my own PopulationCollectionBonusTraitTest with the PopulationCollectionBonusTraitPulsos from the Pulsos.

Surprisingly the PopulationCollectionBonuses are working, if I use the PopulationCollectionBonusTraitCustom which seems to be included as a test in the code.

But I also don't know why this works, but everything else doesn't.


Because I am so clueless on this issues, I will post here almost all my changes of my code. Hopefully somebody can figure out this problem:


My PopulationDefinitions.xml:

<PopulationDefinition AffinityName="AffinityTest" Standard="true">
        <DefaultPolitics>
            <Politics PoliticsReference="Politics01" BaseScore="1" BaseTrend="0"/>
        </DefaultPolitics>

        <Trait Name="PopulationPoliticalTraitIndustrialist"/>
        <Trait Name="PopulationPoliticalTraitAntiEcologist"/>
        <Trait Name="PopulationPoliticalTraitScientificToIndustrialist"/>

        <Trait Name="PopulationModifiersTraitPulsosCount"/>
            <Trait Name="PopulationModifiersTraitTest"/>

        <Trait Name="PopulationModifiersTraitPrimaryIndustry"/>
        <Trait Name="PopulationModifiersTraitSecondaryScienceAnomaly02"/>

        <Trait Name="PopulationCollectionBonusTraitTest" />
       
        <Desires>
       
        </Desires>

        <Wills>
       
        </Wills>

        <AffinityMapping Name="AffinityMappingTest"/>

        <GrowthBoostLuxuryOptions>
            <Luxury>Luxury1</Luxury>
            <Luxury>Luxury2</Luxury>
            <Luxury>Luxury3</Luxury>
            <Luxury>Luxury4</Luxury>
            <Luxury>Luxury5</Luxury>
            <Luxury>Luxury6</Luxury>
            <Luxury>Luxury7</Luxury>
            <Luxury>Luxury8</Luxury>
        </GrowthBoostLuxuryOptions>
    </PopulationDefinition>

My PopulationModifiersTraits.xml:

<PopulationModifiersTrait Name="PopulationModifiersTraitTest" SubCategory="Affinity" ShowInCustom="false">
        <Modifiers>
            <Modifier Class="ClassPopulationEmpire">
                <SimulationDescriptorReference Name="ClassPopulationEmpireAffinityTest"/>
            </Modifier>
            <Modifier Class="ClassPopulationStarSystem">
                <SimulationDescriptorReference Name="ClassPopulationStarSystemGrowthTypeDust"/>
                <SimulationDescriptorReference Name="ClassPopulationStarSystemAffinityTest"/>
            </Modifier>
        </Modifiers>

        <AssimilatedModifiers>
            <Modifier Class="ClassPopulationEmpire">
                <SimulationDescriptorReference Name="ClassPopulationAssimilatedEmpireAffinityPulsos"/>
            </Modifier>
        </AssimilatedModifiers>
    </PopulationModifiersTrait>
   
    <PopulationModifiersTrait Name="PopulationModifiersTraitTestCount" SubCategory="Count">
        <Modifiers>
            <Modifier Class="ClassPopulationPlanet">
                <SimulationDescriptorReference Name="ClassPopulationPlanetAffinityTestCount"/>
            </Modifier>
            <Modifier Class="ClassPopulationStarSystem">
                <SimulationDescriptorReference Name="ClassPopulationStarSystemAffinityTestCount"/>
            </Modifier>
            <Modifier Class="ClassPopulationEmpire">
                <SimulationDescriptorReference Name="ClassPopulationEmpireAffinityTestCount"/>
            </Modifier>
        </Modifiers>
    </PopulationModifiersTrait>

My FleetNameMappingDefinitions.xml:

<FleetNameMappingDefinition Name="AffinityMappingTest">
        <FleetNameTitle LocalizationKey="%MinorFactionTestTitle">
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor00" />
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor01" />
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor02" />
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor03" />
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor04" />
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor05" />
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor06" />
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor07" />
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor08" />
            <FleetNameAdjective LocalizationKey="%FleetNameAdjectiveMinor09" />
        </FleetNameTitle>
    </FleetNameMappingDefinition>

My PopulationCollectionBonusTraits.xml:

<PopulationCollectionBonusTrait Name="PopulationCollectionBonusTraitTest" Cost="0" ShowInCustom="false">
        <CollectionBonus Threshold="10">
            <SimulationDescriptorReference Name="PopulationCollectionBonusTest1"/>
            <SimulationDescriptorReference Name="PopulationCollectionBonusLevel1"/>
        </CollectionBonus>

        <CollectionBonus Threshold="20">
            <SimulationDescriptorReference Name="PopulationCollectionBonusTest2"/>
            <SimulationDescriptorReference Name="PopulationCollectionBonusLevel2"/>
        </CollectionBonus>

        <CollectionBonus Threshold="50">
            <SimulationDescriptorReference Name="PopulationCollectionBonusTest3"/>
            <SimulationDescriptorReference Name="PopulationCollectionBonusLevel3"/>
        </CollectionBonus>
    </PopulationCollectionBonusTrait>

My SimulationDescriptors:

<SimulationDescriptor Name="AffinityTest" Type="Affinity"></SimulationDescriptor>

    <SimulationDescriptor Name="ClassPopulationEmpireAffinityTest" Type="ClassPopulationEmpire"/>
   
    <SimulationDescriptor Name="ClassPopulationStarSystemAffinityTest" Type="ClassPopulationStarSystem"/>
   
    <Property Name="PopulationCountTest" BaseValue="0" />
   
    <SimulationDescriptor Name="ClassPopulationPlanetAffinityTestCount" Type="ClassPopulationPlanet">
        <Modifier       TargetProperty="PopulationCount"          Operation="Addition"    Value="$(PopulationCount)" Path="../ClassStarSystem/ClassPopulation,ClassPopulationStarSystemAffinityTestCount" TooltipHidden="true"/>
        <Modifier       TargetProperty="PopulationCountTest"    Operation="Addition"    Value="$(PopulationCount)" Path="../ClassPlanet"  TooltipHidden="true"/>
    </SimulationDescriptor>

    <SimulationDescriptor Name="ClassPopulationStarSystemAffinityTestCount" Type="ClassPopulationStarSystem">
        <Modifier         TargetProperty="PopulationCount"             Operation="Addition"     Value="$(PopulationCount)" Path="./!ClassExploitedStarSystem/../ClassEmpire/ClassPopulation,ClassPopulationEmpireAffinityTestCount" TooltipHidden="true"/>
    </SimulationDescriptor>

    <SimulationDescriptor Name="ClassPopulationEmpireAffinityTestCount" Type="ClassPopulationEmpire">
        <Modifier TargetProperty="NetPopulationScore" Operation="Multiplication" Value="$(PopulationGrowthScoreModifier)" Path="../ClassEmpire/ClassColonizedStarSystem/ClassPopulationStarSystemAffinityTestCount" Priority="100" TooltipHidden="true"/>
    </SimulationDescriptor>
   
    <SimulationDescriptor Name="ClassPopulationAssimilatedPlanetFood01" Type="ClassPopulationAssimilated">
        <Modifier TargetProperty="BonusPopulationFood"          Operation="Addition"    Value="3" Priority="-3" Path="ClassPopulation"/>
        <Modifier TargetProperty="BonusPopulationIndustry"          Operation="Addition"    Value="3" Priority="-3" Path="ClassPopulation"/>
    </SimulationDescriptor>
   
    <SimulationDescriptor Name="FactionTraitMinorTest"    Type="FactionTrait"/>
   
    <SimulationDescriptor Name="AffinityMappingTest" Type="AffinityMapping"/>
   
    <SimulationDescriptor Name="PopulationCollectionBonusTraitTest" Type="PopulationCollectionBonusTrait"/>
    <SimulationDescriptor Name="PopulationCollectionBonusTest1" Type="PopulationCollectionBonus">
        <Modifier TargetProperty="Politics01ToPolitics01" Operation="Addition" Value="8" Path="../ClassEmpire/ClassPopulation,PopulationCollectionBonusTraitTest"/>
    </SimulationDescriptor>
    <SimulationDescriptor Name="PopulationCollectionBonusTest2" Type="PopulationCollectionBonus">
        <Modifier TargetProperty="SystemProductionBonusFromCollection" Operation="Addition" Value="0.15" Path="../ClassEmpire/ClassStarSystem/ClassPopulation,PopulationCollectionBonusTraitTest" SearchValueFromPath="true"/>
    </SimulationDescriptor>
    <SimulationDescriptor Name="PopulationCollectionBonusTest3" Type="PopulationCollectionBonus">
        <Modifier TargetProperty="TechnologyCostReduction"         Operation="Addition" Value="-0.2" Path="../ClassEmpire/ClassResearch"/>
    </SimulationDescriptor>

I dont think the problem lies withing the GuiElements and my Localization.xml, but to be sure:

<ExtendedGuiElement Name="AffinityTest">
        <Title>%AffinityTestTitle</Title>
        <Description>%AffinityTestDescription</Description>
        <Icons>
            <Icon Size="Small" Path="Gui/Test_Small" />
            <Icon Size="Medium" Path="Gui/Test_Medium" />
            <Icon Size="MediumInverted" Path="Gui/Test_Medium_Inverted" />
            <Icon Size="Large" Path="Gui/Test_Large" />
        </Icons>
        <SymbolString>[cravers]</SymbolString>
        <Color Red="255" Green="141" Blue="102" Alpha="255&quo

0Send private message
7 years ago
Apr 20, 2018, 9:08:03 AM

Ah, I see the issue! 

Because of the game's architecture, PopulationModifiersTraits and PopulationCollectionBonusTraits must be declared like this in the DatabasePlugins:

<DatabasePlugin DataType="PopulationTrait, Assembly-CSharp">
    <ExtraTypes>
        <ExtraType DataType="PopulationPoliticalTraitDefinition, Assembly-CSharp"/>
        <ExtraType DataType="PopulationModifiersTrait, Assembly-CSharp"/>
        <ExtraType DataType="PopulationCollectionBonusTrait, Assembly-CSharp"/>
    </ExtraTypes>
    <FilePath>Simulations/PopulationModifiersTraits.xml</FilePath>
    <FilePath>Simulations/PopulationCollectionBonusTraits.xml</FilePath>
</DatabasePlugin>

They are a subtype of PopulationTrait and must be listed as such because of how they are used in the game's code.

Also, your PopulationDefinition still references PopulationModifiersTraitPulsosCount instead of PopulationModifiersTraitTestCount and I don't think this is intended.

And in PopulationModifiersTraitTest, there is a reference to ClassPopulationAssimilatedEmpireAffinityPulsos and I don't know if this is supposed to be the case.

0Send private message
7 years ago
Apr 22, 2018, 12:51:52 PM

Thank you very much! 

Now it works!


You were also right with that the PopulationModifiersTraitPulsosCount  wasn't intendet to be used here. I forgot to change that.


I only have 2 issues more to solve.


1. The Symbol:

The Population symbol seems to be not custamizable in the Population Overview. I can only use Symbols, which are already in the game, because of the SymbolString.

How can I create my own SymbolString with my self created Symbols in the Population Overview. In the other areas with Population Symbols, my own Symbol is shown without SymbolString. 


<ExtendedGuiElement Name="AffinityTest">
        <Title>%AffinityTestTitle</Title>
        <Description>%AffinityTestDescription</Description>
        <Icons>
            <Icon Size="Small" Path="Gui/Test_Small" />
            <Icon Size="Medium" Path="Gui/Test_Medium" />
            <Icon Size="MediumInverted" Path="Gui/Test_Medium_Inverted" />
            <Icon Size="Large" Path="Gui/Test_Large" />
        </Icons>
        <SymbolString>[test]</SymbolString>
        <Color Red="255" Green="141" Blue="102" Alpha="255" />
    </ExtendedGuiElement>


2. Minor Faction:

I wanted to create my own Minor Faction with my new Population, but now my game doesn't load and the logs say: 

"ArgumentOutOfRangeException: Argument is out of range. Parameter name: index".


So how can I create my own Minor Faction with my own population without freezing the game?


Here is my code so far:



RuntimeModule:

<DatabasePlugin DataType="GalaxyGeneratorWeightTableDefinition, Assembly-CSharp">
        <FilePath>GalaxyGenerator/WeightTableDefinitions.xml</FilePath>
      </DatabasePlugin>

      <DatabasePlugin DataType="Faction, Assembly-CSharp">
        <ExtraTypes>
          <ExtraType DataType="MinorFaction, Assembly-CSharp" />
        </ExtraTypes>
        <FilePath>Simulations/Factions[MinorFactionsTestMod].xml</FilePath>
      </DatabasePlugin>

      <DatabasePlugin DataType="FactionTrait, Assembly-CSharp" Priority="20">
        <ExtraTypes>
          <ExtraType DataType="FactionAffinity, Assembly-CSharp" />
          <ExtraType DataType="FactionAffinityMapping, Assembly-CSharp" />
          <ExtraType DataType="FactionPopulationTrait, Assembly-CSharp" />
        </ExtraTypes>
        <FilePath>Simulations/FactionTraits[MinorFactionsTestMod].xml</FilePath>
      </DatabasePlugin>

      <DatabasePlugin DataType="MinorFactionPersonalityDefinition, Assembly-CSharp">
        <FilePath>Simulations/MinorFactionPersonalityDefinitions.xml</FilePath>
      </DatabasePlugin>

My WeightTableDefinitions: (Maybe I have to implement the PlanetType of the Faction elswhere as well?)

<GalaxyGeneratorWeightTable Name="MinorFactions">
        <Entry Tag="MinorFactionTest"         Weight="1"/>
    </GalaxyGeneratorWeightTable>

  <GalaxyGeneratorWeightTable Name="MinorFactionTest_PlanetTypes">
      <Entry Tag="PlanetTypeTerran"             Weight="1"/>
  </GalaxyGeneratorWeightTable>

My Factions.xml:

<MinorFaction Name="MinorFactionTest" Standard="true" Author="Julze" Priority="100">
        <Affinity Name="AffinityGameplayTest"/>

        <Trait Name="FamilyPirates"/>
        <Trait Name="IsMinorFaction"/>
        <MajorPopulation Affinity="AffinityTest" Count="2"/>

        <Personality Name="FactionPersonalityTest"/>
        <Politics Name="Politics01"/>

        <ColonizablePlanet Type="PlanetTypeBarren" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeArctic" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeSteppes" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeArid" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeDesert" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeAsh" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeSnow" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeTundra" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeTerran" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeVeldt" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeTropical" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeBoreal" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeForest" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeMonsoon" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeSwamp" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeJungle" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeLava" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeIce" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeOcean" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeAtoll" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeGasFrozen" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeGasCold" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeGasTemperate" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeGasWarm" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeGasHot" Priority="0"/>
        <ColonizablePlanet Type="PlanetTypeGasBurning" Priority="0"/>
    </MinorFaction>

FactionTraits:

<FactionAffinity Name="AffinityGameplayTest" SubCategory="MinorFactionAffinity" Hidden="false" Cost="80">
    <Command Name="TransferResources"               Arguments="EmpireManpower,1000"/>
    <Command Name="SetHomeSystemManpowerPercentage" Arguments="1"/>
    <Command Name="UnlockPlay"                      Arguments="PlayDefensiveBalancedShortRangeDefense"/>
    <Command Name="UnlockPlay"                      Arguments="PlayDefensiveShortHullPlatingIncrease"/>

    <Command Name="UnlockBattleAction"              Arguments="Group_ComputeShipExperience"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_OnEnemyShipDestruction"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_SetInitialMilitaryPower"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_ComputeEndBattleStatus"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_Retreat"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_Retreat_RecoverMovementPoint"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_ReinforcementFlotilla_OnOwnShipDestruction"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_MainFlotilla_OnOwnShipDestruction"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_SetInitialMoraleBonus"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_OnEnemyFlotillaDestruction"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_OnFlotillaDestruction"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_ReportFlotillaDamageAppliedCurrentPhase"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_PhaseRepairShipCoreSection"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_RepairShipCoreSection"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_OnEnemyShipDeactivation"/>
    <Command Name="UnlockBattleAction"              Arguments="Group_MainFlotilla_OnOwnShipDeactivation"/>

    <SimulationDescriptorReference Name="AffinityTest"/>
    <AutomatedShip>ShipDesignAutomatedShip</AutomatedShip>
  </FactionAffinity>

MinorFactionPersonalityDefinitions.xml:

<MinorFactionPersonalityDefinition Name="FactionPersonalityTest">
    <MajorTrait Name="PersonalityTraitPacifist"/>
    <MinorTrait Weight="50">
      <Trait Name="FactionTraitMinorCuriousThinkers01"/>
    </MinorTrait>
    <MinorTrait Weight="20">
      <Trait Name="FactionTraitMinorCuriousThinkers02"/>
    </MinorTrait>
  </MinorFactionPersonalityDefinition>

0Send private message
7 years ago
Apr 23, 2018, 7:59:44 AM

Unfortunately you can't easily modify the symbols: they are in the font, and I don't even know myself how to edit it. 

Maybe you can use existing symbols but I think we have only letters (latin, cyrillic, chinese, japanese & korean) available and currently unused...


As for the error on the minor faction definition, can you copy the entire error, including the lines in code that follow the message?

I think it comes from this:

<GalaxyGeneratorWeightTable Name="MinorFactions">
        <Entry Tag="MinorFactionTest"         Weight="1"/>
</GalaxyGeneratorWeightTable>

You have to include all the existing minor factions in this list, because the list you declare here replaces the existing one and this may be why the error happens.

Updated 7 years ago.
0Send private message
7 years ago
Apr 29, 2018, 6:06:50 PM

Too bad that the symbols are not so easily modifiable.

But the already existing symbols should do it for now.

What are their SymbolStrings? I could not figure it out myself, as they are not used yet. Could you please give some examples? 



Here are the codelines that follow my error message:


ArgumentOutOfRangeException: Argument is out of range. Parameter name: index
 at UnityEngineLogCallback in Error while parsing stackframe: System.Collections.Generic.List`1[System.String].get_Item (Int32 index):line 0 at UnityEngineLogCallback in Error while parsing stackframe: Generator.EmpiresManager.Execute ():line 0 at UnityEngineLogCallback in Error while parsing stackframe: Generator.GenerationManager+c__Iterator0.MoveNext ():line 0 at UnityEngineLogCallback in Error while parsing stackframe: UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress):line 0

With further testing I found out that not all MinorFactions have to be included. 

The game does not crash if I only have the Pulsos faction in the GalaxyGeneratorWeightTable. 

But the game does not crash if I have other factions included, in addition to my test faction. However, my faction never shows up.

0Send private message
7 years ago
May 3, 2018, 7:59:20 AM

SymbolStrings can be anything actually: right now, they are mostly stuff like [foodColored] because it's the key of a GuiSpecialCharacter which will replace it with #b0c65d##REVERT#.

I'd recommend putting all the characters you can in a SymbolString and see which work.


I used this application (I don't know how it's named in english but it's installed by default in Windows7):

 


I looked for some "exotic" symbols, and I copy-pasted "ЂԺج" in some variable's SymbolString and had this result:


Only the first one is supported by the font, but luckily there are a lot of other symbols, so there's more research to do.


Your faction not showing up is odd, can you send me your mod files so I investigate the issue?

Updated 7 years ago.
0Send private message
7 years ago
May 4, 2018, 12:59:03 PM

Using characters from the Character Map (that is the name for it in english) works perfectly fine. Thank you for that suggestion :D


I figured out, that the error message I had from using my faction as only faction in the GalaxyGeneratorWeightTable is the same error message, as if I have no factions in the GalaxyGeneratorWeightTable. Maybe I missed something. Maybe a wrong datatype again.


I put my complete code in a zip file: MinorFactionsTest.zip

I hope you can figure out the problem.

0Send private message
7 years ago
May 7, 2018, 12:48:59 PM

Ah, the issue seems to be that your faction is in the list of Factions, but not in the list of MinorFactions...

You just need to add this, fill the GalaxyGeneratorWeightTable "MinorFactions" with the vanilla minor factions + your faction and it should be fine!


<DatabasePlugin DataType="Faction, Assembly-CSharp">
    <ExtraTypes>
        <ExtraType DataType="MinorFaction, Assembly-CSharp" />
    </ExtraTypes>
    <FilePath>Simulations/Factions[MinorFactionsTestMod].xml</FilePath>
</DatabasePlugin>

<DatabasePlugin DataType="MinorFaction, Assembly-CSharp">
    <FilePath>Simulations/Factions[MinorFactionsTestMod].xml</FilePath>
</DatabasePlugin>


0Send private message
7 years ago
May 16, 2018, 4:17:04 PM

Thank you very much.

After very long testing sessions and some minor Gui-problems that I could fix myself, the custom minor faction and its custom population works now perfectly fine.




Updated 7 years ago.
0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message