File path inconsistency

I have been working on making an editor which uses json schema to autocomplete.

In this work found two strange things about paths:

  • Some file references has to contain “file()” and others doesn’t.
  • Some path have to be absolute from the “mod” folder while others are relative to the file they are referenced in.

Eksamples:

Mixins in
"mixins" : “file(arch_backed_chair_ghost.json)”

Recipe portrait
"portrait" : “/sharpe/qube/qube.png”

Are there any plans to make this more consistent?

There’s a reason why it’s like that, and both are used in different circumstances (also, you don’t have to use one over the other, you just use whatever’s more convenient).

  • The “file(…)” command finds a file relative to the current file, this is really useful when referring to other files that are ‘close’ to the current file. Like finding an image for an entity, it’s usually in the same folder so the json file only has to refer to the image by using "file(entity_image.png)".

  • Absolute file paths are used to find a file relative from Stonehearth’s mods folder, it’s most commonly used when having override or mixinto from the manifest to refer to files in other mods.

  • There’s a second variant of using the first one: “file(/…)” (notice that this one starts with a ‘/’), this is kind of like using an absolute file path, only this time it’s searching from the start of the mod it resides in (i.e. where the manifest has to reside).

  • Also don’t forget that you can use aliases instead to find the files.

So, again, they can all be used, and which one that’s used is all up to the modder. You should really support all these different variations in your editor as I doubt that it will change (and I hope it won’t). :wink:

3 Likes