Ludeon Forums

RimWorld => Mods => Help => Topic started by: KBraid on January 08, 2019, 06:57:41 PM

Title: trying to make an alien race mod, not sure what i'm doing wrong
Post by: KBraid on January 08, 2019, 06:57:41 PM
I've tried to make my own race mod, i started by stripping down the Callistan race mod for a base and following the Alien Framework's provided tutorial, but whenever i try to play a new game with my mod enabled the planet won't load.

Could someone help me figure out what i'm missing or what i've done wrong?

[attachment deleted due to age]
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: LWM on January 12, 2019, 02:10:59 PM
You'll get better answers if you're more specific than "won't load."  E.g., logs?
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: KBraid on January 12, 2019, 08:38:44 PM
apologies. i have no excuse as to not include it, i should have remembered that posting logs is standard procedure.
https://pastebin.com/HZnsDeZU
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: LWM on January 12, 2019, 09:51:34 PM
Your first major error ("exception") in your log file is here:

    Exception reading Bodies_Peglaci.xml as XML: System.Xml.XmlException: 'li' is expected  Line 600, position 18.

That probably keeps the entire race from being loaded, so pawns are failing to be generated.  I even tells you line number, position, etc - v helpful!

--LWM
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: KBraid on January 12, 2019, 10:15:14 PM
i've fixed both 'li' errors, but now i'm not sure what to do next https://pastebin.com/8GpzSPY0
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: LWM on January 12, 2019, 11:36:54 PM
What you do next is make sure your XML is very nicely arranged in a text file with lots of whitespace:

<parts>
    <li>
        <def>Ribcage</def>
<coverage>0.036</coverage>
<depth>Inside</depth>
<groups>
    <li>Torso</li>
</groups>
    </li>
    <li>
        ...etc


And then you hope that the error messages you get are a little more specific and you can find out what's wrong more easily.  Whitespace and patience.  Lots of patience.

Also, your XML is incorrect in (at least) one spot - if you search for "</li><parts>" in your XML, you should find it.  I'm pretty sure those tags don't belong next to each other.

Good luck, and I recommend a nice strong cup of tea and a pleasant place to sit for a while.

--LWM
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: KBraid on January 13, 2019, 07:29:16 PM
i managed to find all the xml code mistakes, now i need to figure out what this means. https://pastebin.com/KF7PQRWU
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: KBraid on January 14, 2019, 01:30:54 AM
i've been able to thin it down this far on my own, though i can't figure out how to solve the rest. https://pastebin.com/uJE5Q28T
i've included the updated files if that help

[attachment deleted due to age]
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: LWM on January 22, 2019, 02:07:38 PM
Your first error there, the could not resolve cross reference?  I ran into that when I had the wrong <defName> that I was trying to reference.  Or maybe it needed <thingDef .... Name="<needed name>">?  But I think it was a mistaken defName.  Make sure whatever is supposed to be the def for "Peglaci" - not the race? is correct.

--LWM
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: KBraid on January 22, 2019, 05:47:55 PM
so what you are saying is that these def names are wrong and should be something else? Or am i misinterpreting?
-----------------------------------------------------------------------
<Defs>
   <AlienRace.ThingDef_AlienRace ParentName="BasePawn">
        <defName>Alien_Peglaci</defName>
        <label>Peglaci</label>
        <description>A baseline Peglaci, mostly unmodified by gene engineering and mostly unchanged by evolutionary pressures on non-Peglaci planets. A resilient, cold-dwelling omnivorous race that see themselves as the peasekeepers of the galaxy.</description>
-------------------------------------------------------------------------
  <PawnKindDef Abstract="True" Name="BasePlayerPawnKind">
    <race>Peglaci</race>
    <combatPower>40</combatPower>
    <isFighter>true</isFighter>
    <apparelIgnoreSeasons>true</apparelIgnoreSeasons>
    <forceNormalGearQuality>true</forceNormalGearQuality>
  </PawnKindDef>

  <PawnKindDef ParentName="BasePlayerPawnKind">
    <defName>Alien_Peglaci</defName>
    <label>Peglaci</label>
    <defaultFactionType>PlayerColony</defaultFactionType>
------------------------------------------------------------------------
<Defs>
  <BodyDef>
    <defName>Alien_Peglaci</defName>
    <label>Peglaci</label>
    <corePart>
      <def>Torso</def>
      <height>Middle</height>
      <depth>Outside</depth>
      <groups>
        <li>Torso</li>
      </groups>
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: Mehni on January 23, 2019, 07:32:26 AM
QuoteCould not resolve cross-reference: No Verse.ThingDef named Peglaci found to give to Verse.PawnKindDef Peglaci

The <race> tag in the PawnKindDef should point to a ThingDef. The error means RimWorld can't find a ThingDef with the Peglaci defName, which is right: You've named it Alien_Peglaci.

Your inclusion of the "BasePlayerPawnKind" will also cause a lot of compatibility errors: you're effectively changing all the BasePlayerPawnKind for all mods loaded after your mod. Rename it to something original.
Title: Re: trying to make an alien race mod, not sure what i'm doing wrong
Post by: KBraid on January 23, 2019, 03:58:02 PM
i've managed to reduce the amount of errors down to these five, if i could figure out what they mean i think i can finally get my mod into a working state.
https://pastebin.com/RsdWdCfC

edit, if it helps here's the updated files below

[attachment deleted due to age]