Ludeon Forums

RimWorld => Mods => Help => Topic started by: Blopbi on August 07, 2016, 03:53:03 PM

Title: Creating traits that are always present on randomisation/small chance of replace
Post by: Blopbi on August 07, 2016, 03:53:03 PM
So - here's my problem. I'm making a mod based on a particular book series, and there's two types of people in it - one of the traits is 'Normal', and the other is "Mutant".

The only reason I'm not just having no 'Normal' trait and just a "Mutant" trait is because the "Normal" trait is going to sometimes trigger a lower mood, and sometimes even fights between the two. Is this a waste of time? Or does this make sense?

Anyways, the main question: how would I get it so that there's always a "Normal" trait, and if the character doesn't have the "Normal" trait, they automatically have the "Mutant" trait?

This is the code so far:
<?xml version="1.0" encoding="utf-8" ?>
<TraitDefs>

  <TraitDef>
    <defName>Mutant</defName>
    <commonality>0.1</commonality>
    <degreeDatas>
      <li>
        <label>mutant</label>
        <description>NAME is a mutant, capable of powers beyond normal human limits. HECAP can be deadly in a   fight; teleport; and are usually capable of other extraordinary powers.</description>
      </li>
    </degreeDatas>
  </TraitDef>

  <TraitDef>
    <defName>Normal</defName>
    <commonality>0.9</commonality>
    <degreeDatas>
      <li>
        <label>normal</label>
        <description>NAME is a 'normal', a term used to describe the citizens that don't possess any mutation or power. HECAP, on occasion, feel downed if HECAP lives with a mutant, due to jealousness or other causes.</description>
      </li>
    </degreeDatas>
  </TraitDef>

Title: Re: Creating traits that are always present on randomisation/small chance of replace
Post by: Blopbi on August 07, 2016, 03:58:05 PM
Hmm, I've added conflicting traits. But still no way to ensure that either one appears on every character.
Title: Re: Creating traits that are always present on randomisation/small chance of replace
Post by: CallMeDio on August 07, 2016, 06:32:33 PM
Now that they are conflicting traits try increasing the commonality of both to a value way bigger than the commonality of any other trait (maybe 1 on both). I believe this will make them be present in every character and as they are conflicting only one will be there.

You will need to start a new game after to check the results because the characters that already exist gonna keep their traits, you can also enable dev mode and spawn a lot of characters to test.