Forums » Technology » Flight Sim Controllers » T.A.R.G.E.T. (Thrustmaster) » Help Needed Programing Brakes in SF2 Active Topics You are not logged in. [Log In] [Register User]
Topic Options
Rate This Topic
Hop to:
#3584923 - 06/02/12 02:45 PM Help Needed Programing Brakes in SF2
Nimits Offline
Senior Member

Registered: 04/23/02
Posts: 4222
Loc: Texas, United States of Americ...
I'll be the first to admit a lack of familirity with the programming langue in TARGET. That said, been trying for a while to figure out a function to replicate braking in SF2. SF2 simply has a "b" for brakes on/off. I've been attempting to set it up so that whichever rudder pedal I push (simped pedals here) will generate the "b" keystrokes WHILE locking out the other pedal until the first pedal returns to 0.

Straight "List" functions, of course, will generate "b" whenevr either pedal is pressed, while the best I can with the logical flag is one pedal brakes on and the second off. Any assistance would be appreciate.


Edited by Nimits (06/02/12 02:49 PM)


Top
#3587443 - 06/06/12 06:28 PM Re: Help Needed Programing Brakes in SF2 [Re: Nimits]
Aullido Offline
Member

Registered: 03/08/07
Posts: 293
You can't program rudders other than those attached to the Cougar. If the Simped can connect, I will try to help you as soon I go home.

Top

#3589476 - 06/10/12 12:59 PM Re: Help Needed Programing Brakes in SF2 [Re: Nimits]
Nimits Offline
Senior Member

Registered: 04/23/02
Posts: 4222
Loc: Texas, United States of Americ...
They are connected and merged through my old Cougar. That is not the issue. Just a programming question.

Top
#3589683 - 06/10/12 10:29 PM Re: Help Needed Programing Brakes in SF2 [Re: Nimits]
Aullido Offline
Member

Registered: 03/08/07
Posts: 293
Well. Last Friday I tried to find a solution. The key to your problem is to get the axis value and there are two promising places where you can obtain it but they didn't work. TARGET is really weird since variables are not truly global, sometimes you can use them on the main function and others you must use the event section. I am still working in the problem because it can be quite useful to read axis directly.

Top
#3647333 - 09/20/12 12:08 AM Re: Help Needed Programing Brakes in SF2 [Re: Nimits]
Aullido Offline
Member

Registered: 03/08/07
Posts: 293
Are you using RDR_X and RDR_Y for the pedals?

Code:

// This code is made on the fly. It is not tested and I suspect you will need to limit it to only sent a 'b'. Sorry time to sleep. Latter I could improved it if you run in trouble.

float AxisRDRX;
float AxisRDRY;

 int EventHandle(int type, alias o, int x)
  {
   
   if ((&o == &HCougar) & ((x == RDR_X) | (x == RDR_Y))) // Isolate the event. 
    {
     AxisRDRX = HCougar[RDR_X]; // Get the axis value;
     AxisRDRY = HCougar[RDR_Y]; // Get the axis value;
       
     if (AxisRDRX < XXXX) // You must test which axis value corresponds here). 
                          // The idea is detect that the axis is not pushed. I assume the axis goes from 0 to a positive value.
      {
       if (AxisRDRY > XXXX) // If the other pedal is pushed.
        {
         ActKey(PULSE+KEYON+'b');
        }
      }

     if (AxisRDRY < XXXX) // The same but interchanging axis. 
      {
       if (AxisRDRX > XXXX) // If the other pedal is pushed.
        {
         ActKey(PULSE+KEYON+'b');
        }
      }

   DefaultMapping(&o, x);
  }

Top
Topic Options
Rate This Topic
Hop to:

Moderator:  531 Ghost, RacerGT 
 

Forum Use Agreement | Privacy Statement
Copyright 1997-2013, SimHQ Inc. All Rights Reserved.