Published using Google Docs
Betabound documentation
Updated automatically every 5 minutes

Public Betabound documentation for modders by silversokolova on Discord
tinyurl.com/betadocs

(Notes to self: codeblock theme is Arta, file font is Consolas)

Table of Contents

Music Sheets (Portable/Stationary Radio)

Adding and Obtaining Music Sheets

Customizing Music Sheets

Default Tracks (Portable/Stationary Radio)

Suit Techs

Making a Suit Tech

Obtaining a Suit Tech

Adding a Recipe

Plates

Ability Modifier Items

Poisoncreep Immunity (for aquatic/robotic races)

Music Sheets (Portable/Stationary Radio)

Music sheets are obtainable items in Betabound which can be found as loot. When the player obtains a music sheet, they can listen to the track on that music sheet from a radio, even if they discard the music sheet.

When a music sheet item is created (this includes being ‘recreated,’ such as when the player drops it on the ground, relaunches the game, etc), it will be assigned a track if it does not have one (sheets can be spawned with a predetermined track by setting the music value). If it does not have a track, it will create a list of tracks from /collections/sb_music.collections:collectables, excluding any entries which have the special value set to true. In other words, special tracks will never be randomly selected. So, if you want your song to randomly be found in chests and such, don't make it a special one. To add more tracks, create a file at /collections/sb_music.collections.patch.

Music sheets aren't the only way to add tracks to the radio. Go to Default Tracks (Portable/Stationary Radio) for more information.

Adding and Obtaining Music Sheets

Here's a patch which adds a unique music sheet which unlocks 'Dead or Alive':

[
   {
       "op":
"add",
       "path":
"/collectables/dead-or-alive", // Everything after '/collectables/' is the ID of this track. We can use the ID to spawn it
       "value": {
           "icon":
"dead-or-alive", // Icon is the path to the sound file. If no path is specified, it is assumed to be an ogg file in the music folder
           "title":
"Dead or Alive", // Name is shown to the player and is used for the music sheet item and radio interface
           "special":
true, // Optional value. Default is false. When set to true, prevents this track from being randomly selected when spawning a music sheet item and changes item rarity from Uncommon to Rare            
           "description":
"John Doe" // Optional value. Default is "Curtis Schweitzer". This name is shown to the player in the radio interface as the track's composer
       }
   }
]

Of course, Betabound already has Dead or Alive in its music list, and you probably aren't looking to add a second one, so just replace dead-or-alive in the patch with whatever your song is called.

Here's an example of how to spawn a music sheet which unlocks Dead or Alive. Once in your inventory, the song will automatically be unlocked. Also, if you're in admin mode, the radio will grant you temporary access to all songs.

/spawnitem sb_musicsheet 1 '{"music":"dead-or-alive"}

If your song isn't special, you can stop here. Congrats! You've added a new song to the pool. You can also add it to treasure pools, shops, or as a recipe by specifying the 'music' parameter, just like in the spawnitem command. Here's what you need in order to do so– just paste it into your treasure pool or recipe file and you're good to go! (Not really– you actually need the rest of the treasure pool or recipe file. This is just the music sheet part.)

["sb_musicsheet",1,{"music":"dead-or-alive"}]

Customizing Music Sheets

Since all music sheets are the same item with different values, you might be wondering how you can customize them. Maybe you want a CD icon for your track instead of a sheet of paper, or maybe you'd like it to be more expensive than the default price. By making a file at /collections/sb_music.config.patch, you can specify parameters for specifc tracks. These parameters will be used for the music sheet item. The below patch will visually turn every 'Dead or Alive' music sheet into a compact disc, increase the price to 9999, and change the description to reference the fact that it is now a disc.

[
   {
       "op":
"add",
       "path":
"/dead-or-alive", // Track ID from the collections patch
       "value": { // Everything in 'value' are parameters for the item. Note that changing the 'category' value won't visually change it in the tooltip since music sheets use tooltipFields
           "price":
9999,
           "description":
"This music disc can be played from a ^orange;Portable or Stationary Radio!^reset;",
           "inventoryIcon":
"/items/active/unsorted/audiodisc/audiodisc.png"
       }
   }
]

Default Tracks (Portable/Stationary Radio)

Music sheets aren't the only way to add tracks to the radio. You can add default tracks which, as their name suggests, are available by default and do not need to be unlocked. To get started, make a file at /interface/scripted/sb_music/music.config.patch and paste the following template in:

[
   {
       "op":
"add",
       "path":
"/defaultSongs/-",
       "value": {
           "icon":
"/sfx/gun/flamethrower_loop.ogg", // Icon is the path to the sound file. If no path is specified, it is assumed to be an ogg file in the music folder
           "title":
"Fire", // Name shown to the player
           "description":
"xX_ArsonistMan_Xx" // Optional value. Default is "Curtis Schweitzer". This name is shown to the player in the radio interface as the track's composer
       }
   }
]

The track will then be available at a radio, and since it doesn't need to be unlocked, it won't have a music sheet item.

Suit Techs

Betabound adds a new type of equipable tech. They use tech files and apply status effects to the player, just like armor. This section will explain how to make a suit tech, how to add it to the list of techs that are randomly selected when an sb_tech item is created, and how to add a Tech Development Console recipe for it.

Making a Suit Tech

{
 "name" :
"sb_enhancedhealing", // Tech name. Note that suit techs currently cannot be unlocked with tech commands. Use `/spawnitem sb_tech 1 '{"techModule":"sb_enhancedhealing"}` instead.
 "type" :
"head", // It doesn't matter what this value is as long as it's 'head', 'body', or 'legs'
 "icon" :
"/tech/starbound/enhancedhealing.png", // Tech icon
 "scripts" : [], // It doesn't matter what this value is as long as it exists and has square brackets
 "sb_effect" :
"sb_enhancedhealingtech", // String or JsonArray of status effects, effect descriptors, etc. '"sb_healthtech",{"stat":"maxHealth","effectiveMultiplier":1.15}]' is valid, for example. If you can do it with armor, you can do it with suit techs. Even if we can achieve the functionality of a suit tech without adding a unique status effect, I prefer to add one in order to have a tech/buff icon for the player to see
 "sb_suitImage" :
"?replace;73daff=f9a2a4;27abff=f78588;117ee4=ed2033;1f45d4=dd1225;002b72=bd0016;001522=9e0012", // Optional parameter which applies directives to the person in the tech interface. I usually take three colors and make three more colors via Piskel's brightness brush: lightest color + lightened, darkest color + darkened, and darkest color + darkened x2. Then, I apply them left-to-right, brightest-to-darkest.
 "rarity" :
"rare", // Although the rarity isn't shown in the tech item, it will be assigned a rarity. Also, Starbound crashes if a tech doesn't have a rarity- it's leftover from beta.
 "description" :
"Increases the effectiveness of health restoration effects.", // Description for the tech
 "shortDescription" :
"Enhanced Healing" // Short description for the tech
}

Optional UI Parameters

There also exist optional parameters which affect how the player sees the tech in menus such as the tech selection UI and their inventory.

{
 "tooltipKind" :
"sb_object4b", // Optional. Tooltip kind to be used for the tech. Defaults to "sb_object"
 "sb_briefDescription" :
"", // Used instead of description when in the vanilla tech menu. Only affects the vanilla tech menu and not inventory items. Not exclusive to suit techs (they can't even appear in the vanilla tech menu).
 "sb_longDescription" :
"", // Extra text appended to description when using Betabound's tech binding menu (which makes items to swap techs on-the-go). Only affects Betabound's tech binding menu and not inventory items.
 "sb_uiDescription" :
"" // Used instead of description in Betabound's tech menus.
}

Obtaining a Suit Tech

Suit techs cannot be unlocked with tech unlock commands. Use this command instead:

/spawnitem sb_tech 1 '{"techModule":"sb_enhancedhealing"}

However, if you have StarExtensions installed, you can use the `sb_unlocktech` command:

/sb_unlocktech sb_enhancedhealing

You can also spawn an sb_tech item without parameters. In that case, it will randomly pick a tech from /tech/starbound/tech.config. You can also patch the tech list like so:

[
   {
       "op":
"add",
       "path":
"/-",
       "value":
"sb_enhancedhealing"
   }
]

This patch will add sb_enhancedhealing to the list of techs that can be randomly found when a tech unlock item is created without a specified tech. If the tech does not exist, it will not be chosen.

Adding a Recipe

Maybe you don't want your tech to be randomly found in chests and instead want the player to use the Tech Development Console to 'craft' it by combining other techs (the player can use tech cards at a tech station to create tech unlock items of techs they have).

Don't worry; this is probably the most straightforward part. All you need to do is swap out some values. You don't even have to unlock the recipe since the Tech Development Console doesn't check the player's known recipes! Here's a recipe file for a suit tech.

{
 "input": [
   [
"sb_tech",1,{"techModule":"sb_health"}],
   [
"sb_tech",1,{"techModule":"sb_regeneration"}]
 ],
 "matchInputParameters":
true,
 "output": [
"sb_tech",1,{"techModule":"sb_enhancedhealing"}],
 "groups": [
"sb_techconsole","nouncrafting","all","sb_tech_4"]
}

As you can see, it accepts two tech items– one with the sb_health tech and one with the sb_regeneration tech. These are the two techs the player will use to make your new tech! Change them to whatever techs you want them to be. This recipe outputs one tech item for sb_enhancedhealing.

Under groups, you may notice sb_tech_4. Each tech slot has a numeric value. Head is 1, body is 2, legs are 3, and suit is 4. Change the number to match the slot your tech goes in, and the player will be able to filter by tech slot in the Tech Development Console interface! So, if your tech is a head tech, set it to sb_tech_1, and if it's a body tech, change that sucker to sb_tech_2, etc etc.

Maybe you don't want the player to have to combine techs and instead want a more traditional crafting recipe. In that case, go for it! It's a crafting recipe, after all. Just change the input values.

Plates

Betabound adds craftable plates which can display items. Their item ID is sb_plate. Items are stripped of the following colors to remove their border (because vanilla has inconsistent border colors):

0x000000

0x151515

0x202020

0x45421e

Unfortunately, there is no 'hey please remove the border' image operation, so if the item icon uses those colors elsewhere, they will be removed.

By default, only generic and consumable items are accepted onto the plate. You can use the /eval root.itemType("copperbar") command to view what type an item is. The command checks the type of the copper bar item, so make sure to change it because. If you have a non-generic non-consumable item and want to display it on a plate, keep reading!

Consumable-type items have file names ending in '.consumable', and generic-type items end in '.item'.

Plates check the item put on them for the sb_plate table. Below is an example of plate values, in an item file. All values are optional, though it is generally recommended to have an image for your item if it is to go on a plate.

You can add 'sb_forcePlate' to your item itself or to its item tags to have the plate accept it, regardless if it is a generic or consumable item. Please test your item, because it may not display properly if it is something like a weapon or sapling.

{
 "sb_plate": {

    //Having 'sb_plate', even if its contents are '{}', will allow any item type to display a plate under it
   "image": true,

    //This can be a boolean (which will use the item name as its image value), or an image name (such as 'cake'), or a path to an image (such as '/items/generic/crafting/copperbar.png'). If an image path is not specified, it assumes the image is located in the '/objects/generic/sb_plate/' directory and ends in '.png'.

   //You can also simply add 'sb_plateImage' to your item instead of adding '"sb_plateImage":{"image":true}'

    "offset": 2,

    //This will visually shift the plate horizontally. Accepts decimals.

    "width": 2,

    //This will visually widen the plate, stretching it.

    "hidePlate": false,

    //Visually hides the plate and shifts the item down. Defaults to 'true' for items of the 'drink' and 'medicine' categories.

    "flipImage": false

    //Flips the direction of the item on the plate
 }
}

Ability Modifier Items

Betabound adds an item which can change the special (or primary!) ability on weapons. The item's buildscript picks a random ability from the /sb_abilitymods.config file's 'ability' section, or from the item's 'abilityList' parameter. The file at /treasure/sb_abilitymods.treasurepools contains treasure pools for certain types of abilities, such as basic sword abilities, elemental gun abilities, etc. These pools are then put into the vanilla weapon treasure pool, so the player cannot get a wand ability on a tier 1 planet, as no wands spawn in tier 1 treasure pools. Please note that as of 25/Feb/2024, Betabound contains no treasure pool with an ability mod item which does not have its own abilityList.

However, treasure chests are not the only way to obtain ability mods. The player can craft a Metalwork Station with tier 2 materials, allowing them to craft any ability mod with an associated recipe file. The Metalwork Station does not care if the player has the recipes unlocked, so there is no need to add a way to unlock the recipe for your ability.

All ability mods, by default, are crafted with a platinum bar (unused vanilla item enabled by Betabound) and a diamond. You can change the ability value to any ability in the game, regardless if it is present in the /sb_abilitymods.config file.

Valid categories are sb_melee, sb_gun, and sb_staff. Staff is also used for wand abilities because they can go on staves.

 

{

  "input" : ["platinumbar","diamond"],

  "output" : ["sb_abilitymod",1,{"ability":"bouncingshot"}],

  "groups" : ["sb_metalworkstation","sb_gun","all"]

}

The /sb_abilitymods.config file allows you to add certain values to change how your ability is applied. You can patch it like this.

[

    {

        "op": "add",

        "path": "/abilities/nameOfTheAbilityIAmAdding",

        "value": {

            "slot": "primary",

            //Defaults to 'alt'. Changes which ability slot the item changes. If you add another ability slot, check out `/items/augments/sb_abilitymod/abilitymod.augment` and add a `<slotName>Description` value for your slot so the description can properly say "This modifies the <slot> ability"

            "icon": "/interface/cockpit/weather/rain.png",

            //Defaults to '/items/augments/sb_abilitymod/<abilityName>.png`

            "weaponName": "sniperrifle",

            //Used for a custom subtitle for the item's tooltip. For example, 'Ability Mod (S. Rifle)'. If there is no defined `weaponNames` value in the `sb_abilitymod.config` file, it simply capitalizes weaponName itself. For the sniper rifle example, in English 'Weapon Mod (Sniper Rifle)' won't fit in the item tooltip, so we have 'sniperrifle' point to the 'S. Rifle' string. I did it this way so translation mods can change 'S. Rifle' to '狙击枪' instead of it being forced to be in English.

            "acceptedElements": ["physical"]

            //Only weapons with the listed elements can accept this ability. This value is automatically added to the item by its buildscript, using data from the weapon ability file (not `sb_abilitymods.config`, but rather like `downstab.ability`), but you can override it here. Some vanilla abilities have physical and elemental variants, with the physical ones assuming they will never be used on an elemental weapon and therefore do not define any specifical elemental data. We need to override it because these abilities do not work on elemental weapons, and the since ability has no specific elemental data, the buildscript does not find any elemental data and assumes "This is an ability which has no elemental requirements"

            //If that was confusing, only add this value if your ability is not structured in a way that detects the weapon's element!

        }

    }

]

Weapon name groups:

[

    {

        "op": "add",

        "path": "/weaponNames/customSubtitle",

        "value": "Custom Subtitle"

    }

]

It is simply that easy.

Poisoncreep Immunity (for aquatic/robotic races)

Betabound adds a new crop called Poisoncreep. It's poisonous to anyone but those of aquatic disposition, but those that have Glitch-like digestive systems are also unaffected. It heals those who are unaffected but poisons those who are.

If you want your race to be immune to Poisoncreep's poison, add a statusEffects list to your species file and add the 'sb_poisoncreepimmunity' effect. You can check out the novakid species file for a more direct example.

(This is currently not in the public release of Betabound! It will come soon though)

"statusEffects": ["sb_poisoncreepimmunity"]

If you want to patch a species to be immune, use this (note that you MUST have square brackets at the start and end of your patch UNLESS they are already present! They are present in this example.):

[

  [{

      "op": "test",

      "path": "/statusEffects",

      "inverse": true

    }, {

      "op": "add",

      "path": "/statusEffects",

      "value": []

    }

  ],

  [{

      "op": "add",

      "path": "/statusEffects/-",

      "value": "sb_poisoncreepimmunity"

    }

  ]

]