You may be familiar with my DCS World TARGET Profile for the Cougar. I would like to make this profile Warthog compatible but with the complexity of the code I don't want to maintain two versions of the profile. I would actually like to make it modular with the primary controller selectable in declarations, and keeping if/else statements to a minimum. Having the profile compatible with both the Warthog and Cougar at the same time would be ideal for people with both controllers, but I need to get over the first hump.

I'm hoping for a straight-up solution to the problem; namely, I want to use the variables FLCS and TQS (I can't use Joystick and Throttle because those are the Warthog names) and have them assigned to either HCougar or Joystick/Throttle with a couple of lines in the file.

Here is the concept, though I get error messages no matter what I try:
Code:
include "target.tmh"

int FLCS;
int TQS;

//program startup
int main()
{
    if(Init(&EventHandle)) return 1; // declare the event handler, return on error
	
	//add initialization code here
FLCS=HCougar;
TQS=HCougar;


			MapAxis(&FLCS, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
			MapAxis(&FLCS, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
			
			MapKey(&FLCS, S2, DX2);
			
			MapAxis(&TQS, THROTTLE, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
			
			MapKey(&TQS, T6, DX24);
}

//event handler
int EventHandle(int type, alias o, int x)
{
    DefaultMapping(&o, x);

}

I have also tried
FLCS=&HCougar;
TQS=&HCougar;
but got an error in target.tmh line 282

Any help would be greatly appreciated.

EDIT: I realize that the throttle nomenclature is completely different, but even making this work for the stick would be great.

Last edited by HomeFries; 03/06/15 05:57 AM.

-Home Fries

"Pacifism is a shifty doctrine under which a man accepts the benefits of the social group without being willing to pay - and claims a halo for his dishonesty."
- Robert A. Heinlein

The average naval aviator, despite the sometimes swaggering exterior, is very much capable of such feelings as love, affection, intimacy, and caring. These feelings just don't involve anyone else.