Skip to content

08jne01/DCS-Control-Fix

Repository files navigation

DCS-Control-Fix

Introduction

This is a simple python script which lets you quickly rename all the DCS control files whenever you have re-installed windows.

When you reinstall windows the ids your controllers will be given will be DCS and therefore DCS will not recognise your controls. This script lets your rename the old ones to be the same as the new ones allowing you to use them again without having to import them one by one.

Alternative Methods

Setup

Python is required you can get it here: https://www.python.org/downloads/

IMPORTANT during the python install it will have the option Add Python 3.x to PATH make sure you SELECT this option so we can run the python command from the command prompt later.

image

How to use

1. Locating Saved Games

Find your saved games this is usually C:\Users\your pc name\Saved Games

2. Make a Backup

Make a backup of your Saved Games/DCS folder just in case.

3. Install the Script

Put this script in Saved Games/DCS/Config/Input

4. Edit Script Values

Finding old controller IDs/Filenames

Go to Saved Games DCS/Config/Input/[aircraft of your choice]/joystick

There you will see some controls

image

There may be multiple with the same name but different ID so you likely want to choose the ones with the last modified.

Copy the names for your files like so

image

In the python script there is a controllers variable you can edit this to add the old control file names for now leave the new ids blank.

controllers = {
    # OLD_NAME : NEW_NAME
    "Flight Control Rudder {021095E0-5D58-11ed-8007-444553540000}.diff" : "",
    "RIGHT VPC Stick MT-50CM2 {0210BCF0-5D58-11ed-800A-444553540000}.diff" : "",
    "VPC Throttle MT-50CM3 {021047C0-5D58-11ed-8003-444553540000}.diff" : "",
}

You can add as many as you require just make sure there is a comma between lines.

Finding new controller IDs/Filenames

Open DCS and go to the controls for the aircraft we got the old control names from, then make a keybind on each one of your controllers and save.

This will generate the new files like so

image

we then need to repeat the process for the new files but instead putting them next to their corresponding old file.

controllers = {
    # OLD_NAME : NEW_NAME
    "Flight Control Rudder {021095E0-5D58-11ed-8007-444553540000}.diff" : "Flight Control Rudder {A12CEA40-4535-11ea-8001-444553540000}.diff",
    "RIGHT VPC Stick MT-50CM2 {0210BCF0-5D58-11ed-800A-444553540000}.diff" : "RIGHT VPC Stick MT-50CM {5DF754D0-B241-11ea-8003-444553540000}.diff",
    "VPC Throttle MT-50CM3 {021047C0-5D58-11ed-8003-444553540000}.diff" : "VPC Throttle MT-50CM3 {BBCBD090-048B-11e5-8001-444553540000}.diff",
}

Delete New controller Files

We must delete the files just created by DCS because the script will want to rename the old files to the same name so we simply delete

Flight Control Rudder {A12CEA40-4535-11ea-8001-444553540000}.diff.lua
RIGHT VPC Stick MT-50CM {5DF754D0-B241-11ea-8003-444553540000}.diff.lua
VPC Throttle MT-50CM3 {BBCBD090-048B-11e5-8001-444553540000}.diff.lua

in our example.

5. Running Script

First we need to open a command prompt in the correct location. Navigate to your Saved Games/DCS/Config/Input. Then highlight the current directory at the top in your windows explorer like so

image

with it highlighted type cmd and hit enter on your keyboard.

image

This will open a command prompt at the folder you are in.

image

Then to run the script we can first do a dry run with the command:

python fix.py

check the output to see if it matches your expectations.

Then you can do it for real with:

python fix.py --rename

If you wish to undo you can reverse the process:

python fix.py --rename --undo

6. Load into DCS and Check

Load into DCS and check your controls. If something went wrong check there were no errors you can either run the undo command or replace with the backup you created at the start and try again.

You can uninstall python now from your PC if you don't need it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages