Starbound

Starbound

72 ratings
Race Traits - Patch Guide
By Oмεяυıп
This handy guide will show you how to properly patch your race into the "Race Traits" mod!
What does this mod do?
It adds subtle differences to your playthrough, depending on the race - such as attribute bonuses, resistance bonuses, immunities, etc.

Warning: This guide expects you to understand basic patching, JSON editing, and file creation.
3
2
6
   
Award
Favorite
Favorited
Unfavorite
Prelude
Before we get started, I want to say...
Thank you for being interested in my mod, "Race Traits"! It means a lot to me!

Before you check out this guide in its entirety, I want you to consider something. I am an active developer/modder right now, so if you really wanted to patch stats in for your/a specific race, you really could just ask me!

Please visit this forum for more information on requesting race support.
Thank you again!

Otherwise, let's get started...
Mod Basics
Creating a Folder/Metadata
Before we can patch anything, we need a place for our patch mod. Let's put it in a simple folder first!
You can name the folder anything you want.

.png]

Then, we need a _metadata in our folder. The metadata is usually created when you try to upload the mod to the Workshop, but I prefer creating mine early.
{ "author" : "Omeruin", "description" : "WIP!", "friendlyName" : "My Patch Mod", "includes" : ["OmRaceTraits", "OmStarbornRace"], "link" : "", "name" : "MyPatchMod", "steamContentId" : "", "tags" : "", "version" : "1.0" }
This is what's gonna be in our _metadata. Our metadata needs to stay outside of any folders.
We place the Race Trait's actual ID in the "includes" section, as well as the ID of the race mod we want to include with Race Traits.

To find out a race mod's name ID, you need to unpack the mod or ask the author. This guide does not cover unpacking. Please look for other guides online!

However! If you're including your Race Traits support in YOUR own custom race mod, you can simply add "OmRaceTraits" to your race mod's metadata, without creating a new mod at all!

.png]

You can also have a "requires" section, but that can be done when uploading the mod and selecting "Add/Remove Required Items". It'll be added to the metadata automatically.
Patching the Custom Stats
Let's get to the actual patching part.
First, let's patch the actual status effect in the Race Traits mod that applies the custom stats!

Follow this exact file path:
.png]

Then, let's create a patch file named om_racetraits.statuseffect.patch.

Inside this file, paste this:
[ { "op": "add", "path": "/effectConfig/0/racenamehere", "value": { "stats": [ {"stat": "maxHealth","effectiveMultiplier": 1.0}, {"stat": "maxEnergy","effectiveMultiplier": 1.0}, {"stat": "energyRegenPercentageRate","effectiveMultiplier": 1.0}, {"stat": "powerMultiplier","effectiveMultiplier": 1.0}, {"stat": "protection","effectiveMultiplier": 1.0}, {"stat": "fireResistance","amount": 0.0}, {"stat": "fireStatusImmunity","amount": 0.0}, {"stat": "electricResistance","amount": 0.0}, {"stat": "electricStatusImmunity","amount": 0.0}, {"stat": "poisonResistance","amount": 0.0}, {"stat": "poisonStatusImmunity","amount": 0.0}, {"stat": "iceResistance","amount": 0.0}, {"stat": "iceStatusImmunity","amount": 0.0}, {"stat": "physicalResistance","amount": 0.0} ], "benefits": [ ], "controlModifiers": { } } } ]
Replace racenamehere with the ID or internal name of the race you want to add. NOT THE SAME ID FROM THE METADATA. In this case, for me, that'd be simply "om_starborn"!

Now, you can edit the values!

Attributes
Keep in mind that maxHealth, maxEnergy, energyRegenPercentageRate, powerMultiplier and protection all work off of multipliers.
So, an effectiveMultiplier of 1.25 would be multiplying a stat by +25%! Make sense?
This also is true for the reverse.
An effectiveMultiplier of 0.85 means you are decreasing that attribute by -15%. Yikes!

Resistances and Immunities
As for the Resistances and Immunities, they're a bit different.
Resistances work a similar, but without multiplying. They add an absolute value to the resistance stat. So, {"stat": "fireResistance","amount": 0.35} would mean you are giving your race +35% Fire Resistance!
If you decrease that value, you're decreasing/taking away resistance. So {"stat": "physicalResistance","amount": -0.15} means -15% phys. resistance! Oh no!

However, for the Immunities, all you need is either 1.0 or 0. An Amount of 1.0 means "true" essentially, while "0" means "false".
So, {"stat": "iceStatusImmunity","amount": 0.0} essentially means this race is not immune to getting the Frost debuff. While {"stat": "poisonStatusImmunity","amount": 1.0} means this race is immune to getting the Poisoned debuff! Nice!

Racial Traits and controlModifiers
Traits don't have integer values. Instead, they require a simple string. They need the ID of the status effect that you want to apply to the race. If you've ever unpacked the game's assets, you'll know these well.
.png]
{ "name" : "regeneration1", "blockingStat" : "healingStatusImmunity", "effectConfig" : { "healTime" : 60 }, "defaultDuration" : 5, "scripts" : [ "regeneration.lua" ], "animationConfig" : "regeneration.animation", "label" : "Regeneration", "icon" : "/interface/statuses/heal.png" }
Inside this vanilla status effect, we are looking for the name. In this case, that would be regeneration1.
To add the status effect your race, simply put the status' name in the benefits table, like so!
"benefits": [ "regeneration1" ],
That's it! Adding status effects is completely optional.
If you do not want any status effects, simply leave the benefits table empty, with nothing in it.
"benefits": [ ],

controlModifiers work similarly to the attributes and resistances from before. However, there are only two options. (As of right now.)
speedModifier and airJumpModifier.
speedModifier increases your race's movement speed, while airJumpModifier increases their jump height.
Since they are modifiers, they work like the attributes from before.
"controlModifiers": { "speedModifier" : 1.0, "airJumpModifier" : 1.0 }
If you change the speedModifier to 1.5, you're increasing the race's movement speed by +50%! Yowza! That's really fast! If you do the same for airJumpModifier, your race will jump REALLY high! Uh oh!

Final Result
Alright, these are the stats I want for my race!
[ { "op": "add", "path": "/effectConfig/0/om_starborn", "value": { "stats": [ {"stat": "maxHealth","effectiveMultiplier": 1.0}, {"stat": "maxEnergy","effectiveMultiplier": 0.85}, {"stat": "energyRegenPercentageRate","effectiveMultiplier": 1.25}, {"stat": "powerMultiplier","effectiveMultiplier": 0.70}, {"stat": "protection","effectiveMultiplier": 1.08}, {"stat": "fireResistance","amount": 0.35}, {"stat": "fireStatusImmunity","amount": 0.0}, {"stat": "electricResistance","amount": 0.15 }, {"stat": "electricStatusImmunity","amount": 0.0}, {"stat": "poisonResistance","amount": 0.15}, {"stat": "poisonStatusImmunity","amount": 0.0}, {"stat": "iceResistance","amount": 0.35}, {"stat": "iceStatusImmunity","amount": 0.0}, {"stat": "physicalResistance","amount": 0.05}, {"stat": "om_rtfoodpoisonImmunity","amount": 1.0}, {"stat": "breathProtection","amount": 1.0}, {"stat": "om_rthungerImmunity","amount": 1.0}, {"stat": "om_rtstarvingImmunity","amount": 1.0}, {"stat": "knockbackThreshold", "amount": 9.90}, {"stat": "foodDelta", "effectiveMultiplier": 0}, {"stat": "breathDepletionRate", "amount": 0} ], "benefits": [ "dontstarve" ], "controlModifiers": { } } } ]
There are even more values that you can change, so please look at the Extras section to learn more!
Patching the Species File
Well, now we have given our modded race the stats we want! But what if we also want to patch the character creator menu?
Let's do that as well!

Most race's species file path is as follows:
.png]
But it's good to unpack or look at the mod and make sure.

After making sure where the species file is located, let's go back to our patch mod and create the same path.
.png]

In this folder, let's patch our species file.
.png]
Since I am patching the Starborn, the file is called "om_starborn.species.patch", since the internal race name for them is om_starborn, NOT Starborn.

Put this content in your patch:
[{"op": "replace", "path": "/charCreationTooltip/description", "value": "Race description here. ^yellow;Attributes^reset; Max Health: - Max Energy: - Energy Regen: - Attack Multiplier: - Defense: - ^yellow;Resistances Fire Resistance: - Electric Resistance: - Poison Resistance: - Ice Resistance: - Physical Resistance: - ^yellow;Immunities^reset;: ^yellow;Racial Traits^reset;:" }]
Looks pretty boring right now, huh? Well, for the first part, we need the original mod's species description. We can pull that directly from the original species file.
.png]
Aha, right here! We'll copy that description and replace Race description here. with those lines.

Also, when you're checking the species file, make sure to watch out for existing status effects. In my case, for the Starborn, they already have 2 custom status effects. Be sure to check these and MAKE SURE they aren't already adding stats through a non-RT method! We don't want to accidentally multiply those values and get everything outta wack!

Back to the patch!
The rest of those values? They have to be manually inputted by you! Depending on what stats you chose for your race, you can manually write down the percentages or changes. Want an example? Here's mine!
[{"op": "replace", "path": "/charCreationTooltip/description", "value": "^red;WIP. ^yellow;Attributes^reset; Max Health: - ^cyan;Max Energy^reset;: ^red;-15%^reset; ^cyan;Energy Regen^reset;: ^green;+25%^reset; ^cyan;Attack Multiplier^reset;: ^red;-30%^reset; ^cyan;Defense^reset;: ^green;+8%^reset; ^yellow;Resistances^reset; ^cyan;Fire Resistance^reset;: ^green;+35%^reset; ^cyan;Electric Resistance^reset;: ^green;+15%^reset; ^cyan;Poison Resistance^reset;: ^green;+15%^reset; ^cyan;Ice Resistance^reset;: ^green;+35%^reset; ^cyan;Physical Resistance^reset;: ^green;+5%^reset; ^yellow;Immunities^reset;: ^green;Hungry, Suffocation, Food Poisoning, Starving ^yellow;Racial Traits^reset;: ^green;Don't Starve ^cyan;Hunger Rate^reset;: ^green;-100%^reset;^reset;, ^cyan;Breath Depletion Rate^reset;: ^green;-4^reset;, ^cyan;Knockback Resistance^reset;: ^green;+10%^reset;^reset;" }]
It's recommended to follow the colour codes previewed here, but you are allowed to do other things if you want to.
Patching "Unsupported" Races
In a very rare case, you may be trying to patch a race that is already included in the Race Traits config, but their stats are completely blank with only a "unsupported" boolean labled as "true".
Then what?
Worry not, that race can still be patched by you!

This "unsupported" variable is for race mods that cannot be supported because of existing stats, author request, or technical issues. The Race Traits Viewer changes the bottom UI text based on this variable. EXISTING STATS/RACES ARE NOT AFFECTED. This variable was made to make it more clear which race mods are INTENTIONALLY unsupported.



We'll be using a random unsupported race as an example: "dragon".
[ [ {"op":"test","path":"/effectConfig/0/dragon/unsupported"}, {"op":"remove","path":"/effectConfig/0/dragon/unsupported"}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"maxHealth","effectiveMultiplier":1.15}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"maxEnergy","effectiveMultiplier":1.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"energyRegenPercentageRate","effectiveMultiplier":1.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"powerMultiplier","effectiveMultiplier":1.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"protection","effectiveMultiplier":1.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"fireResistance","amount":0.35}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"fireStatusImmunity","amount":1.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"electricResistance","amount":0.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"electricStatusImmunity","amount":0.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"poisonResistance","amount":0.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"poisonStatusImmunity","amount":0.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"iceResistance","amount":0.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"iceStatusImmunity","amount":0.0}}, {"op":"add","path":"/effectConfig/0/dragon/stats/-","value":{"stat":"physicalResistance","amount":0.0}}, {"op":"add","path":"/effectConfig/0/dragon/benefits/-","value":"om_rtfireaura"}, {"op":"add","path":"/effectConfig/0/dragon/benefits/-","value":"om_rtrage2"}, {"op":"add","path":"/effectConfig/0/dragon/controlModifiers/speedModifier","value":1.15}, {"op":"add","path":"/effectConfig/0/dragon/controlModifiers/airJumpModifier","value":1.5} ] ]
As you can see here, we're testing for the "unsupported" variable which is stored directly with the race. If we find it, let's remove it, and add stats to those empty configs! We want to test for the variable just in case another mod already removes it, else it would cause issues. We also want to test the variable because Race Traits might update and support the race one day! In that case, the "unsupported" variable would be removed.

This is extremely similar to making a regular patch, so it shouldn't be too hard to know what to do from here if you want to add or edit your own values!
Testing the Patch
Before going any further, let's test our patch so far.

First, we'll go to the CC menu.
Hover over your race, and see if the custom stats patch shows up!
.png]
Awesome, there it is!

Next, let's create a character of that species.
After immediately getting into the game, you should get the Race Traits Viewer item.
.png]
If you do not see the item, try any of these methods!
  • Enable /admin and then do this: /spawnitem om_rthelper
  • Enable /admin and craft the item at hand
If neither of those work, try using the custom button for Quickbar.
.png]
If none of these solutions work, please go to the bug forum for the mod and report it!

Once you have the item, or button, simply use it or click on it!
.png]
This interface should show up!
.png]
If the patch was made correctly, your race's stats that you've chosen, along with immunities and traits, should all show up here in the various categories!
Super awesome!

If you crash while trying to open the interface, please check your Starbound log or check your patch to make sure it's clean!
There are plenty of websites that can check patches and lint them. I recommend this site[helmet.kafuka.org] for doing so!
Extras
There are even more values you can customize for your race, making their playstyle truly unique.
To have the most up-to-date IDs and values to edit, please visit the Race Traits - Stats Sheet[docs.google.com] on Google Sheets and take a look at the "Extra Values (Player Only)" tab and the "Immunities and Traits List" tab!

Here's a good example of some of those unique stats being modified!
"nebulac" : { "stats" : [ {"stat": "maxHealth", "effectiveMultiplier": 0.75}, {"stat": "maxEnergy", "effectiveMultiplier": 1.35}, {"stat": "energyRegenPercentageRate", "effectiveMultiplier": 1.15}, {"stat": "powerMultiplier", "effectiveMultiplier": 0.95}, {"stat": "protection", "effectiveMultiplier": 1.0}, {"stat": "fireResistance", "amount": 0.25}, {"stat": "fireStatusImmunity", "amount": 0.0}, {"stat": "electricResistance", "amount": 0.10}, {"stat": "electricStatusImmunity", "amount": 1.0}, {"stat": "poisonResistance", "amount": -0.10}, {"stat": "poisonStatusImmunity", "amount": 1.0}, {"stat": "iceResistance", "amount": -0.35}, {"stat": "iceStatusImmunity", "amount": 0.0}, {"stat": "physicalResistance", "amount": 0.0}, {"stat": "breathProtection", "amount": 1.0}, {"stat": "foodDelta", "baseMultiplier": 1.15}, {"stat": "breathDepletionRate", "effectiveMultiplier": 0.0} ], "benefits" : [ ], "controlModifiers" : { } }
Conclusion
That's it! That's all it takes to patch your race and create stats for them! Awesome!

Stay tuned, for more sections relating to patching "Race Traits" may appear here soon.

.png]

Thank you so much for reading!

Note: I am a busy person, so if you have any questions, it may take me a while to answer or get to them.
12 Comments
Oмεяυıп  [author] 7 Apr, 2024 @ 10:31am 
@LarsSvengard
Hello. :demonsheep:

@Xan // Eti
:toughertimes:

@KappaUpsilonSigma
Well, it wasn't written for rewards. And by now, there are definitely more awards. Lol...

@wynter
:toughertimes:

@Bell
Sorry, there is not. I do not have any guides for translating my mods.

@Pybro
That would be a CRAZY amount of programming work, and it might be finicky regardless...which is why something like that doesn't exist already. But who knows... I'm not really willing to do something like that, but maybe someone will make a Race Traits addon?
Bro 7 Apr, 2024 @ 7:14am 
man its so hard and im dumt-t
I wish there would just be a seperate mod that adds a menu where u can choose installed race and choose traits t-t
Bell 21 Nov, 2022 @ 6:57am 
Is there a similar guide, but for the translation of your beautiful modification ?
wynter 7 Aug, 2022 @ 11:52pm 
yes, frackin' races 2
LowTierGod 21 Apr, 2022 @ 1:44pm 
imagine writing all of this just for a single award...
Xan 15 Apr, 2022 @ 6:29am 
Ah yes, Frackin' Races
LarsSvengard 9 Apr, 2022 @ 5:27pm 
hey omeruin
Oмεяυıп  [author] 18 Jan, 2022 @ 8:38am 
@Pikinal Spliksvurth
It's probably possible, yes. I can imagine how it may be coded...
However, I am personally stepping back from Starbound for a bit. If you want, you can ask my co-dev Silver more about it.
Nefilol Seflll 18 Jan, 2022 @ 4:49am 
There's one specifically for breathing underwater while not breathing in space.

Is it possible to have the reversal of that?
Cus long story short, i'm working on a race mod where lore-wise, it makes sense for them to be able to 'breath' in the vaccume of space, but not in liquids.
Oмεяυıп  [author] 7 Oct, 2021 @ 8:44pm 
@spirit6-minecrafting
Thank you! :demonsheep::rtrheart: