__PATH__config__ for config.ini
Posted: Tue Aug 25, 2026 12:33 pm
If this is already implemented, please tell me what the option is called since I didn't find any information on something like this. Thanks!
TL:DR:
Add something similar to __PATH__executable__, but instead of linking to the directory where the game executable is linked, link to the folder the config.ini file is in.
What:
A variable for use in config.ini, which links to the directory the config.ini is currently in.
This could be called __PATH__config__, for example.
Example:
(This is on Linux; Mac OS and Windows should work similar)
Config file is in ~/Documents/factorio/modpack-01/
In Config file: write-data=__PATH__config__/data/
When I now launch the game with this config specified with -c CONFIG_FILE, it should then output the data to ~/Documents/factorio/modpack-01/data/
Why:
This allows for relative paths in config.ini.
I'm planning to write a modpack manager (haven't started jet due to lack of spare time), which is planned to also include a modpack export/import function. The issue is that with absolute paths, I would need to write something what manually changes the path specified in write-data because the installation folder of the modpack manager may be different on two systems. This would make it way easier, because the paths are already relative to the config, so that I only need to specify the config without changing it.
Which versions would be nice to have this function:
2.0 and 2.1 (some mods still are on 2.0, so this would be nice to have, if you make it 2.1 only, that's also fine though)
Thanks for considering!
EDIT: Typos
TL:DR:
Add something similar to __PATH__executable__, but instead of linking to the directory where the game executable is linked, link to the folder the config.ini file is in.
What:
A variable for use in config.ini, which links to the directory the config.ini is currently in.
This could be called __PATH__config__, for example.
Example:
(This is on Linux; Mac OS and Windows should work similar)
Config file is in ~/Documents/factorio/modpack-01/
In Config file: write-data=__PATH__config__/data/
When I now launch the game with this config specified with -c CONFIG_FILE, it should then output the data to ~/Documents/factorio/modpack-01/data/
Why:
This allows for relative paths in config.ini.
I'm planning to write a modpack manager (haven't started jet due to lack of spare time), which is planned to also include a modpack export/import function. The issue is that with absolute paths, I would need to write something what manually changes the path specified in write-data because the installation folder of the modpack manager may be different on two systems. This would make it way easier, because the paths are already relative to the config, so that I only need to specify the config without changing it.
Which versions would be nice to have this function:
2.0 and 2.1 (some mods still are on 2.0, so this would be nice to have, if you make it 2.1 only, that's also fine though)
Thanks for considering!
EDIT: Typos