Modding:Modding Basics

From Starbounder - Starbound Wiki
(Redirected from Modding Basics)
Jump to: navigation, search

This article will show you the steps you need to take before you can start actually modding, and also the steps you can take after you are done modding, to pack and publish your mod.

You will need a text editor that is not the Windows included notepad.exe, as it does not support UNIX line endings. Do not use a word processor such as MS Word. Only UTF-8 is supported, other encodings are likely to cause crashes.

Optionally, to pack and unpack mods and assets more easily, you may use ModPackHelper (Windows and Linux) or PAK GUI.

Step 1: Unpacking Assets

Furious Koala introduced a .pak format which improves loading times and eases mod distribution. This means we need to unpack the assets before we can start modding.

Note: This step will not remove or change your packed.pak file, but simply extract its content for use as reference material. Unpacked assets may be safely left in ..\assets\ and modifying the unpacked assets will not affect your game as Starbound will prioritize the use of assets.pak (unless the unpacked _metadata is deleted).

Windows

Current as of Version 1.4.3, June 27th, 2019

  1. Open up the main directory folder for Starbound.
  2. Shift + right-click in the folder and select Open Command Prompt/Powershell or equivalent (depends on Windows version).
  3. Type .\win32\asset_unpacker.exe ".\assets\packed.pak" ".\assets\packed" into Command Prompt/Powershell.
  4. Command Prompt/Powershell will not show progress updates until asset_unpacker.exe has finished, this will take a while on most computers.
  5. Once Command Prompt/Powershell displays the message "Unpacked assets to Packed in [time it took]s," you can close the program and move on to creating mods.

Notes

  • If purchased from Steam, the location of the main Starbound directory folder typically looks like Steam\steamapps\common\Starbound
  • The text typed into Command Prompt/Powershell are three directory locations:
    1. The location of asset_unpacker.exe, which is the program that does all of the unpacking.
    2. The location of Starbound assets, or Mod assets, to be unpacked.
    3. Where you want the unpacked assets to be dumped. This third string can be changed to whichever location or name you prefer, but dumping into ..\assets\packed\ will make assets more readily available to Tiled.
  • The command can be stored as a batch file for faster unpacking whenever a new game version is released.

It is advised to read the Unofficial Modding E-book instead, available on Chucklefish Forums. https://community.playstarbound.com/resources/unofficial-modding-ebook-2-0.2930/

Mac

Current as of version 1.3.0, June 13th, 2017

If you got Starbound from Steam, these instructions will work. Otherwise you have to find your Starbound assets folder and apply the file paths to these instructions.

  1. Open Terminal.app in OS X (hopefully you have 10.7 or higher)
  2. Type cd ~/Library/Application\ Support/Steam/steamapps/common/Starbound/assets Now you are in the assets folder.
  3. You need to create a new folder here where you want your unpacked assets to end up. Type mkdir unpacked
  4. Now you need to navigate to the asset_unpacker. Type cd ../osx
  5. Type ./asset_unpacker ../assets/packed.pak ../assets/unpacked (The asset_unpacker should finish anywhere from 1 to 500 seconds depending on your computer, so let it work. If it takes longer than 20 minutes, quit Terminal.app and start over. If retrying doesn't work, then you have an issue external to the asset_unpacker.)
  6. In Finder browse to your unpacked folder by clicking on "Go" on the menu bar, holding the [alt/option] key on your keyboard (this will show Library, which is usually hidden), clicking on Library, then browsing to → Application Support → Steam → steamapps → common → Starbound → assets → unpacked (sound familiar?).

You are highly recommended to backup your original, working packed.pak before you mod and pack.

To pack, do exactly the same steps as mentioned above (minus making a new folder 'unpacked'), but when you get to step 5, where you actually unpack the packed.pak file:

  • Type ./asset_packer ../assets/unpacked ../assets/packed.pak

Linux

Current as of version 1.2.3b, May 26th, 2017

  1. Open starbound's main directory in shell (~/.steam/steam/steamapps/common/Starbound if purchased on steam)
  2. Type linux/asset_unpacker assets/packed.pak unpacked_assets in shell
  3. linux/asset_unpacker is the path to the executable
  4. assets/packed.pak is the path to the packed assets
  5. unpacked_assets is the directory name it'll extract the files in. If the directory doesn't exist, it'll make one.
  6. There is no progress bar while unpacking, but after completion, it'll print something like Unpacked assets to unpacked_assets in [time it took]s
  7. After that message appears, you can close the shell and start creating mods.

Step 2: Modding

Tutorials

Reference Pages

If you did everything right, Starbound should load your new mod the next time you run it. If the game crashes, or your changes are not found in the game, check your starbound.log file.

Step 3: Setting Up Your First Mod

Metadata file

Full Article: Metadata file

The metadata file (usually named _metadata) is a completely optional file that contains your mod's name, description, and more. If using the Steam Uploader Tool, it will generate a basic metadata file for you. While optional, it is recommended to have at least have a name set in the metadata in case a companion mod ever needs to require or include your mod, and to make your mod more easily identifiable within the game log should errors occur.

Step 4: Packing your mod

Before publishing your mod, packing it as a single <modname>.pak file is recommended. This simplifies installation (drop the file in Starbound/mods/ folder).

The alternative is to just put all the files into an archive for distribution which end users will need to unpack to install.

Steam

The mod uploader included with the Steam version of Starbound will automatically pack your mod into a pak file when it uploads to the workshop. If you subscribe to your own mod, you may copy this pak from the workshop folder for redistribution through other channels, or you may follow standard packing methods. Linux users may use Proton to launch the mod uploader.

Alternately, all users may use the SteamCMD method as per this guide by The | Suit. This is the only reliable option for Mac users.

General

To pack your mod into a pak file, you may either manually use asset_packer.exe as included with Starbound, or you can automate it with PAK GUI or ModPackHelper.

Manual Method

  1. Create a metadata file for your mod if you intend to include one.
  2. For ease of use, ensure your mod folder is in ..\Starbound\mods\
  3. Open a command prompt as described in Unpacking assets.
  4. Run the command .\win32\asset_packer.exe .\mods\<mod folder name> .\mods\<modname>.pak (substitute <mod folder name> with your mod's folder and <modname> with whatever you wish)
  5. Once finished, your .pak will be in the ..\Starbound\mods\ folder and is ready to publish.

PAK GUI

  1. Create a metadata file for your mod if you intend to include one.
  2. Extract PAK GUI anywhere and run it.
  3. Point the "Path to Starbound" to the base Starbound folder.
  4. Either click "Pack..." or drop your mod's folder onto PAK GUI and follow the prompts.

Windows/Linux with ModPackHelper

  1. Unpack ModPackHelper directly into ..\Starbound\mods\ and run it.
  2. When script is launched, choose action 1.
  3. Select the mod you want to pack (If your mod folder does not contain a _metadata or legacy .modinfo file, it will not show as a choice).
  4. Press Enter. The mod is available in the Starbound/mods/ folder as <modname>.pak.

Step 5: Publishing

Only one thing left to do - publish your mod!

Chucklefish

Go to the official modding forums, select "add mod" in the upper right hand section, select the category of your mod, fill out the information form and hit save. It is that easy.

Steam

Once you have all desired fields filled in the uploader, hit "Upload to Steam". When the status bar vanishes, you're done!

Other Services

Publishing methods for other services, such as NexusMods, may vary. Please refer to the individual service for more information. Otherwise, your mod's folder or pak file may be distributed as you choose.

External links

Quick Navigation