Starbound

Starbound

CityScaper 2.0 - Building Made Easy!
 此主题已被置顶,因此可能具有重要性
Neb  [开发者] 3 月 23 日 上午 5:40
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.yuanyoumao.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!
最后由 Neb 编辑于; 3 月 23 日 上午 5:51
< >
正在显示第 1 - 4 条,共 4 条留言
SG95 11 月 16 日 下午 5:16 
Where it says "Rename the folder YOURMODNAME!!! with your mods name.", did you mean rename the modules folder or make another folder inside that? Because i've been searching and if it was to be an folder with that name name already, is not there.
Neb  [开发者] 11 月 16 日 下午 11:00 
If it isn't there make it, for example if my mod is called "Neb's Funny Room" it would be /interface/scripted/cityscaper/modules/nebsfunnyroom
SG95 11 月 17 日 上午 5:59 
引用自 Neb
If it isn't there make it, for example if my mod is called "Neb's Funny Room" it would be /interface/scripted/cityscaper/modules/nebsfunnyroom

Perfect, now i understand, just a few more questions if you don't mind:

If i want to use blocks, decorations or other things from another mod, how can i add them to the modules? I understand i have to use Tiled to make the rooms, but i don't know how i can pull the images of the blocks i want to use.

Do the game or the mod know which blocks had to put on the rooms just by looking at them or do i have to make another file with expecific ID tags for each?

And lastly, if i finish and everything in the modules work, how can i share it on the workshop so others can use it or at least, let you know there is other modules besides the ones by default?
Neb  [开发者] 11 月 17 日 上午 6:41 
1. In tiled you place the tiles as normal, you just have to add their tileset to the dungeon. For tips on that go to the server as I don't really have the time to explain that kind of stuff specifically.
2. This is the same as question 1. You are creating a dungeon which houses all the information.
3. You just upload it to the workshop and make it require this mod.
< >
正在显示第 1 - 4 条,共 4 条留言
每页显示数: 1530 50