Relative vs absolute uri

I’m getting back into modding after ~6 months hiatus, and my mod is all broke. The problem is me trying to be clever referring to files via relative reference. For example, in the recipes list for a crafter, I’d refer to a particular recipe as:


That “my_item” folder has the item’s main json, ghost, iconic, etc. as well as the recipe. So in the my_item_recipe.json file, I’d just refer to “file(my_item.json)” in the “produces” bit of the recipe. This used to work a few alphas ago, but sadly now it creates problems in game finding the root uri of the iconic and ghost forms. When I add the item to aliases in my manifest and use that in my recipe’s “produces”, the problem is fixed.

Anyway, the reason I took this approach is I’m using palettes to allow for multiple versions of sets of related items, and if I don’t have any absolute paths in my main item, ghost, iconic, and recipe json files, I can copy whole trees of folders and tweak just the high-level mixin that contains the color definitions. Now it looks like I need to insert absolute paths in all my recipe files.

My question is whether any other modders have tried similar tricks and clever use of mixins to pass info down to more generic classes. Crossing my fingers that somehow I can still get away without absolute uris so deep in my file system…

It should have worked.

file("") always grab a path starting where the current file is.

In the error log it reports that it could not find the root entity for the iconic. It works somewhat in that the crafter can make the item, it appears in it’s iconic form, but it’s missing much of the info from the entity (no name or description, no material tags so the hearthlings drop the iconic on the ground instead of a stockpile, etc.). The iconic can then be placed, but then the error log pops up, and the placed item still lacks its name and description and can’t be un-deployed to the stockpile.

I had a similar problem with ingredients last summer. My mod has base components that are used to build other items. Those I had to add to my manifest and refer to explicitly through the aliases due to some prior update back then. I suspect that most modders are following the devs example and adding all items as aliases in their manifests. My mod used to have almost no aliases – all items got added to the game catalog through their recipes alone.