The Pack Folder
Available since 0.1.0
Where every file goes, how ids work, when /reload is enough and where to see what went wrong.
Everything you make with Foundry Apparatus lives in one folder, foundry_apparatus, next to the mods folder of your instance (or of your server). This page explains what goes where, how files point at each other, and what happens when the game reads them.
What goes where
Each kind of file has its own sub-folder:
| Folder | What it holds |
|---|---|
machines | One file per machine. |
recipes | One file per recipe. |
guis | Screens you want to reuse. A machine can also describe its screen right inside its own file. |
blocks, items | Extra blocks and items your machines need, such as casings or upgrades. |
assets/<namespace> | Models, textures and translations, exactly like a resource pack. |
Folder and file names must be lowercase: letters, digits, _, - and ..
Ids: how files find each other
Every file has an id, such as mypack:iron_smelter. It has two parts separated by a colon:
"id": "mypack:iron_smelter"- The part before the colon is your namespace: a short, lowercase name for your pack. Pick one and use it everywhere.
- The part after the colon is the name of this one thing.
Files point at each other by id. A recipe says which machine it belongs to by listing the machine's id:
"machines": [
"mypack:iron_smelter"
]If you type an id that does not exist, the game tells you, and it even suggests the id you probably meant (see FA-REF-001).
Comments are allowed
Files are JSON, but you can write comments in them, which is handy to remind yourself why something is there:
{
// The smelter is slower than a furnace on purpose.
"duration": 300
}Restart or /reload?
The game reads your files when it starts. After that, some changes apply right away with /reload and some need a restart:
| You changed… | Do this |
|---|---|
| A recipe | Type /reload in game. |
A screen (a file in guis) | Type /reload in game. Screens that are open when the layout changes close; open them again to see the new one. |
| A machine, block or item | Restart the game (or the server). |
When a /reload sees that a machine, block or item changed, it tells you that a restart is needed, so you never wonder why a change did not show up.
If a file you changed has an error, /reload keeps everything as it was and tells you what is wrong. Your world never runs with half of a broken change.
Where to see what went wrong
Foundry Apparatus checks every file before using it. When something is wrong, you get a message like this:
machines/iron_smelter.json:13:20 /storages/0/direction [FA-SCH-004] Value 'inside' of 'direction' violates its allowed domain (one of in, out, both).
Suggestion: Change 'direction' to one of in, out, both.Read it from left to right:
machines/iron_smelter.json:13:20is the file, the line (13) and the column (20)./storages/0/directionis the field: thedirectionof the first storage (counting starts at 0).FA-SCH-004is the code. Every code has a page in Error Codes explaining why it happens and how to fix it.- The rest is the message in plain words, followed by a suggestion.
You find these messages:
- in the game log,
logs/latest.login your instance folder, every time the game starts; - in chat, for operators, after every
/reload.
When one file has an error, files that point at it can complain too. If a machine fails to load, its recipes report that the machine is unknown. Fix the first error in the list and the others usually disappear.