Modding new traits

Started by black-rat, September 14, 2016, 08:59:42 PM

Previous topic - Next topic

black-rat

Hey everyone, new player, first time poster, first time modder.

I'm wanting to get into modding and I want to start small. I was thinking maybe adding traits would be a good place to start. I'm looking around at the XML files right now, but from what I can gather, the actual effects of the traits may require some C# coding?

For example if we look at Psychopath:

  <TraitDef>
    <defName>Psychopath</defName>
    <commonality>0.2</commonality>
    <degreeDatas>
      <li>
        <label>psychopath</label>
        <description>NAME has no empathy. The suffering of others doesn't bother HIM at all. HECAP doesn't mind if others are butchered, left unburied, imprisoned, or sold to slavery - unless it affects HIM. HECAP also feels no mood boost from socializing.</description>
      </li>
    </degreeDatas>
  </TraitDef>


I don't see where the the game would be able to pick up the logic for the actual trait from just this.

Am I wrong in my assumption here?

If not, anyone got an example I can look at?

Thanks.

CannibarRechter

The logic where Pyschopath traits prevent things like remorse is done by reference over in thought defs. Anyway, let me help you help yourself. Here is a powershell command that you should run in your $RIMWORLD/Mods/Core/Defs directory:

ls -recurse *.xml | sls -pattern Psychopath

When you run it, you should see what I mean, and also be able to handle xml modding a bit better in general.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

kaptain_kavern

recurse may be a hint there ^^

CannibarRechter

CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

SpaceDorf

Best ( Are ( Programms ( Recursive ) ) ) )

This will be your new best friend
https://ludeon.com/forums/index.php?topic=21440.0
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker