On this page we will discuss how to override The Force Engine (TFE) mod configurations. We will discuss using a custom mod configuration file that looks like this. At the moment, there are two types of overrides. One type is processed only by TFE and another is processed by both Dark Forces Remaster and TFE. We will first talk about the TFE-only overrides.
What is a Mod Configuration File?
You can change many different aspects of your mod by placing a configuration file called MOD_CONF.txt inside your mod's GOB archive (using a tool like Conman ). When present, this file will make TFE act differently than it would in a regular game. You could change the amount of lives you have on start, and what weapons are available. You can even start the mission wearing a Gas Mask! Note: The Dark Forces Remaster only loads MOD_CONF from the GOB!
Now that you know where to place the configuration file, lets look inside it!
How do I create or edit a MOD_CONF.txt file and what is JSON?
Simply open your favorite text editor (like Notepad) and create a new file. Then you will be able to edit the text as necessary. The file itself is in the format of a JSON like the level metadata.txt. You can read about the format here --> JSON Tutorial . Basically, you surround each section with brackets { and } putting configuration data inside each section. Any word must to be surrounded with quotation marks. Each configuration is in the format of KEY : VALUE
And example could be "hello" : "world" or "dark" : "forces". In this case, the name of the key is hello or dark and the value is world or forces. Then you surround everything with brackets.
{"hello" : "world"}
That's what a valid configuration looks like above. You can also place one configuration inside another.
{"hello" : {"dark": "forces"}}
So in the case above the key hello is equal to another key-value pair called {"dark" :"forces"}. You can put as many as you want inside each other.
If you have multiple values just add commas between them.
{"name" : "Kyle", "lastname" : "Katarn", "Age" : 25, ...... etc... }
IMPORTANT!!! It is very easy to make a typo in your JSON file. Go to this website, paste your MOD_CONF.txt contents and verify that there are no errors --> https://jsonlint.com/
Remember after you create your MOD_CONF.txt to add it your GOB archive.
What is the structure of a MOD_CONF.txt file?
Below is a an example of a level configuration.
At the top the first key is TFE_VERSION . This is a validation checks that tells the The Force Engine two things. The first is what format the MOD_CONF file is in. We may add new categories and structures to the JSON as times goes along. Additionally, the version may tell TFE what features MOD_CONF expects to be supported. As we add more features the MOD_CONF the version will increase. At the moment, the version is 1 and supports all features. If this value is missing the validation is skipped and, if there are any issues, the loading of the override is skipped.
The second key is TFE_OVERRIDES. This tells the game that everything inside is used as configuration for TFE.
{ "TFE_VERSION" : 1, "TFE_OVERRIDES": { "levelOverrides": { "SECBASE.LEV": { "pistol": false, "rifle": true, "power": 300, "detonator": 5, "shields": 150 }, "TALAY.LEV": { "bryarOnly" : true, "lives": 1 } } } }
Inside the overrides section is the levelOverrides section. This tells the game that there will be configuration for each level name that you define.
Inside the levelOverrides section is a comma-separated listing of levels you want to override. For example if you want to change the behavior of SECBASE you would add SECBASE.LEV configuration and if you want to configure TALAY then you would write down TALAY.LEV. You can add as many as you want depending on how many maps you have in your GOB.
Structure of a Level Override Section
Lets look at the detail of level override section. You will see that it is a listing of key-value pairs. Some of them are set to true or false and some have numerical values.
SECBASE.LEV
Lets look at the section for SECBASE.LEV
"SECBASE.LEV": { "pistol": false, "rifle": true, "power": 300, "detonator": 5, "shields": 150 }
What each key does is change the behavior of the level in the game. Lets look at the part that says
"pistol": false,
In this case, the key is pistol and the value is false. This means that it will remove the pistol from the mission's inventory. Lets continue...
"rifle": true,
In this case, the key is rifle and the value is true. This means that the game will add the rifle to your inventory.
"power": 300,
In this case, the key is power and the value is 300. This means that the game will set the repeater ammo power to 300 units. Notice that there are no quotes around 300 - that's because we don't need to do that when dealing with numbers.
"detonator": 5,
In this case, the key is detonator and the value is 5. This means that the game will set the thermal detonator to 5.
"shields": 150
In this case, the key is shields and the value is 150. This means that the game will set the shields to 150. Note that there is no comma after 150 .
Remember, all of these changes only apply to the SECBASE.LEV mission!
TALAY.LEV
Now lets look at the next section for TALAY.LEV.
"TALAY.LEV": { "bryarOnly" : true, "lives": 1 }
Here, we have two key - value pairs.
"bryarOnly" : true,
In this case, the key is bryarOnly and the value is true. This means that the game will remove your entire inventory and give you only a bryar pistol!
"lives": 1
In this case, the key is lives and the value is 1 This means that the game will give you only 1 life!
THE Override Configuration Details
Now that you know how everything works lets go over each key and what it does!
Weapons and Inventory
When you set the value to true item will be added. When set to false the item will be removed from the player's inventory. So if your key is "pistol" then the two values you can set are either true or false.
pistol - Add or Remove the Bryar Pistol from the inventory rifle - Add or Remove the E-11 Imperial Rifle from the inventory autogun - Add or Remove the Repeater Gun from the inventory mortar - Add or Remove the Packard Mortar from the inventory fusion - Add or Remove the Fusion Cutter from the inventory concussion - Add or Remove the Concussion Rifle from the inventory cannon - Add or Remove the Dark Trooper Cannon from the inventory mask - Add or Remove the Gas Mask from the inventory goggles - Add or Remove the Night Vision Goggles from the inventory cleats - Add or Remove the Ice Cleats from the inventory
Ammunition and Health
These typically set your a numeric value for your ammunition and health. Just give the value nice whole numbers between 0 and the Max.
energy - Set the Energy (For E-11) ammunition to a specific value. Max is 999 power - Set the Power (For the Repeater) ammunition to a specific value. Max is 999 plasma - Set the Power (For the DT Cannon) ammunition to a specific value. Max is 999 detonator - Set the Thermal Detonator count. Max is 999. shell - Set the Mortar Shells (for the Packard Mortar Cannon) to a specific value. Max is 999. mine - Set the Imperial Mine count. Max is 999. missile - Set the DT Weapon missiles to a specific value. Max is 99. shields - Set your shields to a specific value. Max is 999. health - Set your health to a specific value. Max is 999. lives - Set your lives to a specific value. Max is 9. battery - Set your battery to a specific value. This is a percentage between 0 and 100.
Custom Numerical Overrides
defaultWeapon - Set your starting equipped weapon. 1 is fists, 2 is Bryar ... 0 is the DT Cannon. Values between 0 and 9. fogLevel - Set the fog attenuation (Gromas Mines defaults to 30). Values between 0 and 100.
Custom Overrides
We have some custom overrides for your mod.
enableMask - Start the mission with your Gas Mask on enableCleats - Start the mission with your Ice Cleats on. enableNightVision - Start the mission with your Night Vision enabled. enableHeadlamp - Start the mission with your Head Lamp on. bryarOnly - Start your mission with no inventory except a Bryar pistol and 100 ammo just like the first misison.
Dark Forces Remaster HD Overrides
Note: This is strictly optional and really should only be used to fix incorrect textures shown in the remaster!
There is another optional type of override that can be added to MOD_CONF.txt file. These overrides change the quality of assets that are loaded into the game. The game will either load the High Definition (HD) or original low quality assets. This is required because, by default, the assets in the Dark Forces Remaster skip texture paletting and only show the HD version of the texture even if it doesn't fit the modded level. Most of the time you will never have to deal with this but some custom maps that use the GROMAS, JABSHIP, SEWERS or TALAY palettes will look strange in the remaster.
For now, lets go over the structure of the HD overrides. Just like before, you add the JSON overrides to MOD_CONF.txt like before. The idea is that you can specify whether to show HD or non HD versions of the PDA menu and the Mission Briefings. Additionally, you can specify per level, which textures you can override to show the non-HD versions instead of the HD versions. The asset types you can override are BMs (Textures), FMEs (Frames - Ex: Ammo Pick up) , WAX (Sprites like enemy stormtroopers) .
For each asset type you would list the asset that should show the original version instead of the HD version. So if you want to show the original low-quality version of GPDIRTRD.BM you would add it to the list of BMs.
{ "HD_PDA": false, "HD_BRIEF": false, "SECBASE.LEV" : { "BM": [ "GPDIRTRD.BM", "SPSEWGE3.BM", "GPMINE1X.BM" ], "FME": [ "GFPIPES1.FME" ], "WAX": [ "KELL.WAX" ] } }
Here is the low quality version of the GPDIRTRD.BM. If this override is added to MOD_CONF.txt then Dark Forces Remaster and TFE will show the original low quality version.
If you remove the texture from the list it will show the default high-res version like the one below.
The same concept works for FME and WAX assets. Just add them to the list of assets.
HD override details
Here are the true or false overrides for high resolution PDA or briefing. Both the Dark Forces Remaster and TFE will process these settings.
HD_PDA - Display the original or the high resolution version of the PDA. This is useful for custom imperial codes (true or false) HD_BRIEF - Display the original or the high resolution version of the Mission Briefing (true or false).
Then we have a list of levels that should be overrides. Just like before you would write the name of the mission like SECBASE.LEV or TALAY.LEV and then list the types of assets that should show the low quality versions. The asset lists can be BMs FMEs or WAXs and are comma separated surrounded by brackets.
<level_name>.LEV - Name of Level to override HD assets. Can be SECBASE.LEV, TALAY.LEV etc... <asset_type> - Must be either BM, WAX or FME.
An example is below for mission SECBASE.LEV
"SECBASE.LEV" : { "BM": [ "GPDIRTRD.BM", "SPSEWGE3.BM", "GPMINE1X.BM" ], "FME": [ "GFPIPES1.FME" ], "WAX": [ "KELL.WAX" ]
When you add this override, it will show the low-quality version of textures GPDIRTRD.BM, SPSEWGE3.BM and GPMINE1X.BM from the BM list. It will also display the low-quality version of GFPIPEIS1.FME frame in the FME list. Finally, the Kell Dragon will be of low quality due to KELL.WAX being added to the WAX list.
Putting it altogether your MOD_CONF may look like this. Don't forget to ALWAYS check that you do not have any typos and validate with this website -->https://jsonlint.com/
{ "TFE_VERSION" : 1, "TFE_OVERRIDES": { "levelOverrides": { "SECBASE.LEV": { "pistol": false, "rifle": true, "power": 300, "detonator": 5, "shields": 150 }, "TALAY.LEV": { "bryarOnly" : true, "lives": 1 } } }, "HD_PDA": false, "HD_BRIEF": false, "SECBASE.LEV" : { "BM": [ "GPDIRTRD.BM", "SPSEWGE3.BM", "GPMINE1X.BM" ], "FME": [ "GFPIPES1.FME" ], "WAX": [ "KELL.WAX" ] } }
Remember, if you are stuck or confused somewhere ask in the DF-21 Discord .