Stroomschok Posted February 24, 2025 Report Posted February 24, 2025 (edited) I'm trying to add an 'transitionablePropsByType' attribute to firewood (similar to what the driedpeat mod does), but because it's in the root of the object, it seems I can't seem to get the path right. '/', and '/-' neither work (but according to the documentation, addMerge shouldn't care?) and they give the error: "[Error] Exception: Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JArray'." How can I fix this? Also does anyone know what the 'freshHours' attribute does? [ { "op": "replace", "path": "/combustibleProps/burnTemperature", "value": 600, "file": "game:itemtypes/resource/firewood.json", "side": "Server" }, { "op": "addMerge", "path": "/", "value": { "transitionablePropsByType": { "*": [{ "type": "Cure", "freshHours": { "avg": 0 }, "transitionHours": { "avg": 120 }, "transitionedStack": { "type": "item", "code": "game:agedfirewood" }, "transitionRatio": 1 }] } }, "file": "game:itemtypes/resource/firewood.json", "side": "Server" } ] Edited February 24, 2025 by Stroomschok
Brady_The Posted February 24, 2025 Report Posted February 24, 2025 30 minutes ago, Stroomschok said: I'm trying to add an 'transitionablePropsByType' attribute to firewood (similar to what the driedpeat mod does), but because it's in the root of the object, it seems I can't seem to get the path right. '/', and '/-' neither work (but according to the documentation, addMerge shouldn't care?) and they give the error: "[Error] Exception: Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JArray'." How can I fix this? Also does anyone know what the 'freshHours' attribute does? The path is incorrect. Your first instinct wasn't too bad, you want to add something at the root after all, but you do that by inserting the key you want to add directly into the path. "path": "/transitionablePropsByType", That of course means, that the value has to be adjusted as well, starting it with "*": instead. (Don't forget to remove the trailing bracket "}" either.) "freshHours" is pretty straight-forward. This numbers sets up the time an item has before it spoils. For firewood "Cure" is the wrong kind of "type", though. If you look at the bowstave, you can see that for wood and such "Dry" is being used. That's also the reason why you probably want to set the number to 0, so that the firewood starts transitioning right away. 1
Stroomschok Posted February 25, 2025 Author Report Posted February 25, 2025 Again ,thanks very much for your useful advice 1
Recommended Posts