Coder Social home page Coder Social logo

bastianschwarz / warthog.dcs.f18 Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 0.0 56 KB

T.A.R.G.E.T. profile for the Thrustmaster HOTAS Warthog and DCS World FA-18C Hornet

License: Other

Lua 100.00%
dcs dcs-world hotas warthog warthog-script f-18 hotas-warthog thrustmaster target

warthog.dcs.f18's Introduction

HOTAS Warthog profile for DCS F/A-18C Hornet

T.A.R.G.E.T. profile for the Thrustmaster HOTAS Warthog and DCS World FA-18C Hornet

This profile was inspired by the great F-18 Profile created by NOiD. You should check out this profile if you like having more functions bound to your HOTAS by using modifier buttons.

Goals

  • Reduce cognitive load: Remembering stuff is hard, especially if you don't have time to play a lot and/or regularly and it's not a good thing when you have to remember your key mapping in combat. This problem is aggravated when there are a lot of multi-assignments with modifiers.

    This profile aims to reduce the use of modifiers especially on the stick and throttle. There will be some but they will be mostly on the throttle instrument panel which should only contain non-critical stuff.

  • Minimal configuration: The profile is designed to work with DX buttons so they can be configured within DCS and .lua.diff files can be loaded which makes the configuration really simple.

    Hopefully at some point the profile is completely installed hands-off using a install wizard.

  • Relation to real life: The US Air Force and the US Navy have put a lot of time and thought in designing their HOTAS and "Button Mapping" so I will definiatley try and take adavantage of that.

    The emphasis is on "try" though since the differences in buttons are big enough, e.g. what would be the CMS switch in the F-16 (same layout as the warthog) would be the weapon selection in the F-18. But on the warthog it also has a button press ... so it is perfeclty suited for the sensor switch which now has a depress ... and I thought this would be the easiest point on the list.

  • F-16: I started out years ago in Falcon 4 and spent a lot of time in the (virtual) F-16 cockpit so the control scheme is somhow still pretty much ingrained into my flying. And since the F-16 teaser Eagle Dynamics put in their awsome 2018 video I think it is a good Idea to keep the 2 schemes somewhat related.

  • Flexibility: The plan is to make the profile interchangeable with other modules, either as is or by including different macro definitions so the scheme can stay the same between different planes.

Curent State

Work in Progess

TODOs (order reflects the priority but is not set in stone):

  • Fix Bugs
  • Map Remaining Buttons:
    • DMS (Stick)
    • Pinky (Throttle)
    • Boat (Throttle)
  • Add mapping description (text)
  • Add install instructions with screenshots
  • Add mapping description (image)
  • Issues: Enhancements

Usage

Download the package from the releases, extract to a folder (I put mine in ..\Saved Games\DCS\Layouts\[plane]\) and run it with T.A.R.G.E.T

As soon as the profile runs you can run DCS. Load the stick.lua.diff and throttle.lua.diff (located in the same folder as the script - make sure you have the correct column selected before loading!) and everything should be good from there.

warthog.dcs.f18's People

Contributors

bastianschwarz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

warthog.dcs.f18's Issues

Create launcher

After playing around with the T.A.R.G.E.T. CLI commands (which are extremely limited) I think it's probably better to create some kind of launcher:

  • List all profiles
  • Select profile to load
  • Configure path to DCS
  • Run Profile with \path\to\targetgui -r "path\to\profile"
  • Launch Stable or OpenBeta
  • Maybe aplly .lua.diff files for DCS on the fly?
  • Add "Launch last used" or "Create direct start shortcut" options?

This would also make the installer (#6) much easier since the paths to DCS and T.A.R.G.E.T. don't have to be known on install. The Profile can acutally be treated like an app.

Hook not working properly

Today I had problems extending the hook. Probably it's best to switch from Cycle to UP/DOWN Keybinds

Create installer

It would be really handy to provide an Installer/Updater that extracts the target scripts, creates a shortcut to run TARGET + DCS and installs the DCS button mapping into the SavedGames folder.

This is probably the next step after #4 is finished.

Basics:

  • Ask for DCS Folder(s) and TARGET folder in order to create the shortcut
  • Ask for SavedGame folder in order to install lua.diff keybindings
  • Select the installations that should be used (Stable + OpenBeta)

Nice to have:

  • Backup/Restore of existing profiles
  • Activate/Deactivate binds on Startup (based on Backup/Restore)
  • Compile features by choosing the header files
  • DCS Version/Compatiblity detection

Also: Defining an installer that quickyl grows in complexity is totally not feature creep ...

Reflect throttle state in LED brightnes

The LED brightness could be used to display the throttle state, either continously or just off/idle/normal/ab

This would be completely useless but a nice gimmick (and a nice excercise) anyway.

Remove modifiers since they block input

Using modifiers like SHIFT and CTRL blocks other inputs in DCS. This is not really suprising but something I didn't think of since the modifiers in DCS are only used for momentary button presses; you never hold a button press with a modifier AND try to press another button. But on the HOTAS this can happen

I mostly run into this problem on high angle bombing runs: I extend the speedbrake in the dive and retract it in the climb. Since I just throw the speedbraek switch in the hold position, this blocks all input because LCTRL is pressed.

A new Idea to play around with is to just increase the DX buttons and bind the buttons ingame. Since the profile won't work without custom key bindings anyway it doesn't matter if I load the profile for 1 or 100 buttons.

First code test:

// default defined in target.tmh
 stGameCfg morebuttons = { 100, 1,  1,  1,  1,  1,  1,  1,    1,   1,   0,   0,   0}; //first number is the number of buttons, copied from default and modified

//called in main
  if(Init(&EventHandle, 0)) return 1; // Call init with 2nd bitmask to prevent virtual devices form being created
	PlugGame(&morebuttons, "Mine");						// create my own virtual device with my custom definition
  excludeDevices();

Default Mapping from TARGET:

// called in Init()
MapList(&Joystick, &JoystickMap);

// defined at the bottom of target.tmh
int JoystickMap[]={TG1,DX1, S2,DX2, S3,DX3, S4,DX4, S1,DX5, TG2,DX6, H2U,DX7, H2R,DX8, H2D,DX9, H2L,DX10, H3U,DX11, H3R,DX12, H3D,DX13, H3L,DX14,
				   H4U,DX15, H4R,DX16, H4D,DX17, H4L,DX18, H4P,DX19, H1U,DXHATUP, H1R,DXHATRIGHT, H1D,DXHATDOWN, H1L,DXHATLEFT};

Use something similar to create DX buttons?

int i; while(i<256) { USB[i] = i+1000; i = i+1; }					// fill the USB table

TODOs

  • Create header file for DX buttons names, HOTAS to DX mapping and device creation
  • Change USB keys to DX keys
  • Map buttons in DCS
  • Export DCS mapping
  • Update readme

Create shortcut to run profile and DCS

Since it's an extra step to run T.A.R.G.E.T. and the profile and then DCS a shortcut would be a good Idea.

Problem will be to find a way to make the DCS path customizable.

Last resort would be a wrapper in another language that holds the path information and builds the CLI command to run target and DCS.

Rework LED states

The LED states are currently initialized to simply "all off" at script start.

This should be reworked to actually read the current button/throttle states and set the LEDs accordingly.

One possible way could be to have a initialzeLED function that gets the button and the desired state and keeps them in a map and setting the LEDs once everything is setup.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.