So im creating this mod, where I add some food and recipes. Since there is this cooking.collection thing, I wanted to implement my items into there. I tried using a cooking.collection.patch with this code: Code: [ { "op": "add", "path": "/collectables/-", "value": "spaghetti" : { "order" : 151, "item" : "pasta" } },{ "op": "add", "path": "/collectables/-", "value": "spaghetti" : { "order" : 152, "item" : "spaghetti" } } ] but it doesn't work with other mods (because they also add a collectable at the order 151/152) I wanted to know, if instead of typing a number for "order", I could use some trick, to put it at the end of the list. (like the ".../-" for paths)
you could do a workaround where you run the test command to see which other mods are present and add yours adaptively
the main thread where testing is covered: http://community.playstarbound.com/threads/basic-patching-now-with-path-guide-v1-9.84496/ additional explanation: http://community.playstarbound.com/...stable-update-notes.95106/page-5#post-2561028 If you share the names of the other mods that are causing this issue for you I will look at them return a template for a functional test function for you.
thanks, I will read into it! for example frackin universe is causing issues, by adding some food to the collection the cooking.collection.patch: Code: [ { "op": "add", "path": "/collectables/meatchunk", "value": { "order" : 151, "item" : "meatchunk" } }, { "op": "add", "path": "/collectables/avikanmeal", "value": { "order" : 152, "item" : "avikanmeal" } }, { "op": "add", "path": "/collectables/bolbohnjam", "value": { "order" : 153, "item" : "bolbohnjam" } }, { "op": "add", "path": "/collectables/spicebol", "value": { "order" : 154, "item" : "spicebol" } }, { "op": "add", "path": "/collectables/dunebun", "value": { "order" : 155, "item" : "dunebun" } }, { "op": "add", "path": "/collectables/stuffeddunebun", "value": { "order" : 156, "item" : "stuffeddunebun" } }, { "op": "add", "path": "/collectables/kadavancactusjuice", "value": { "order" : 157, "item" : "kadavancactusjuice" } }, { "op": "add", "path": "/collectables/kadavanmeatjuice", "value": { "order" : 158, "item" : "kadavanmeatjuice" } } ] of course I could just make my code to fit that perfectly, so that it starts with 159, then 160 ... but if I were to publish my mod, it would still be incompatible, if the user has different mods though
The better solution is to just create your own collection category. There is no way to make a "smart" patch as you are describing, you would need to test for each mod individually. The patch for FU would look like this: Code: [[ { "op" : "test", "path" : "/collectables/kadavanmeatjuice" }, { "op": "add", "path": "/collectables/spaghetti", "value": { "order" : 159, "item" : "pasta" } }, { "op": "add", "path": "/collectables/spaghetti0", "value": { "order" : 160, "item" : "spaghetti" } } ],[ { "op" : "test", "path" : "/collectables/kadavanmeatjuice", "inverse" : "true" }, { "op": "add", "path": "/collectables/spaghetti", "value": { "order" : 151, "item" : "pasta" } }, { "op": "add", "path": "/collectables/spaghetti0", "value": { "order" : 152, "item" : "spaghetti" } } ]] But this way gets increasingly complicated the more mods you have to account for. side note: ending the path with a hyphen works for adding to the end of an array [], not to an object {}.
Too bad. I thought there was something implemented like this. I will just make my own collection then. Thanks anyway!