Instructions - GonDragon/Bookstore-Starbound GitHub Wiki

As the bookstore is intended to be some sort of framework to other mods to put their lore or quest in a common place, I made an effort to make putting a tab or a book in the bookstore, a pretty easy thing to do.

The only thing a moder should do, it's a patch like this in his mod:

objects\bookstore\bookstore.object.patch

Now, let's see what the patch should contain

Add a book to a tab

The books are not items per se, but codex that can be represented as items. They are defined in his own .codex file-type, and they have his own unique ID that define them. To make a patch, you only need to use that ID.

The patch, will be in the next form:

[
  {
  "op": "add",
  "path": "/storeInventory/<category>/-",
  "value": "<id>-codex" 
  } 
]

Were <id> is the unique ID of the codex that you want as a book, and <category> is the tab in wich you want the book to appear. In the base mod, you have three categories, novels, manuals and history, but other mod could add his own tabs.

Add a new tab

Maybe you don't found the right tab, maybe you want a more specific clasification, or maybe you just want a place to put your books and only your books. No mather the reason, if you want to add a new tab, it's just an easy adition to the patch. You will need three things this time, but first, let's see the structure

[
  { "op": "add",
	"path": "/interactData/modTab/-",
	"value": {
	  "file": "<iconPath>",
	  "label": "<tabName>",
	  "filter": [ "<category>" ]
	}
  },
  {
	"op": "add",
	"path": "/storeInventory/<category>",
	"value": []
  }
]
  • <iconPath>: it's the direction of the image that you will use as a icon for your tab. It should be a 13x13 png file.
  • <tabName>: it's the name that will appear next to the icon.
  • <category>: it's the category of the tab, the name that you need to know to add books to that tab. I recommend using a single word, in lowercase.

Easy, isn't it? Now, let's see an example.

Example

In this example, I only will use assets from the game. What I going to do it's, add One book to the novel tab, create a new tab, and add two books to that tab. If you only want the file, you can found it here.

Well, first, I want to add the ancient alphabet to novels. Why? Why not? Let's see how it is done. First, looking in the file ancientalphabet.codex, I found that the ID of that codex is ancientalphabet. Knowing that I want to add the book to novels, I write the patch.

[
	{
	"op": "add",
	"path": "/storeInventory/novels/-",
	"value": "ancientalphabet-codex" 
	} 
]

Done. The alphabet should now appear on the game. Let's take a look. Imgur

Look, it's there! it works! Now, in the picture you could see a small sneak peek of what comes next: Add a new tab.

The new tab that I wanted to create it's for science paper, so I decided to call the tab Science, put there books of the category science, and I selected a small bottle icon to represent the tab, under the directorie /interface/crafting/tabicon_ingredientsbottle.png. Now, let's write the patch.

[
  { "op": "add",
	"path": "/interactData/modTab/-",
	"value": {
	  "file": "/interface/crafting/tabicon_ingredientsbottle.png",
	  "label": "Science",
	  "filter": [ "science" ]
	}
  },
  {
	"op": "add",
	"path": "/storeInventory/science",
	"value": []
  }
]

But we don't want a empty tab. So let's throw some books in there. I selected two books from the apex, ther IDs are apexhistory3 and apexhistory7. Let put them together, and let's see how the patch looks.

[
	[
	  { "op": "add",
		"path": "/interactData/modTab/-",
		"value": {
		  "file": "/interface/crafting/tabicon_ingredientsbottle.png",
		  "label": "Science",
		  "filter": [ "science" ]
		}
	  },
	  {
		"op": "add",
		"path": "/storeInventory/science",
		"value": []
	  }
	],
	[
		{
		"op": "add",
		"path": "/storeInventory/science/-",
		"value": "apexhistory3-codex" 
		},
		{
		"op": "add",
		"path": "/storeInventory/science/-",
		"value": "apexhistory7-codex" 
		} 
	]
]

Meanswhile, in the game... Imgur

Looks fine, didn't it? You could add all the books and tabs that you want, there is no limit. But remember, if you add books to a new tab, you should ALWAYS add the tab first. And now, get fun writing new lore for the game!

⚠️ **GitHub.com Fallback** ⚠️