Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#4088368 - 03/06/15 05:51 AM Advanced question: How to make a profile modular for either Cougar or Warthog  
Joined: Jan 2001
Posts: 2,477
HomeFries Offline
Air Dominance Project
HomeFries  Offline
Air Dominance Project
Member

Joined: Jan 2001
Posts: 2,477
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.

Inline advert (2nd and 3rd post)

#4092604 - 03/16/15 04:08 AM Re: Advanced question: How to make a profile modular for either Cougar or Warthog [Re: HomeFries]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
As you said the button nomenclature is different. You can have both throttles working at the same time, maybe you will need only a little axis configuration. Send me an PM and I will try to help you, I am working on a script for IL-2 4.12.2 and HSFX right now.

#4092859 - 03/16/15 06:28 PM Re: Advanced question: How to make a profile modular for either Cougar or Warthog [Re: HomeFries]  
Joined: Jan 2001
Posts: 2,477
HomeFries Offline
Air Dominance Project
HomeFries  Offline
Air Dominance Project
Member

Joined: Jan 2001
Posts: 2,477
Thanks, Aullido. PM sent.

FYI, what I would like to do is monumentally more complicated than a couple of axes (which could be done with if/else staements). I used the axis commands as an example to keep things simple and on point.

Last edited by HomeFries; 03/16/15 06:30 PM.

-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.


Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Carnival Cruise Ship Fire....... Again
by F4UDash4. 03/26/24 05:58 PM
Baltimore Bridge Collapse
by F4UDash4. 03/26/24 05:51 PM
The Oldest WWII Veterans
by F4UDash4. 03/24/24 09:21 PM
They got fired after this.
by Wigean. 03/20/24 08:19 PM
Grown ups joke time
by NoFlyBoy. 03/18/24 10:34 PM
Anyone Heard from Nimits?
by F4UDash4. 03/18/24 10:01 PM
RIP Gemini/Apollo astronaut Tom Stafford
by semmern. 03/18/24 02:14 PM
10 years after 3/8/2014
by NoFlyBoy. 03/17/24 10:25 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0