# How can I add a trait to PCGen?

I'd really like to add a trait to PCGEN that gives your character two primary claw attacks (1d6). Is there any way to do this?

• Welcome to the site! Great first question. – Miniman Aug 18 '15 at 5:39
• This is tagged racial-traits, but you talk of just trait. These are completely different things, and thus the answers might differ depending on which it is. ("Race Traits" are of the latter variety, btw.) Can you edit your question to make clear which one you mean? – MrLemon Aug 18 '15 at 8:05

By looking into the inner workings of PCGen, I have manage to cobble something together that seems to do the trick. However, this answer is in no way comprehensive, but meant to serve as a guide on how to patch your own homebrew stuff. For more information about working with Homebrew files, I suggest looking into the documentation (Help -> Documentation, F1), under the "List Files" heading (Sadly, I cannot link to specific pages of the documentation here).

### Quick Example

The following is an explanation on how to add a Combat Trait called "Homebrew Trait" to the game, which adds two claw attacks dealing 1d4 points of damage. This is achieved mostly by combining an existing Combat Trait with the claw attacks granted by the Maw or Claw Tiefling Alternate Racial trait, found in [PCGen]/data/pathfinder/paizo/roleplaying_game/advanced_players_guide/apg_abilities.lst and advanced_race_guide/arg_abilities_race.lst, respectively.

1. Open up [PCGen]/data/pathfinder/homebrew/my_homebrew. This is the pre-installed Homebrew Campaign Thingy, which will do just fine for this purpose.

2. Traits are internally handled as "abilities". Using a good text editor (Notepad++ or similar), open up my_abilities.lst. Under #insert your data here, add the following line

Homebrew Trait      KEY:Trait ~ Homebrew Trait      CATEGORY:Special Ability    TYPE:Trait.BasicTrait.CombatTrait   PREMULT:1,[PREABILITY:1,CATEGORY=Special Ability,Trait ~ Homebrew Trait],[!PREABILITY:1,CATEGORY=Special Ability,TYPE.CombatTrait]      DESC:You have studied the workings of PCGen and managed to claw your way into creating a homebrew trait|PRERULE:1,DisplayFullAbility        NATURALATTACKS:Claw,Natural.Weapon.Melee.Finesseable.Piercing,*2,1d4

1. Once you have your ability to your liking, save the file and open up PCGen. Go To Sources -> Select Sources (CtrlL), and go to the Advanced tab. In the dropdown list at the top, select Pathfinder RPG as your Game. On the right side, you should now see "Pathfinder RPG for Players", as well as "My Pathfinder Campaign". Click on Load. Your homebrew trait should now be available to choose from the list of traits.

### Code explanation

Of course, a trait called "Homebrew Trait" is not very appealing, but again, a full explanation is absolutely beyond the scope of this answer. However, I'd like to provide an overview on what the above code does, and why it does that. Let's break it into lines.

Homebrew Trait
KEY:Trait ~ Homebrew Trait
CATEGORY:Special Ability
TYPE:Trait.BasicTrait.CombatTrait
PREMULT:1,[PREABILITY:1,CATEGORY=Special Ability,Trait ~ Homebrew Trait],[!PREABILITY:1,CATEGORY=Special Ability,TYPE.CombatTrait]
DESC:You have studied the workings of PCGen and managed to claw your way into creating a homebrew trait.|PRERULE:1,DisplayFullAbility
NATURALATTACKS:Claw,Natural.Weapon.Melee.Finesseable.Piercing,*2,1d4

1. It starts off with the name of the ability, "Homebrew Trait"
2. Next up is the KEY keyword, followed by the internal name of the trait, allowing you to use this trait in other homebrew things, as a prerequisite for a feat, for example. I followed the naming convention I found in other *abilities.lst files.
3. The CATEGORY tag is there to list this under Special Abilities, nothing much to say here.
4. The TYPE tag is more involved. This is a dot-separated list of subcategories this Special Ability falls under. In this case, we have a trait which is a basic trait, and which is a combat trait. You can change the latter to what you like, but you'll have to change the prerequisites as well.
5. The line starting with PRExxx denotes prerequisites. PREMULT:1 states that only one of the following prerequisites need to be fulfilled. The prerequisites are given in square brackets.
• PREABILITY:1,CATEGORY=Special Ability,Trait ~ Homebrew Trait means that you qualify for this trait when you have this trait. In particular, it means 1 prerequisite ability from the Special Ability category, which is "Trait ~ Homebrew Trait". This is needed because of the second prerequisite.
• !PREABILITY:1,CATEGORY=Special Ability,TYPE.CombatTrait means "Not 1 Special Ability pf the CombatTrait type, as per the trait rules. Without the first prerequisite, this would make the trait disallow itself.
6. DESC is followed by the full description of the trait. Not sure what the PRERULE part does, just keep it there.
7. Finally, NATURALATTACKS adds the crunch. I copied this part from a Tiefling Alternate Racial Trait. It adds an attack called "Claw", lists the applicable types (see above), makes it 2 attacks, and sets the damage to 1d4. Instead of this (or in addition to!), you could have a BONUS tag, as many other abilities do.
• @KorvinStarmast Oh yeah, you can totally just change that part of the line to 1d6 if you want. – MrLemon Aug 20 '15 at 14:23