Starbound

Starbound

33 ratings
Internal Planet/Biome Support for Modded Races
By Oмεяυıп
This guide will explain how to make internal support for modded races so that they can spawn on modded planets!
This guide is for race mod authors, since this is internal support (as the name suggests), not external. Internal support means that you do NOT need any outside patches for this to work.

As a visual example to help users, I will be patching my Angel race mod to work along with the mod Arcana, which adds many planets and biomes!

P.S. YES! You CAN use this guide to patch modded dungeons that are NOT race-related onto modded planets!

Warning: This guide expects you to understand basic patching, JSON editing, and file creation.
   
Award
Favorite
Favorited
Unfavorite
Changing the Metadata
First and foremost, you'll want to change the _metadata for your race!
We're going to do one simple thing: add a very simple line or requirement for our race. To be able to load after the mod we want to patch our race into, we need to include that mod in our metadata.
I'm going to add Arcana to my Angel mod's metadata!
.png]
"includes" : ["Arcana"]
That's the first easy step.
Patching Modded Planets
Since we have the mod we want in our metadata, it's time to add our race to that mod's planets!
Go to your terrestrial_worlds.config.patch and follow a set-up like this:
[ // Unconditional [ // Forest { "op": "add", "path": "/planetTypes/forest/layers/surface/dungeons/-", "value": [1.0, "angeltemples"] }, { "op": "add", "path": "/planetTypes/forest/layers/surface/dungeons/-", "value": [4.0,"angelvillage"] } ], // Arcana Support [ {"op":"test","path":"/planetTypes/arcana_arcaneForest"}, //Arcane Forest { "op": "add", "path": "/planetTypes/arcana_arcaneForest/layers/surface/dungeons/-", "value": [3.0, "angeltemples"] }, { "op": "add", "path": "/planetTypes/arcana_arcaneForest/layers/surface/dungeons/-", "value": [3.0, "angelvillage"] } ]
What we're doing is putting vanilla and modded content into "lists". If we put no test operation, also known as a "check", for vanilla biomes, those patches will always be added.

However, for the modded planets, we want to test and make sure Arcana is added by seeing if an Arcana planet is added specifically to this file, terrestrial_worlds.config. This is especially important as terrestrial_worlds.config is a vanilla file, NOT a modded file.
Since Arcana definitely patches this file, and our race mod loads after Arcana, we will be able to check and confirm that Arcana is installed because it adds "arcana_arcaneForest" to the planetTypes!

Because the test operation is a success, our race's dungeons will now spawn on any modded planets we list from Arcana! Awesome!


Simple as that! Absolutely no errors if Arcana is NOT installed.
Want to know the reason? If the test operation is unsuccessful, meaning it does NOT detect arcana_arcaneForest in terrestrial_worlds.config, it simply does NOT add the patches after the initial check. That's all!
Pretty nifty, huh?
Patching Modded Biomes
Now let's add our race's microdungeons to any modded biomes!
For this one, you'll need to know the path of the biome you want to patch. In my case with Arcana, it is simply:
\biomes\surface

I want to patch arcana_arcaneDesert, so I will copy the file and rename it to arcana_arcaneDesert.patch, following the exact pathing of the Arcana mod.
In the patch file, I will put this:
[ // MONSTERS { "op": "add", "path": "/spawnProfile/groups/0/pool/-", "value": [0.1111, "smallfiredemon"] }, { "op": "add","path": "/spawnProfile/groups/0/pool/-", "value": [0.1111, "demoth" ] }, { "op": "add","path": "/spawnProfile/groups/0/pool/-", "value": [0.1111, "poptopdemon" ] }, { "op": "add","path": "/spawnProfile/groups/0/pool/-", "value": [0.1111, "creepydemon"] }, { "op": "add","path": "/spawnProfile/groups/0/pool/-", "value": [0.1111, "adultpoptopdemon"] }, // ENCOUNTERS { "op" : "add", "path" : "/surfacePlaceables/items/-", "value" : { "mode" : "floor", "priority" : 4.0, "variants" : 1, "distribution" : "/biomes/distributions.config:randomEncounter", "type" : "microdungeon", "microdungeons" : ["angelencounters"] } } ]
There is no need to create a test operation as the file won't exist without the mod, therefore no errors will happen if it does not exist.
See? This one was pretty easy, too!
Conclusion
Yep, that's all it takes to add your modded races to any modded planet you want!
However, before you go, I want to give you a few warnings.

If the mod you are including also requires or includes your mod, Starbound will go into "infinite looping". This is when one mod is trying to load after the included mod, but the included mod also wants to load after the first mod!
So confusing! This is why Starbound has trouble. If this is happening, you will have to create a second "mod" within your race mod to be able to add support without eternal looping.

Unfortunately, I am not knowledgeable about this type of fix and cannot help much, but it is a possible solution to anyone that has that problem. Especially for a big mod like "Frackin' Universe", since it includes many mods automatically for support.

Thank you!
Thank you so much for being interested in my guide! I hope this helps any budding race mod authors that want to add their wonderful race to modded planets without the use of external patches!



If you have any questions or concerns, please leave a comment for me and I'll get to you soon!
4 Comments
Oмεяυıп  [author] 14 Oct, 2023 @ 8:11pm 
@GlitterDragon
You could do that if you wanted, yeah! Though, at that point - if you're creating an entire patch mod, testing operations most likely won't be needed, as the entire point would be to have both the race mod AND whichever planet mod you choose in the requirements.
GlitterDragon 2 Jul, 2023 @ 5:45pm 
Wow this is a nice informative guide!
I know this is intended so that patches aren't needed, but can it be easily used as a patch for other existing races?
Oмεяυıп  [author] 20 Nov, 2021 @ 8:09am 
@Bampa Jangla
Two WIP races of mine, heh.
Noche 20 Nov, 2021 @ 2:54am 
If I may ask, what are the races used in this guide's thumbnail image? I recognize De'nelaun, Angel and Nebulac, but the other two are unfamiliar to me.