Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Please allow replacement operations to JSON, not merely CSV, by mods.  (Read 2838 times)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile

Pretty simple request (and I think it should be relatively easy to add to the Mod Loader, given how JSON works).

Basically, if a mod just wants to touch, say, one line in a JSON, it shouldn't block other mods from also touching lines in that JSON.  Instead, that Object / Array is compared to the other one and to Vanilla, and if the new data doesn't match Vanilla, then that change should be preserved, but otherwise, the JSON should overwrite Vanilla data.

This is a bigger problem than you'd think; mods that touch Vanilla's .SHIP, .WPN, .VARIANT, etc., etc. files are not behaving well with one another; essentially, the first one to replace a JSON "wins" and nothing else is allowed to change that data. 

This means that multiple mods that touch these files aren't really possible and it meant I had to figure out how to get "first in line" with the FX Mod to win potential IO conflicts, rather than keeping the mod strictly meeting the standards for "utility" mods (i.e., "do not interfere with others").
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24149
    • View Profile

Oh, hey, I thought it already did that, since it does do it for .faction and other campaign-related json files. But it wasn't, due to it being old code that I'd never updated. Which I did now, so, should be good to go.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile

Thank you very, very much! I'll, uh, get rid of the wholesale changes to .WPN / .PROJ files in the FX mod when 8.1's out.
Logged
Please check out my SS projects :)
Xeno's Mod Pack