Starbound

Starbound

Planet Search
 This topic has been pinned, so it's probably important
floyd  [developer] 25 Aug, 2024 @ 6:21pm
Mod Support Guide
This is a short guide for adding Planet Search support to your mod. I'll be assuming you have some experience with Starbound modding and know how JSON patching works. Documentation for JSON patching is available here[www.rfc-editor.org] if you're unfamiliar with it.

Before adding anything in this guide to your mod, ensure your metadata file[starbounder.org] has an "includes" array and that you add "fl_planetsearch" to it.

Adding support for your mod will require you to patch cockpit.config, so you'll need to create /interface/cockpit/cockpit.config.patch if you aren't already patching that file. Most content from your mod should automatically be detected and appear in the search menu so the sections below are mostly for making them look nice in the menu. If something you added isn't showing up in the menu make sure it can actually spawn in the universe, sometimes mods like TrueSpace that alter star generation can prevent planets from appearing. (Ores are the exception to this because as far as I can tell there's no way to verify they can spawn in the universe.)



Planet Support
There's no need to do anything special here, any planets that can spawn in the universe will appear in the search menu automatically.

If you'd like to prevent searching for your planet(s), you can patch them into the relevant ignore array:
[ { "op": "test", "path": "/planetSearch_ignore" }, // make sure it exists before adding into it { "op": "add", "path": "/planetSearch_ignore/planets/-", "value": "PLANETID" } ]
Every planet in this array will be hidden from players unless they're in /admin mode when they open the navigation console.

Ore Support
Everything inside cockpit.config's "displayOres" is automatically added to the search menu. If your mod is adding ores then you probably already have a patch to add it there.

If you'd like to prevent searching for your ore(s), you can patch them into the relevant ignore array:
[ { "op": "test", "path": "/planetSearch_ignore" }, // make sure it exists before adding into it { "op": "add", "path": "/planetSearch_ignore/ores/-", "value": "OREID" } ]
Every ore in this array will be hidden from players unless they're in /admin mode when they open the navigation console.

Dungeon Support
If your mod adds custom dungeons they'll appear in the dungeons tab automatically, but will default to displaying a "?" icon and using the internal id for their name.

Making your dungeon(s) look nice in the menu is easy, you just have to patch them into "displayDungeons" like so:
[ { "op": "test", "path": "/displayDungeons" }, // make sure it exists before adding into it { "op": "add", "path": "/displayDungeons/DUNGEONID", "value": { "name": "Dungeon Name", "description": "Dungeon description.", "icon": "/path/to/icon.png" } } ]
"displayDungeons" is shared with More Planet Info, so if your mod already has support for More Planet Info then you may only need to add a "name" variable to what you already have. Note that "description" isn't used by Planet Search but is used by More Planet Info so it's only here to prevent errors for players who use both. More Planet Info reads the "icon" variable so you can optionally include a "ps_icon" variable if you'd like Planet Search to use a unique icon.

If you'd like to prevent searching for your dungeon(s), you can patch them into the relevant ignore array:
[ { "op": "test", "path": "/planetSearch_ignore" }, // make sure it exists before adding into it { "op": "add", "path": "/planetSearch_ignore/dungeons/-", "value": "DUNGEONID" } ]
Every dungeon in this array will be hidden from players unless they're in /admin mode when they open the navigation console.

Biome Support
This section is largely the same as the above dungeon section. Biomes added by your mod will automatically appear in the biomes tab but will display a "?" icon and use the biome's internal id as a name. If it's not patched into "displayBiomes" then players using OpenStarbound[github.com] will have the biome automatically use the "friendlyName" specified in the .biome file as a name, and it will use it's "mainBlock" as an icon.

To make your biome(s) look nice in the menu, patch them into "displayBiomes" like so:
[ { "op": "test", "path": "/displayBiomes" }, // make sure it exists before adding into it { "op": "add", "path": "/displayBiomes/BIOMEID", "value": { "name": "Biome Name", "icon": "/path/to/icon.png" }} ]
Unlike dungeons, "displayBiomes" isn't shared with More Planet Info, so there is no optional "ps_icon" it just uses "name" and "icon".

If you'd like to prevent searching for your biome(s), you can patch them into the relevant ignore array:
[ { "op": "test", "path": "/planetSearch_ignore" }, // make sure it exists before adding into it { "op": "add", "path": "/planetSearch_ignore/biomes/-", "value": "BIOMEID" } ]
Every biome in this array will be hidden from players unless they're in /admin mode when they open the navigation console.
Last edited by floyd; 2 Sep, 2024 @ 7:16am