Custom Raid Types

Started by Polqanem, August 05, 2023, 03:31:20 AM

Previous topic - Next topic

Polqanem

Hello!

I've modded in a new faction to my game that I want to have a mechanitor feel to it. It shows up on the map and otherwise works completely fine.

I would, however, like it if I could tell it to spawn raids in with custom pawn types? Just like the code for an Impid faction would spawn fire-weapon wielders instead of normal tribals, I would like this faction to spawn in mechanoid combatants alongside human combatants.

While sifting through the code of the Savage Impid Tribe, I saw that custom raid make-ups like the one I'm looking for are contained in something called "pawnGroupMakers". When I copy paste this into my new tribe, however, the entire file seems to stop working and I can't even see it on the map anymore.

TL;DR Does anyone know how to customize the make-up of raids for a modded faction?

Thank you in advance

N3cro0o

What I know you need to create custom XML files for all the members of your faction and then add them in the Faction XML file.

For example here is basic imperial soldier from Royality.
  <PawnKindDef Name="ImperialTrooperBase" Abstract="True" ParentName="ImperialFighterBase">
    <combatPower>65</combatPower>
    <apparelMoney>5000~8000</apparelMoney>
    <weaponTags>
      <li>IndustrialGunAdvanced</li>
    </weaponTags>
    <apparelRequired>
      <li>Apparel_FlakJacket</li>
      <li>Apparel_FlakVest</li>
      <li>Apparel_FlakPants</li>
    </apparelRequired>
    <initialWillRange>2~4</initialWillRange>
  </PawnKindDef>

  <PawnKindDef ParentName="ImperialTrooperBase">
    <defName>Empire_Fighter_Trooper</defName>
    <label>trooper</label>
    <apparelColor>(130,130,130)</apparelColor>
    <specificApparelRequirements>
      <li>
        <bodyPartGroup>UpperHead</bodyPartGroup>
        <alternateTagChoices>
          <li>
            <tag>Gunlink</tag>
            <chance>0.25</chance>
          </li>
        </alternateTagChoices>
      </li>
    </specificApparelRequirements>
    <techHediffsTags>
      <li>ImplantEmpireCommon</li>
    </techHediffsTags>
    <skills>
      <li>
        <skill>Shooting</skill>
        <range>4~10</range>
      </li>
    </skills>
    <disallowedTraits>
      <li>Brawler</li>
    </disallowedTraits>
    <initialResistanceRange>15~24</initialResistanceRange>
    <useFactionXenotypes>false</useFactionXenotypes>
    <xenotypeSet>
      <xenotypeChances>
        <Neanderthal MayRequire="Ludeon.RimWorld.Biotech">0.03</Neanderthal>
        <Hussar MayRequire="Ludeon.RimWorld.Biotech">0.25</Hussar>
        <Genie MayRequire="Ludeon.RimWorld.Biotech">0.03</Genie>
      </xenotypeChances>
    </xenotypeSet>
  </PawnKindDef>

As you can see there are many different options like a chance for a gunlink or what weapon and apparel they can use. Try to find hediffs for mechanitor stuff in Biotech Defs and add them in the XML file. It should work