bk3k's Tech Helper
bk3000  [developer] Jan 23, 2018 @ 10:48pm
"How to" thread.

Don't try to copy the code direct from my post - as it appears
Hit the quote button. Then copy the code from your own text entry field. You can hit the cancel button after that.

First lets start with _metadata
I edited this section, because honestly you don't need to do anything in _metadata, however I'll leave the following note on what NOT to do -

I don't recommend to use "requires" because THIS mod is also present in my tech mod, thus either mod would satisfy the dependency. Go ahead an give users a choice instead of locking them in. What's more, "includes" won't crash Starbound on opening if they're missing anything (namely anything listed in the array). Your techs might not show up if they're missing it, but that's better than a crash on open.

Another reason to not use "requires" in your _metadata is that I expect this could get used with mods already on the workshop today. Those mods have an active user base, and it wouldn't be good if those users suddenly get crashes attempting to load Starbound. Very few actually check their logs. "includes" will not crash anyone.

User Controls on your Steam Page
You'd probably still add a link to this mod page from your own page though. It is good to mention in the description and throw a link there. But also use the "Owner Controls" found on the right hand side of your mod's workshop page. Click "Add/Remove Required Items" and add this mod. That provides another visible link (button), but also will cause Steam to pop up a reminder about the required mod if they try to subscribe without. That cuts down on "user error" support requests considerably.

(continued in later posts).
Last edited by bk3000; Jul 21, 2018 @ 11:20pm
< >
Showing 1-2 of 2 comments
bk3000  [developer] Jan 23, 2018 @ 11:46pm 
The file you really need to add is

Now if you look at mine (either from this mod or my tech mod) you'll see a lot going on. You don't want all that. An example file of what it should look like for you -
[ [ { "op" : "test", "path" : "/modTech", "inverse" : true }, { "op" : "add", "path" : "/modTech", "value" : [] } ], [ { "op" : "add", "path" : "/modTech/-", "value" : "example_tech1" //simple name string will unlock and enable the tech. }, { "op" : "add", "path" : "/modTech/-", "value" : { //using a JSON object instead of a string enables more options "name" : "example_tech2", //"name" is the only REQUIRED attribute when using JSON objects instead of strings "adminEnable" : true, //administrators get this tech without requirements "unlockOnly" : true //tech is unlocked but not enabled by default aka player must pay to unlock } }, { "op" : "add", "path" : "/modTech/-", "value" : { //using a JSON object instead of a string enables more options "name" : "example_tech3", "adminEnable" : true, "unlockOnly" : true, "requirements" : { //every single requirement is OPTIONAL so use any combination you like "species" : ["hylotl", "floran"], //races listed here are the exclusive users of the tech "universeFlag" : "outpost_mission1", //requires the flag to be set (which affects ALL players) "quest" : "human_mission1", //Player must have completed this quest "allow_activeQuest" : true, //The quest defined by "quest" doesn't need to be complete to count "techUnlocked" : "dash", //This tech much be unlocked first(enabled not necessary) "techEnabled" : "sprint" //This tech must be enabled first(thus unlocked AND paid for) } } } ] ]
Now that has lots of comments. Might be hard to read in this thread so you might want to copy it into something like Notepad++ (or whatever you use). Without the comments it looks like this -
[ [ { "op" : "test", "path" : "/modTech", "inverse" : true }, { "op" : "add", "path" : "/modTech", "value" : [] } ], [ { "op" : "add", "path" : "/modTech/-", "value" : "example_tech1" }, { "op" : "add", "path" : "/modTech/-", "value" : { "name" : "example_tech2", "adminEnable" : true, "unlockOnly" : true } }, { "op" : "add", "path" : "/modTech/-", "value" : { "name" : "example_tech3", "adminEnable" : true, "unlockOnly" : true, "requirements" : { "species" : ["hylotl", "floran"], "universeFlag" : "outpost_mission1", "quest" : "human_mission1", "allow_activeQuest" : true, "techUnlocked" : "dash", "techEnabled" : "sprint" } } } ] ]

And it might not look exactly like that, since each tech used a little different way. You'd probably choose just one way - whatever works for you.

The first tech used the most simple method - a method with no control. By adding your tech's name as a string, to the "modTech" array, it It simply unlocks and is enabled... instantly and for free upon the player using the "techconsole" object.

The second tech is a JSON object - which is what you need for all the options. It has no requirements. It unlocks the tech (makes it available but not enabled). The users still needs to pay for the tech. It is also set to unlock for free for administrators. That's nice for testing your techs. That's still purely optional.

The third uses many requirements. The comments should clarify what they do. Typically you won't use nearly so many requirements. You'd just pick the ones that work for you. Every requirement is optional and can be used independently of the others, or in combination. Of course "allow_activeQuest" is meaningless without also using "quest" as well.

For each requirement you set, they ALL must be true before the player actually receives the tech. In the off-hand chance that you actually wanted two "paths" to unlock a tech, just add it twice - each with different requirements. That's probably an edge case, but at least it is a workable one.
Last edited by bk3000; Jul 21, 2018 @ 11:24pm
bk3000  [developer] Jan 24, 2018 @ 12:13am 
Alternative enable items
By default (as in vanilla) the techs will require "techcard" items. If you add in your .tech file
"chipCost" : 8,
etc, then you can set the amount of "techcard" items you need. FYI they where originally called tech chips, thus "chipCost" is still used. If you don't add "chipCost" to your .tech file, then it defaults to a value set in
which in vanilla is
"defaultCost" : 5

No news there, right? But suppose you add this to your .tech file
"enable" : { "item" : "autochip", "count" : 50 },
Now your tech requires 50 Auto Chips to unlock. The interface will tell the players what they actually need rather than "Tech Cards" it will display "Auto Chips". And note "Auto Chips" rather than "autochip" per the item name. It loads the "shortdescription" of the item and displays that. But... it also reads the last character of "shortdescription" and appends an "s" if it doesn't already end in "s" Hmm maybe I should make sure the "count" is > 1 before I do that.

Anyhow if you add that, it will ignore "chipCost" and just use the item you specify instead.


I should note at the current time currency items don't work. It always thinks you have 0 because you don't actually have them in your inventory. I'll add that later.


I should have noted long ago that my previous edit is no longer true. Currency items use is fully functional. Also of note, my auto pluralization is better than in the initial version, and an over-ride is available so you can define yourself the plural form of the item name.
Last edited by bk3000; Jul 21, 2018 @ 11:27pm
< >
Showing 1-2 of 2 comments
Per page: 15 30 50