Error Help Please: Cannot get faction OfPlayer

Started by QuantumX, October 14, 2016, 10:41:22 AM

Previous topic - Next topic

QuantumX

Hello..

I'm creating a new faction, and everything seems to ok except for the following error when i generate a new map (and i assume factions).



The issues seems to be with getting the name of the leader of the faction. I have custom names set for all the others in the factions and those names seem to work when i force a raid by the new faction. But the name of the Faction Leader has my defined title "leader" but the name does not match any of my namemakers.

Here are my factions file:

<?xml version="1.0" encoding="utf-8" ?>
<FactionDefs>

<!--QX==================== Imperial Guard Traitor Guard Faction Addon Mod - Traitor Guard Faction Definition =========================QX-->
<FactionDef>
<defName>TraitorGuardFaction</defName>
<label>Traitor Guard Regiment</label>
<description>The Traitor Guard are among the better armed and minded troops that Chaos Champions and/or Arch-Heretics have at their disposal in order to fulfil their own agendas, Champions of Chaos draw lesser Chaos followers to them to form their own personal armies, which can vary tremendously in size and strength. These traitors, unlike other mutants and other vile Beastmen, have not completely lost their military skills or sanity, forming a reasonably reliable core force amongst the slavering hordes of the Lost and Damned armies...</description>
<pawnsPlural>traitor guard</pawnsPlural>
<requiredCountAtGameStart>1</requiredCountAtGameStart>
<canMakeRandomly>false</canMakeRandomly>
<raidCommonality>120</raidCommonality>
<humanlikeFaction>true</humanlikeFaction>
<hidden>false</hidden>
<canStageAttacks>true</canStageAttacks>
<leaderTitle>Captain</leaderTitle>
<appreciative>false</appreciative>
<canFlee>false</canFlee>
<startingGoodwill> <!-- Never Can Be Friendly -->
<min>-100</min>
<max>-100</max>
</startingGoodwill>
<naturalColonyGoodwill> <!-- Never Can Be Friendly -->
<min>-100</min>
<max>-100</max>
</naturalColonyGoodwill>
<earliestRaidDays>25</earliestRaidDays>
<factionNameMaker>NamerIGFTraitorGuardFaction</factionNameMaker>
<pawnNameMaker>NamerIGTraitorGuardPawns</pawnNameMaker>
<techLevel>Spacer</techLevel>
<backstoryCategory>Raider</backstoryCategory>
<hairTags>
<li>Urban</li>
<li>Rural</li>
</hairTags>
<allowedArrivalTemperatureRange>
<min>-55</min>
<max>65</max>
</allowedArrivalTemperatureRange>
<mustStartOneEnemy>true</mustStartOneEnemy>
<pawnGroupMakers>
<li Class="PawnGroupMaker_Normal">
<commonality>100</commonality>
<options>
  <TGSolider>100</TGSolider> <!-- Higher More Comment Lower Less Common -->
  <TGHeavySoldier>50</TGHeavySoldier>
  <TGGrenadier>20</TGGrenadier>
  <TGStormTrooper>10</TGStormTrooper>
  <TGCaptain>5</TGCaptain>
</options>
</li>
<li Class="PawnGroupMaker_Normal">
<commonality>50</commonality>
<options>
  <TGSolider>80</TGSolider> <!-- Higher More Comment Lower Less Common -->
  <TGHeavySoldier>80</TGHeavySoldier>
  <TGGrenadier>40</TGGrenadier>
  <TGStormTrooper>20</TGStormTrooper>
  <TGCaptain>10</TGCaptain>
</options>
</li>
<li Class="PawnGroupMaker_Normal">
<commonality>15</commonality>
<options>
  <TGSolider>50</TGSolider> <!-- Higher More Comment Lower Less Common -->
  <TGHeavySoldier>80</TGHeavySoldier>
  <TGGrenadier>50</TGGrenadier>
  <TGStormTrooper>50</TGStormTrooper>
  <TGCaptain>25</TGCaptain>
</options>
</li>
</pawnGroupMakers>
<homeIconPath>Things/IGFTraitorGuard/Icons/TraitorGuardIcon</homeIconPath>
<homeIconColor>(128,0,0)</homeIconColor> <!-- PICK A NEW HOME COLOUR -->
  </FactionDef>

</FactionDefs>


PawnKinds File
<?xml version="1.0" encoding="utf-8" ?>
<PawnKindDefs>

<PawnKindDef Abstract="True" Name="TraitorBase" >
<race>Human</race>
<defaultFactionType>TraitorGuardFaction</defaultFactionType>
<baseRecruitDifficulty>1</baseRecruitDifficulty>
<backstoryCategory>Raider</backstoryCategory>
<invNutrition>2.50</invNutrition>
<itemQuality>Normal</itemQuality>
<backstoryCryptosleepCommonality>0.3</backstoryCryptosleepCommonality>
<maxGenerationAge>50</maxGenerationAge>
<gearHealthRange>
<min>0.75</min>
<max>1</max>
</gearHealthRange>
<apparelMoney>
<min>1150</min>
<max>1150</max>
</apparelMoney>
<apparelRequired>
<li>IGJumpSuit</li>
<li>TG_StdArmor</li>
<li>TG_StdHelmet</li>
</apparelRequired>
<apparelAllowHeadwearChance>0.5</apparelAllowHeadwearChance> <!-- Do i need this line? -->
<weaponMoney>
<min>3100</min>
<max>3100</max>
</weaponMoney>
<inventoryOptions>
  <skipChance>0.01</skipChance>
<subOptionsChooseOne>
<li>
<thingDef>Gold</thingDef>
<countRange>
<min>20</min>
<max>50</max>
</countRange>
</li>
<li>
<thingDef>Medicine</thingDef>
<countRange>
<min>1</min>
<max>1</max>
</countRange>
</li>
</subOptionsChooseOne>
</inventoryOptions>
</PawnKindDef>

<PawnKindDef ParentName="TraitorBase">
<defName>TGSolider</defName>
<label>Traitor Guard Soldier</label>
<weaponTags>
<li>LasGun</li>
</weaponTags>
<combatPower>25</combatPower>
</PawnKindDef>

<PawnKindDef ParentName="TraitorBase">
<defName>TGHeavySoldier</defName>
<label>Traitor Guard Heavy</label>
<weaponTags>
<li>BoltGun</li>
</weaponTags>
<combatPower>35</combatPower>
</PawnKindDef>

<PawnKindDef ParentName="TraitorBase">
<defName>TGGrenadier</defName>
<label>Traitor Guard Grenadier</label>
<weaponTags>
<li>ImpGrenadeLauncher</li>
<li>GrenadeDestructive</li>
</weaponTags>
<combatPower>35</combatPower>
</PawnKindDef>

<PawnKindDef ParentName="TraitorBase">
<defName>TGStormTrooper</defName>
<label>Traitor Guard Stormtrooper</label>
<weaponTags>
<li>ExitusSniper</li>
<li>ImpQuadRocketLauncher</li>
</weaponTags>
<combatPower>40</combatPower>
</PawnKindDef>

<PawnKindDef ParentName="TraitorBase">
<defName>TGCaptain</defName>
<label>Captain</label>
<race>Human</race>
<factionLeader>true</factionLeader>
<combatPower>250</combatPower>
<baseRecruitDifficulty>1</baseRecruitDifficulty>
<backstoryCategory>Raider</backstoryCategory>
<itemQuality>Good</itemQuality>
<gearHealthRange>
<min>1</min>
<max>1</max>
</gearHealthRange>
<apparelMoney>
<min>3100</min>
<max>3100</max>
</apparelMoney>
<apparelRequired>
<li>IGJumpSuit</li>
<li>TG_StdArmor</li>
<li>TG_StdHelmet</li>
<li>TG_FlakPlate</li>
</apparelRequired>
<apparelAllowHeadwearChance>1</apparelAllowHeadwearChance>
<weaponTags>
<li>PlasmaRifle</li>
</weaponTags>
<inventoryOptions>
<skipChance>0.01</skipChance>
<subOptionsChooseOne>
<li>
<thingDef>Gold</thingDef>
<countRange>
<min>200</min>
<max>500</max>
</countRange>
</li>
<li>
<thingDef>Medicine</thingDef>
<countRange>
<min>1</min>
<max>1</max>
</countRange>
</li>
</subOptionsChooseOne>
</inventoryOptions>
</PawnKindDef>

</PawnKindDefs>




NameMaker File

<?xml version="1.0" encoding="utf-8" ?>
<NameMakerDefs>

<RulePackDef>
<defName>NamerIGFTraitorGuardFaction</defName>
<rulePack>
  <rulesStrings>
<li>name->[TGRegiments]</li>
  </rulesStrings>
  <rulesRaw>
<li Class="Rule_File">
<keyword>TGRegiments</keyword>
<path>NameBanks/TGRegiments</path>
</li>
  </rulesRaw>
</rulePack>
</RulePackDef>

<RulePackDef>
<defName>NamerIGTraitorGuardPawns</defName>
<rulePack>
  <rulesStrings>
<li>name->[TGFirst] [TGSurNom]</li>
<li>name->[TGSurNom] [TGFirst]</li>
  </rulesStrings>
  <rulesRaw>
<li Class="Rule_File">
<keyword>TGFirst</keyword>
<path>NameBanks/TGFirst</path>
</li>
<li Class="Rule_File">
<keyword>TGSurNom</keyword>
<path>NameBanks/TGSurNom</path>
</li>
  </rulesRaw>
</rulePack>
</RulePackDef>

</NameMakerDefs>

QuantumX

Seems that the errors i def around the naming of the LEader in the pawnkinds gile

<factionLeader>true</factionLeader>

If set to tru for any pawn there seem to be some kind of naming error. It can be ignored but still.. have checked a few faction mods and they all seem to not have leaders named.

kaptain_kavern

#2
It seems silly but I can't find any errors (just by looking at your defs), have you tried with a CAPITAL "t" for <factionLeader>true</factionLeader>. Looks like the tag is not interpreted. I recall using those tags the same way you have done (for a wh40k mod too ^^)

Edit : no I just checked Core's code and it is written like you do

QuantumX

#3
Its very weird.

I have checked the vanilla files and they specify it just like I do, the problem seems to be in naming the leader. If you leave the "<factionLeader>true</factionLeader>" tag out, the factions spawns no errors with no named leader..

I have tired multiple different things and nothing seems to work, i always get a faction leader working, but he is named using some other file not my nameRules. And thats seems to through up the error.

Atm its bugging (pun intended) the hell outta me :)