Starbound

Starbound

Zekrom's Kazdra Fixes and Recipes! KAZDRA IN SPACE!
zekrom_vale  [开发者] 2018 年 3 月 31 日 上午 6:26
Moding tips/hints
Things that may help moding! Or warnings on what not to do.
< >
正在显示第 1 - 5 条,共 5 条留言
zekrom_vale  [开发者] 2018 年 3 月 31 日 上午 6:53 
Starbound JSON .patch files can be segmented [[patch],[patch]]

Input
{ "n":"c" }
Patch
[[ { "op": "test", "path": "/n"}, {"op":"replace","path":"/n","value": "a"} ],[ { "op": "test", "path": "/m"}, {"op":"replace","path":"/m","value": "b"} ]]
Output
{ "n":"a" }


If else statment
[[ { "op": "test", "path": "/n"}, {"op":"replace","path":"/n","value": "a"} ],[ { "op": "test", "path": "/n", "inverse": true }, { "op": "test", "path": "/m"}, {"op":"replace","path":"/m","value": "b"} ],[ { "op": "test", "path": "/n", "inverse": true }, { "op": "test", "path": "/m", "inverse": true}, { "op": "test", "path": "/q"}, {"op":"replace","path":"/m","value": "b"} ]]

And
[ { "op": "test", "path": "/n"}, { "op": "test", "path": "/m"}, { "op": "test", "path": "/q"}, {"op":"replace","path":"/n","value": "a"} ]

Xor
[[ { "op": "test", "path": "/n"}, { "op": "test", "path": "/m", "inverse": true}, {"op":"replace","path":"/n","value": "a"} ],[ { "op": "test", "path": "/n", "inverse": true}, { "op": "test", "path": "/m"}, {"op":"replace","path":"/n","value": "a"} ]]

Or //"inverse":true allows it to only run once
[[ { "op": "test", "path": "/n"}, { "op": "test", "path": "/m", "inverse": true}, {"op":"replace","path":"/n","value": "a"} ],[ { "op": "test", "path": "/n", "inverse": true}, { "op": "test", "path": "/m"}, {"op":"replace","path":"/n","value": "a"} ],[ { "op": "test", "path": "/n"}, { "op": "test", "path": "/m"}, {"op":"replace","path":"/n","value": "a"} ]]
最后由 zekrom_vale 编辑于; 2018 年 4 月 9 日 下午 12:20
zekrom_vale  [开发者] 2018 年 3 月 31 日 上午 6:54 
Do not use google drive sync if you care about filling your trash with junk! Every removed file goes into the trash!
zekrom_vale  [开发者] 2018 年 3 月 31 日 下午 6:26 
%ProgramFiles(x86)%\Steam\steamapps\common\Starbound\win32\sbinit.config and %ProgramFiles(x86)%\Steam\steamapps\common\Starbound\win64\sbinit.config contains the "assetDirectories" settings so I created a folder called mymods in the Starbound folder (Not mods as it tries to double load mods) and create a folder for my github root folder and another for starbound and add it to the assetDirectories. For example it could look like this...
"assetDirectories" : [ "..\\assets\\", "..\\mods\\", "..\\mymods\\DraconisShipForKazdra\\", "..\\mymods\\KazdraDungeonPatch\\", "..\\mymods\\ZekromsKazdraRecipes\\", "..\\mymods\\yourmodname\\" ]

Note: if you want to keep old unused code in the file it must not be in the last folder (ex "..\\mymods\\yourmodname") to fix this you can put it in mymods or add another folder.

So it now looks like:
"assetDirectories" : [ "..\\assets\\", "..\\mods\\", "..\\mymods\\DraconisShipForKazdra\\raconisShipForKazdra\\", "..\\mymods\\KazdraDungeonPatch\\KazdraDungeonPatch\\", "..\\mymods\\ZekromsKazdraRecipes\\ZekromsKazdraRecipes\\", "..\\mymods\\yourmodname\\yourmodname\\" ]
最后由 zekrom_vale 编辑于; 2018 年 4 月 9 日 上午 5:57
zekrom_vale  [开发者] 2018 年 4 月 9 日 上午 5:18 
JSON patch "and" will replace the current value if it exists.
zekrom_vale  [开发者] 2018 年 4 月 9 日 上午 5:23 
JSON patch "add" needs to have the parent element to exist. The folowing code will not work!
{ "a":{} }
[{ "op":"add", "path":"/a/b/c", "value":false }]
But this will!
[{ "op":"add", "path":"/a/b", "value":{"c":false} }]
最后由 zekrom_vale 编辑于; 2018 年 4 月 9 日 上午 5:26
< >
正在显示第 1 - 5 条,共 5 条留言
每页显示数: 1530 50