Logo Platform
logo amplifiers simplified

Adding a new selectable icon to the icon list of the custom faction creator

Reply
Copied to clipboard!
7 years ago
May 18, 2018, 1:35:43 PM

How is it possible to add a new selectable icon and increase the number fo selectable icons for the custom factions?



It is possible and not really difficult to change the selectable icons of the custom major factions.


The PopulationIconsOverride and the 3 ClassPopulationAffinityCustomCounts have to be changed:


<ExtendedGuiElement Name="PopulationIconsOverride0">
        <Icons>
            <Icon Size="Small" Path="Gui/Custom00" />
            <Icon Size="Medium" Path="Gui/Custom00" />
            <Icon Size="MediumInverted" Path="Custom00_Inverted" />
        </Icons>
        <SymbolString>A</SymbolString>
    </ExtendedGuiElement>
   
    <ExtendedGuiElement Name="ClassPopulationEmpireAffinityCustom0Count">
        <Title>A</Title>
        <SymbolString>A</SymbolString>
        <Color Red="255" Green="255" Blue="255" Alpha="255" />
        <AltTitle>A</AltTitle>
    </ExtendedGuiElement>
   
    <ExtendedGuiElement Name="ClassPopulationStarSystemAffinityCustom0Count">
        <Title>A</Title>
        <SymbolString>A</SymbolString>
        <Color Red="255" Green="255" Blue="255" Alpha="255" />
        <AltTitle>A</AltTitle>
    </ExtendedGuiElement>
   
    <ExtendedGuiElement Name="ClassPopulationPlanetAffinityCustom0Count">
        <Title>A</Title>
        <SymbolString>A</SymbolString>
        <Color Red="255" Green="255" Blue="255" Alpha="255" />
        <AltTitle>A</AltTitle>
    </ExtendedGuiElement>


But adding new icons that can be selected seems not so easy:


By adding a new ExtendedGuiElement namend PopulationIconsOverride12 a new icon shows up in the icon selection:


The problem is if I start the game with the new icon selected the game crashes.

I even copyed all uses of ClassPopulationEmpireAffinityCustom11Count, ClassPopulationStarSystemAffinityCustom11Count and ClassPopulationPlanetAffinityCustom11Count in the code and changed the number 11 to 12. 

The game crashes again:




Another problem is that after I created a custom faction with the new icon, remove the mod and try to start a new game with this custom faction, the faction has the normal icon of its faction though its a custom faction and the game crashes again by starting a new game.


I hope somebody knows how I can make this work.

0Send private message
7 years ago
May 18, 2018, 1:42:45 PM

I do recall that a custom factions Icon id is used in galaxy generation. Since the Unity error is Array index is out of range I would guess that when processing the faction icon id, it knows what to do when it is 0 or 1-12 but it got given a 13 (I think it would be 13 anyway). Although it could be something else entirely causing this, this is just my guess.

0Send private message
7 years ago
May 18, 2018, 2:07:46 PM

Thank you for your quick response CyRob.

Your guess sounds plausible, but even if it effects the galaxy generation the new icon is shown in the list of the icons and doesnt has the problem there.

Maybe the icon list is handled differently as loading the icons by starting a new game. 


But isnt there a way to extend the Array other or even fix the problem otherwise?

0Send private message
7 years ago
May 21, 2018, 9:19:38 AM

Hey folks!


The error may be due to a missing reference between the PopulationDefinition and the PopulationTraits.

In the function specified in the error, the code assumes there's at least 1 PopulationTrait, but if all the names of the traits are invalid and the list is empty, an error is generated.


Can you look at the Warnings preceding the error in the diagnostics files ? It may give you some information.

0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message