Starbound

Starbound

CityScaper 2.0 - Building Made Easy!
 This topic has been pinned, so it's probably important
Neb  [developer] Mar 23 @ 5:40am
2.0 Module Addons - Mod Tutorial
The CityScaper interface has a list of icons on the left, which are modules, each of these represent a mod, or something similar that is used for categorising your content!

This may be helpful if you are unfamiliar with Starbound modding:
https://steamcommunity.com/sharedfiles/filedetails/?id=2574693146

You will need
  • This template![github.com]
  • If you are creating a new dungeon from scratch, you will need Tiled - see my guide for more info
  • A text editor that is not windows notepad, I suggest Notepad++ but feel free to use anything you're familiar with, this is just JSON you are editing, not real code.
  • An image editor, or art program. I suggest paint dot net, however any will work as long as it supports transparency and is not GIMP.
  • A brain, this is necessary for most actions but if you do not have one, feel free to ask for help! I will help if I get time!

New Modules
Before we begin, all instances of YOURMODNAME!!! must be the same!
  1. Start by downloading this patch template[github.com]
  2. Navigate to
    /interface/scripted/cityscaper/modules/
  3. Rename the folder YOURMODNAME!!! with your mods name.*
  4. Enter the icons folder and rename the image YOURMODNAME!!! with your mods name. Change the icon to be whatever your like, but the maximum size is 23x23, anything higher will be cut off!
  5. Return to the modules folder, and open
    neb-cityscaper-modules.config.patch
    in your text editor.
  6. At the top of the file is an example similar to what is attached here.
    { "shortDescription" : "Room Name", "variant" : "1", "filter" : "S", "dungeon" : "PREFIX-YOURDUNGEONNAME", "previewImage" : "/interface/scripted/cityscaper/modules/YOURMODNAME!!!/rooms/YOURDUNGEONNAME.png", "cost" : { "money" : 7500, "upgrademodule" : 1, "pressurisedbeam" : 50, "pressuriseddurasteel" : 50, "pressurisedgirder" : 50, "outpostwall2" : 50 } }
  7. Replace PREFIX-YOURDUNGEONNAME with the dungeon that this specific one will be adding, and place it under rooms, prefabs or dungeons. **
  8. Adjust the costs to what you believe it should cost for your item, it should be formatted like a recipe, e.g.
    "itemid" : count
  9. Change the variant to be whatever you like, I use it to show Left/Middle/Right - number, so show it is a left connecting, and to distinguish it from similar parts of the same role. If that's too complicated, just count them up if they have the same name.
  10. Adjust the filter to be; S, M or L, if you want it to be filtered by the buttons above the search bar. They stand for Small, Medium and Large, and are used for making things match up in sizes.
  11. Navigate to
    /dungeons/cityscaper/
    and place your dungeon in whichever folder it belongs in.**
  12. Ensure the dungeon name matches the PREFIX-YOURDUNGEONNAME from earlier.
  13. If your game is open, do /reload, and your changes will be applied! If the game crashes or your file does not appear, you likely made an error! See troubleshooting for more info.
* Try to have a prefix, such as neb- to your mod, I use neb- as this is my name and signature. This prevents conflicting mod names. For example, neb-shellguard. If you do not do this, your content will be merged with other modules of the same name which means they will appear in the same list, or may overwrite each other. This can be intended on your end.
** Rooms are singular rooms, Prefabs are prebuilt houses, or parts of bigger things like space stations, while Dungeons are full builds, like dungeons or full built mansions.

Dungeon Images
To get an image of your dungeon, in Tiled while looking at your dungeon:
  1. Hide any wiring, mods, stagehands or things you do NOT want seen in the preview.
  2. At the top left of the screen, go
    File > Export As Image
  3. This location should be the same as the code specified in Step 6 of the Module section; select
    "/interface/scripted/cityscaper/modules/YOURMODNAME!!!/rooms/"
  4. Make sure ONLY "Only include visible layers" is selected and nothing else.
  5. Hit export!
The system automatically gets the size of your dungeon from this image, so make sure it is accurate!

If you are a mod developer of your own mod, you can add compatibility built into your mod with test patches, however as I do not know the ins and outs of these yet, I will have to get back to you on how to do that later.

Troubleshooting
While modding you will encounter errors, its guaranteed since nobody but me is perfect.
If you encounter an error, go to your local files, navigate to
/storage or /logs if you have OSB
and find the file called
starbound.log
ENSURE THERE ARE NO NUMBERS, these are old versions of the log and will not contain the error. Scroll down to the bottom and find the line that has ERROR at the start of it, and read it, it will usually tell you which file failed. Then take it to a json linter and see where you went wrong!
Last edited by Neb; Mar 23 @ 5:51am