View Full Version : Question about Pseudo toe brakes IL-2 script
GunRunner
30th September 2008, 02:36 PM
Hi
I have a question about the about Pseudo toe brakes for IL-2 script. See this link, http://www.ch-hangar.com/forum/showthread.php?t=3821
I have carried out the instructions as per the link, and at the end I go into the controls section of the game under Hotas and press the toe brakes. If I press the left hand to brake, the braking is assigned to the left hand toe brake and if I press the right hand one, it is assigned to the right hand one. The write up says:
What this script does is set a CMS axis to be applied in the game to apply the brakes whichever of the toe brakes is depressed . This does not happen to mine, it applies it to the left OR the right. What am I doing wrong?
Kind regards
Windturbin
2nd October 2008, 04:06 PM
GunRunner,
I think in Il2 there is no left or right brake, there are just brakes. When in IL2 I always push down on both toes to apply brakes. Which one (left or right) is actually the one that is active does not matter.
I could be wrong about this, maybe someone else could confirm?
GunRunner
3rd October 2008, 11:21 AM
GunRunner,
I think in Il2 there is no left or right brake, there are just brakes. When in IL2 I always push down on both toes to apply brakes. Which one (left or right) is actually the one that is active does not matter.
I could be wrong about this, maybe someone else could confirm?
Thanks for the reply. I knew this, it was just that I read it from the thread that the script got round the problem. I have been on-line and playing IL2 for more than 4 years and up until now, I pressed a button on my joystick and applied left or right rudder and this applied the brakes to the appopriate side and it enabled me to turn. Using this script I am doing the same as I did before but instead of using a button on the throttle, I am pressing the toe brake on the side that I have set it in the Hotas in the game. In my case it is set on the right side. So for example, if I want to taxi left, I push the left rudder pedal, and at the same time I press the right toe brake.
I have read this correctly haven't I?
"What this script does is set a CMS axis to be applied in the game to apply the brakes whichever of the toe brakes is depressed so if you want to taxi left you can push the left pedal forward to apply left rudder as normal and apply the brake by pushing the left toe brake or vice versa which gives the feeling of having differential braking. It doesn't actually give you differential toe braking but it does feel far more intuitive with this script".
Perhaps I have not!
Perhaps the "whichever" and the "or vice versa ", does not mean apply the right brake by pressing the right toe brake.
Perhaps Revin or Bob Church would like to comment please, because all I have effectively done is use the toe brake on the CH pedals (right side in my case) to brake instead of a button on the throttle.
I look forward to comments, as I would dearly love to press the left or right toe brake for the appropriate side's braking.
Thanks again.
Bob Church
3rd October 2008, 02:03 PM
Hi GunRunner,
I think Revvin just meant that whichever brake you pushed, that would activate the brakes. That script doesn't look at all like you need to do to set up pseudo differential braking except that you could push on the brake and move the rudder at the same time, the rudder would simulate some differential.
You can do it a bit more elaborately. First you need to take the average value of the two brake pedals and send that to the brake axis. That way the total braking depends on how far the brakes are pressed in combination, not just which one is pressed.
The second part is to combine the two brakes to generate a differential signal. The left brake needs to pull the value down, the right brake needs to push it up. That value then gets combined with the actual rudder (or you can use it to replace the normal rudder signal if the rudder is centered and only the toe brakes are moved). That signal wires a little actual rudder movement into the overall picture so that if you press one brake more than the other, the rudder gets off-center a bit and it feels like differential braking even though what you're really doing is generating a single brake signal and some rudder to turn one way or the other.
I think Michael posted a sample of a script that did that a few years back, it's not too hard to set up. You might try looking back through the archives. If you can't find it, figure out which way you'd rather do it and I can show you how to set it up. It will probably take some tweaking to get it to feel right but it can be done.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
GunRunner
3rd October 2008, 03:52 PM
Hi Bob
Thanks for the response. I am now totally confused. I got the impression from the script that I refer to (posted by Revin), that if:
a. I pushed on the left rudder and pushed down on the left toe brake, that you would brake on the left hand side and move to the left.
b. I pushed on the right right rudder and pushed down on the right toe brake you would brake on the right hand side and move to the right.
Have I got it all wrong? As for me programming, you might as well try to teach rabbits to fly. There is no chance at my age. I can follow the instructions explicitly, but I am not creative anymore.
Bob Church
3rd October 2008, 08:00 PM
Hi GunRunner,
>> a. I pushed on the left rudder and pushed down on the left toe brake, that you would brake on the left hand side and move to the left. <<
Well, no. Not exactly. It has to brake on both sides since the sim only supports a single brake input. If you push down on the brake and push the pedal forward, it should slow down and turn, but it's not really shifting the braking from one side to the other. The braking force is being read from the brake that you would be pushing on as you pushed the rudder pedal forward on that side, but the force would still be applied to both wheels. Any turning action that you achieved would be due to the rudder itself. If you push the left brake down and the left rudder forward, it does act something like differential brakes but really all you're doing is putting on the brakes to slow down and kicking in some rudder to turn the aircraft, really two separate actions.
What you described in your first post sounded like it was doing exactly as it should. Maybe I'm missing something, is that not what's happening?
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
GunRunner
3rd October 2008, 11:03 PM
Hi GunRunner,
What you described in your first post sounded like it was doing exactly as it should. Maybe I'm missing something, is that not what's happening?
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Yes yes yes! That is what is happening! I understood it differently....IMHO it is the way the sticky in the examples forum is written.
See here...."What this script does is set a CMS axis to be applied in the game to apply the brakes whichever of the toe brakes is depressed so if you want to taxi left you can push the left pedal forward to apply left rudder as normal and apply the brake by pushing the left toe brake or vice versa which gives the feeling of having differential braking. It doesn't actually give you differential toe braking but it does feel far more intuitive with this script".
It is the vice versa statement above that can be read in such a way that you press the right toe brake and right rudder and you taxi to the right. When in fact you would in the above example press the left toe brake and apply right rudder to turn to the right.
Kind regards
Revvin
3rd October 2008, 11:05 PM
As I said in the description you can apply left rudder to taxi and press the left toe brake to apply wheel braking, if you did the same for turning right it would give the feeling of having differential brake rather than IL-2's standard approach which meant you could only map the brake axis to one pedal so you could face the prospect of wanting to taxi right so you would push the right pedal but (without the aid of the script) perhaps have the brake axis mapped to the left toe brake so you would be pushing the pedals right but depressing the left toe brake which just feels odd - ever stranger if when landing you're trying to make corrections using the rudder and want to brake. As I said its not a perfect solution but unfortunately thats down to the limitations of IL-2, the script does go some way to making things feel a little better.
GunRunner
3rd October 2008, 11:14 PM
Revvin
:D We posted at the same time. Can you please clarify if this is correct........
It is the vice versa statement above that can be read in such a way that you press the right toe brake and right rudder and you taxi to the right. When in fact you would in the above example and the way the script reads and runs press the left toe brake and apply right rudder to turn to the right.
Revvin
3rd October 2008, 11:19 PM
You can press either pedal and get the same result - the brake applied while you are pushing the rudder axis left or right.
GunRunner
4th October 2008, 01:09 AM
You can press either pedal and get the same result - the brake applied while you are pushing the rudder axis left or right.
Aggghhh...I am sorry to labour about this, but I am trying to get to the bottom of all this! As the script is written and the instructions given it doesnt! When you go into the HOTAS and select the brakes, you can only assign one toe brake pedal. It has to be left or right. As you know it can only be one.
So you move the rudder to the left or to the right when taxiing, but to apply the brake to that left or right RUDDER input to turn the plane, you have to use the only one allowed toe brake pedal (left or right NOT both) selected (programmed) in the game HOTAS!
Bob Church
4th October 2008, 01:54 AM
Hi GunRunner,
Not really, because the value the sim is seeing for brakes is coming from the CMS.A1 axis and the script is feeding CMS.A1 the value from whichever toe brake is pressed the furthest. If the left brake is further down than the right one, then the left brake has control. If the right to brake is further down it has control. In either case, the braking itself is straight-line. It won't turn the aircraft. You have to move the rudder to do that, but if you do push forward on the right pedal (for example) and at the same time you push down on the right toe-brake, it acts like differential braking to a degree.
If true differential braking were there, you wouldn't need to move the rudder, it would be enough to just press one toe brake more or less than the other. The sim has to provide that capability first. You get two axes like you do in Flight Simulator and a few others, you don't normally need any scripting. You've left and right toe brake inputs provided by the sim, you just have to direct those to the individual toe brakes on the pedals. The script will switch back and forth between the left and right pedal if their relationship changes, e.g. if you've got the right toe brake down 25% and the left toe brake down 50%, the left will be in control. If you then press the right brake down to 75%, it will start controlling the brakes when it crosses the 50% point where the left brake is.
The script is only trying to provide an emulation of true differential braking, making the assumption that you'll push the right rudder pedal forward and the right brake down when you want to turn right, and, errr.... vice-versa. :)
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Revvin
4th October 2008, 10:05 AM
The script is only trying to provide an emulation of true differential braking, making the assumption that you'll push the right rudder pedal forward and the right brake down when you want to turn right, and, errr.... vice-versa. :)
Thank you Bob, thats the script in a nutshell. Despite IL-2's shortcomings of not having true toe braking capability and only allowing one brake axis the script does its best to give the user a feeling of having differential braking as far as the limitations of the sim goes hence the description of the script being titled 'Pseudo'.
Gunrunner, are you using this script as part of an existing script i.e one of my pre-made profiles or are you trying to add this script into one of your own. If its the latter then remember to add the axis in the CMS Controls tab as directed in the explanation. I can also see another potential issue so I provided an extra sentence directing you to disable the default X and Y axis on the toe brake as the sim youuld see X,Y and R axis (or in IL-2's case Z rotation axis).
GunRunner
4th October 2008, 01:54 PM
Gunrunner, are you using this script as part of an existing script i.e one of my pre-made profiles or are you trying to add this script into one of your own. If its the latter then remember to add the axis in the CMS Controls tab as directed in the explanation. I can also see another potential issue so I provided an extra sentence directing you to disable the default X and Y axis on the toe brake as the sim youuld see X,Y and R axis (or in IL-2's case Z rotation axis).
I have added it as you have described and also carried out the instructions as you instructed in the very first instance and added it to my script (created by my friend Weasel). It still only works as I described.
See here:
// Game Title: FB 1946
// Written By: Greg Hunt
// Date: 08/02/07
//
script
IF (FIRSTSCAN) THEN
A62=204;
a43=2; //sets guns to cannon/mg
a44=0;
a50=0; //resets rudder trim
a36=0; //no movement
a34=128; //set max flap
a35=0; //set flaps up
cms.a6=0; //set flaps up
ENDIF
//--------------------------------------------------------
// ***********FLAPS AXIS EMULATION*************
sequence // .........flaps down.........
Wait (js2.b10);
a36=1;
a35=a35+20;
if ([a35>a34]) then
a35=a34;
endif
endsequence
sequence
if ([a36==1]) then
CMS.A6 = CMS.A6 + 2; // movement
if ([cms.a6>A35]) then
cms.a6=A35;
a36=0; // stop loop
endif
endif
DELAY(1); // set speed by changing (1). higher numbers will make the movement slower.
ENDSEQUENCE
sequence // ............flaps up.................
Wait (js2.b12);
a36=2;
a35=a35-20;
if ([a35<0]) then
a35=0;
endif
endsequence
sequence
if ([a36==2]) then
CMS.A6 = CMS.A6 - 2; // movement
if ([cms.a6<A35]) then
cms.a6=A35;
a36=0; // stop loop
endif
endif
DELAY(1); //set speed by changing (1). higher numbers will make the movement slower.
ENDSEQUENCE
cms.a3=js1.a3+a50; // ********** rudder trim set *********
SEQUENCE
wait (cms.b67);
a50=a50+3;
endsequence
SEQUENCE
wait (Js2.b31);
a50=a50-3;
endsequence
SEQUENCE
wait (cms.b68);
a50=0; //reset
endsequence
sequence // ************gun fire*************
if (cms.b65) then
a43=2;
endif
if (cms.b66) then
a43=1;
endif
endsequence
if (js1.b5) then
a43=3;
endif
sequence
while ( JS1.b1 );
if ([a43==1]) then
cms.b23 = true;
endif
if ([a43==2]) then
cms.b25 = true;
endif
if ([a43==3]) then
cms.b24 = true;
endif
endsequence
sequence
IF( NOT JS1.B1 ) THEN // If Button 1 is released then
CMS.b25=false;
endif
IF( NOT JS1.B1 ) THEN
CMS.b23=false;
CMS.b24=false;
ENDIF
endsequence
// A/C TRIM AND AXIS SET
SEQUENCE
IF (JS1.B9) THEN
A88=3;
ENDIF
IF (JS1.B10) THEN
A88=5;
ENDIF
IF (JS1.B11) THEN
A88=7;
ENDIF
IF (JS1.B12) THEN
A88=9;
ENDIF
ENDSEQUENCE
SEQUENCE
IF ([A88==3]) THEN
a62=220; // hat button 9
ENDIF
IF ([A88==5]) THEN
a62=210; // hat button 10
ENDIF
IF ([A88==7]) THEN
a62=205w; // hat button 11
ENDIF
IF ([A88==9]) THEN
a62=195; // hat button 12
ENDIF
ENDSEQUENCE
SEQUENCE
CMS.A2 = JS1.A2;
IF ([CMS.A2>A62]) THEN
CMS.A2 = A62;
ENDIF
ENDSEQUENCE
SEQUENCE
wait (cms.b32);
a44=a44+1;
if([a44>1]) then;
a44=0;
endif
endsequence
// AUTO WEP
// First, set it up so B1 is TRUE when we're above center.
SELECT( JS2.A3, POSITION ) OF
CASE 0:
B1 = TRUE;
EXITCASE:
B1 = FALSE;
BREAK;
CASE 20:
B1 = TRUE;
EXITCASE:
B1 = FALSE;
BREAK;
ENDSELECT
// Now run a sequence based on B1 (We're not in the // select block now so anything goes);
SEQUENCE
WAIT( B1 ); // Wait for b1
if ([a44==0]) then
CMS.B1 = TRUE; // Turn on CMS.B1
endif
DELAY( 5 ); // Leave it on for about a second
if ([a44==0]) then
CMS.B1 = FALSE; // Turn it off
endif
ENDSEQUENCE
// DROP TANK
SEQUENCE
WAIT( js1.b1 );
CMS.b5=true;
delay (5);
CMS.b5=false;
ENDSEQUENCE
SEQUENCE
WAIT( js1.b4 );
CMS.b5=true;
delay (5);
CMS.b5=false;
ENDSEQUENCE
timer(PERIOD, D1, 20) =js2.b4; // WEP ON OFF tap
cms.b31 = d1 and not js2.b4;
cms.b32 = not d1 and js2.b4; // WEP ENABLE/DISABLE holddown
timer(PERIOD, D3, 10) =js1.b7; // cannons tap
cms.b65 = d3 and not js1.b7;
cms.b66 = not d3 and js1.b7; // cannon & MGs holddown
timer(PERIOD, D4, 20) =js2.b27; // rudder trim left tap
cms.b67 = d4 and not js2.b27;
cms.b68 = not d4 and js2.b27; // rudder trim right holddown
SEQUENCE // ********* MANUAL GEAR RAISE **********
WHILE (JS1.B14);
CMS.B19 = TRUE;
DELAY(1);
CMS.B19 = FALSE;
DELAY(1);
ENDSEQUENCE
SEQUENCE // ********* MANUAL GEAR LOWER **********
WHILE (JS1.B16);
CMS.B20 = TRUE;
DELAY(1);
CMS.B20 = FALSE;
DELAY(1);
ENDSEQUENCE
//Toe Brakes sequence from CH Hangar
IF ([JS3.A1 > JS3.A2]) then
CMS.A1 = JS3.A1;
ELSE
CMS.A1 = JS3.A2;
ENDIF
endScript
Revvin
5th October 2008, 12:50 PM
The toe brake script gives you the ability to use either the left or right toe brake as the method of controlling the single brake axis in IL-2, it does work, I've been using it myself for years and find it far more intuitive than using one pedal. It goes quite some way to giving the user a feeling of having differential brakes but of course it cannot overcome the basic limitation of the sim.
GunRunner
5th October 2008, 02:46 PM
The toe brake script gives you the ability to use either the left or right toe brake as the method of controlling the single brake axis in IL-2.
Left or Right..but,not both! Correct?
Revvin
5th October 2008, 03:03 PM
As Bob says:
because the value the sim is seeing for brakes is coming from the CMS.A1 axis and the script is feeding CMS.A1 the value from whichever toe brake is pressed the furthest. If the left brake is further down than the right one, then the left brake has control.
So you can use whichever brake you want to because movement of the left or right toe brake is feeding CMS axis 1. The sim will only see that axis so you can press either left or right toe brake or both together to apply the brake because the CMS script is taking the values from whichever brake is pressed the furthest as Bob mentioned in his post. It still only applies the single brake axis IL-2 allows but the feeling is more intuitive and goes some way to providing the feeling of having separate left and right brakes.
GunRunner
5th October 2008, 10:17 PM
As Bob says:
So you can use whichever brake you want to because movement of the left or right toe brake is feeding CMS axis 1. The sim will only see that axis so you can press either left or right toe brake or both together to apply the brake because the CMS script is taking the values from whichever brake is pressed the furthest as Bob mentioned in his post. It still only applies the single brake axis IL-2 allows but the feeling is more intuitive and goes some way to providing the feeling of having separate left and right brakes.
Well something is wrong, because I only get braking with the right toe brake, and it is progressive and I can see the result and can hear it to. Pressing the left toe brake has no effect. If I wish to turn left, I press left rudder and the RIGHT toe brake. So whatever I do, the RIGHT toe brake is working NOT THE LEFT!
Bob Church
5th October 2008, 11:17 PM
Hi GunRunner,
If you just added it to an existing script, there can be lots of things wrong (especially when it's a long one). You have to be careful that the axes and variables in the new section don't conflict with any in the existing section, you can't (necessarily) just stick it on the end. The piece of the script attributable to Revvin looks correct to me, try to reverse engineer what your friend did to see if it conflicts with anything that Revvin's script does is something that the you'd really need to get the fellow the wrote the majority of the script to look at it and see if if conflicts.
Aside from a conflict in the script between the original and the new sections, about the only things that could cause it to only respond to one of the pedals would be that, for some reason, one pedal never produces a higher value than the other, that's almost impossible, or that one of the pedals isn't actually working, but you haven't mentioned anything about that perhaps being a possibility. I'd bet it's a conflict in the script. Not that there's anything wrong with either your friends section or Revvin's section, only that the aren't working together. One of them would need to have it's references changed to match the map itself.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
GunRunner
6th October 2008, 12:58 AM
I'd bet it's a conflict in the script. Not that there's anything wrong with either your friends section or Revvin's section, only that the aren't working together. One of them would need to have it's references changed to match the map itself.
Best regards,
- Bob
OK Bob and Revin. Thanks for your advice, I will get him to check it out, as I am sure as hell going to get this to work. One way or another.:D
Kind regards
Revvin
6th October 2008, 03:40 PM
If you want to zip up your profile and attach it to a reply to this thread I'l ltake a look, no promises but maybe a fresh pair of eyes may find a digit out somewhere thats causing the problem.
GunRunner
6th October 2008, 04:42 PM
Revvin
Thanks for the offer.
I would be most grateful if you could. Here we are!
Revvin
6th October 2008, 05:31 PM
OK here you go, it seems to be working here. You didn't disable the left and right toe brake axis in the GUI.
GunRunner
6th October 2008, 09:47 PM
OK here you go, it seems to be working here.
.
This is great! Thanks very much it works a treat! :cheers:
You didn't disable the left and right toe brake axis in the GUI.
I am not sure what you mean by this! Could you please elaborate? :confused:
Revvin
6th October 2008, 10:31 PM
This is great! Thanks very much it works a treat! :cheers:
I am not sure what you mean by this! Could you please elaborate? :confused:
Glad to help, basically you were asking the toe brakes to feed input to that CMS axis but they were also assigned their own axis by default (X and Y) so IL-2 was seeing the X or Y axis - whichever pedal you pressed when assigning controls in IL-2 so the sim wasn't seeing the CMS axis that you actually wanted. All I did was go into the Pro Pedals tab in your map file and set each pedal to 'None' in the DX Axis drop down menu.
GunRunner
7th October 2008, 12:38 AM
Glad to help, basically you were asking the toe brakes to feed input to that CMS axis but they were also assigned their own axis by default (X and Y) so IL-2 was seeing the X or Y axis - whichever pedal you pressed when assigning controls in IL-2 so the sim wasn't seeing the CMS axis that you actually wanted. All I did was go into the Pro Pedals tab in your map file and set each pedal to 'None' in the DX Axis drop down menu.
Thanks. All is now clear....I didnt understand that I needed to do that.:D
GunRunner
7th October 2008, 01:06 PM
Revvin.
As I said above, this is really great. Thanks very much, however, I wonder if I could ask of your help again please? I have found one minor irritation, or maybe it is a bug, or is there a minor addition that needs making to the script? As I said everything is working as advertised, but I have found on several occassions that the brakes remain locked on when the toe brakes are released. They appear to be only partially on, and several dabs on the toe brakes will clear them. It can be plainly heard when taxiing. Even with my feet off the rudder pedals I can here them. Thoughts?
Revvin
7th October 2008, 03:51 PM
Revvin.
As I said above, this is really great. Thanks very much, however, I wonder if I could ask of your help again please? I have found one minor irritation, or maybe it is a bug, or is there a minor addition that needs making to the script? As I said everything is working as advertised, but I have found on several occassions that the brakes remain locked on when the toe brakes are released. They appear to be only partially on, and several dabs on the toe brakes will clear them. It can be plainly heard when taxiing. Even with my feet off the rudder pedals I can here them. Thoughts?
Odd, I can't ever remember the pedals behaving in that way though to be fair not many sorties online required my landing :) Make sure you have everythign calibrated, also make sure you have things like power saving turned off (http://www.ch-hangar.com/forum/showthread.php?t=3376) and that you also have your devices plugged into USB ports that are properly powered i.e those on the back of your motherboard and/or a powered USB hub. Sometimes non powered hubs can cause your devices to behave erratically.
Bob Church
7th October 2008, 09:27 PM
Hi GunRunner,
It sounds like you may need a little deadzone. The brakes don't necessarily go all the way to 0 and the script only checks that one is greater then the other, it doesn't pay any attention to the actual value, so if the values are different, you'll get some braking action.
The following script isn't "ready for prime time", but it's easy to implement (just 3 lines). Just add the "New code" section right after the "Existing code" section which is already there and see if the problem clears up. It will not be possible to apply less than about 8% breaking, we can work around that by rescaling it a little, but this should tell us if that's the problem and if it fixes it we can write a more elegant solution that will allow the brakes to work all the way to zero.
Here's what that section should look like:
// Existing code
//
if ([ js3.a1 > js3.a2 ]) then
cms.a1 = js3.a1;
else
cms.a1 = js3.a2;
// New code
//
if([ cms.a1 < 20 ]) then
cms.a1 = 0;
endIf
Also, Axis 1 on the CMS Controls tab (CMS.A1) has the "Centered" box checked. The brake axis will actually be unidirectional, so you should probably uncheck that. Try it both ways.
Anyway, give those a try and see if it helps. If it does, we can set up a better script.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
BLR_Tonin_fr
16th November 2008, 07:57 PM
Hello
There is a simple way to add the usage of the two pedals (sorry if my post gets in double but I think nobody mentioned it) in the IL2 simulator.
So, you just need to create a new line in the settings.ini file.
Locate the "brake" entry wich should be applied to Y axis (or X... whatever)
Duplicate this line and change Y to Z axis.
http://img120.imageshack.us/img120/7/brakeseg2.jpg (http://imageshack.us)
If it can help someone else...
GunRunner
2nd December 2008, 10:05 PM
Hi GunRunner,
It sounds like you may need a little deadzone. The brakes don't necessarily go all the way to 0 and the script only checks that one is greater then the other, it doesn't pay any attention to the actual value, so if the values are different, you'll get some braking action.
The following script isn't "ready for prime time", but it's easy to implement (just 3 lines). Just add the "New code" section right after the "Existing code" section which is already there and see if the problem clears up. It will not be possible to apply less than about 8% breaking, we can work around that by rescaling it a little, but this should tell us if that's the problem and if it fixes it we can write a more elegant solution that will allow the brakes to work all the way to zero.
Here's what that section should look like:
// Existing code
//
if ([ js3.a1 > js3.a2 ]) then
cms.a1 = js3.a1;
else
cms.a1 = js3.a2;
// New code
//
if([ cms.a1 < 20 ]) then
cms.a1 = 0;
endIf
Also, Axis 1 on the CMS Controls tab (CMS.A1) has the "Centered" box checked. The brake axis will actually be unidirectional, so you should probably uncheck that. Try it both ways.
Anyway, give those a try and see if it helps. If it does, we can set up a better script.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Bob. I havent been here for a while, so I am late in replying.
Anyway, thanks for the additional part of the script. Unfortunately it says "error at end script when I copy and paste your addition part into it, so I am still using the origianal one that Revin sent.
Any idea why this is happening?
Kind regards
Bob Church
3rd December 2008, 01:00 AM
Hi GunRunner,
It's an error in the script. Sorry about that. You need to add and "endIf" to close the first "if" block:
script
// Existing code
//
if ([ js3.a1 > js3.a2 ]) then
cms.a1 = js3.a1;
else
cms.a1 = js3.a2;
endIf // <<< MISSING IN ORIGINAL
// New code
//
if([ cms.a1 < 20 ]) then
cms.a1 = 0;
endIf
endScript
Sorry for the error. Anyway, try adding that and see if it helps.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
GunRunner
22nd December 2008, 11:43 AM
Bob. I havent been here for a while, so I am late in replying.
Anyway, thanks for the additional part of the script. Unfortunately it says "error at end script when I copy and paste your addition part into it, so I am still using the origianal one that Revin sent.
Any idea why this is happening?
Kind regards
Hi Bob
Thanks for the correction. The error message has now gone. but......
Also, Axis 1 on the CMS Controls tab (CMS.A1) has the "Centered" box checked. The brake axis will actually be unidirectional, so you should probably uncheck that. Try it both ways.
Anyway, give those a try and see if it helps. If it does, we can set up a better script.
Best regards,
- Bob
I have tried with and without the "Centered" box checked, unfortunately, it does not appear to have made any difference. The brakes for some reason just do not seem to release after they have been applied even with my feet off the pedals completely. Any thoughts?
Kind regards
Bob Church
22nd December 2008, 12:09 PM
Hi GunRunner,
Try setting the "Deadzone" value higher. You can't really set Deazone on a brake axis in the CM, it's meant to be the area around the center of travel, but in the new code:
// New code
//
if([ cms.a1 < 20 ]) then
cms.a1 = 0;
endIf
that I tagged on, the "20" sets an effective deadzone of about 8%. Try raising the 20 to something higher. The brakes should return near "0" when they're released, near 255 when they're fully pressed, if you look at them in the Test/Calibrate screen in the Control Manager. Use Direct Mode, the Raw Data display will show you the numbers that are coming out of the controller. The "20" needs to be high enough to cover that data and the last IF block should force it back to zero. It's not a great way to do it, there'll be a step coming from 0 when it jumps to 20, but we can smooth that out. It's just a matter of getting to to go into deadzone first, then figuring out where you want that deadzone value set.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
GunRunner
22nd December 2008, 01:46 PM
Hi GunRunner,
Try setting the "Deadzone" value higher. You can't really set Deazone on a brake axis in the CM, it's meant to be the area around the center of travel, but in the new code:
// New code
//
if([ cms.a1 < 20 ]) then
cms.a1 = 0;
endIf
that I tagged on, the "20" sets an effective deadzone of about 8%. Try raising the 20 to something higher. The brakes should return near "0" when they're released, near 255 when they're fully pressed, if you look at them in the Test/Calibrate screen in the Control Manager. Use Direct Mode, the Raw Data display will show you the numbers that are coming out of the controller. The "20" needs to be high enough to cover that data and the last IF block should force it back to zero. It's not a great way to do it, there'll be a step coming from 0 when it jumps to 20, but we can smooth that out. It's just a matter of getting to to go into deadzone first, then figuring out where you want that deadzone value set.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Bob you are so kind. I will try later and see how it goes. Perhaps I should try around 40 or is that too high?
Bob Church
22nd December 2008, 08:04 PM
Hi GunRunner,
For testing, I'd go up maybe to 128, halfway, just so it definitely can't be missed. Once the logic works, we can move the value up or down to suit, right now all we want is to see if the logic is right.
Let me know how it goes!
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
GunRunner
22nd December 2008, 11:04 PM
Thanks Bob.
It works fine at 128 on fighter aircraft. I am inclined to keep it there until I fly a bomber. Perhaps then I might need to do some adjustments.
Bob Church
23rd December 2008, 05:25 AM
Hi GunRunner,
Okay. There's no real problem with the script really except that when you get to 128, it's suddenly going to jump for no brake to about 50% brake. We could do the arithmetic and have it start at the 50% point (128) and then go smoothly from no braking to full braking in the second half, but if it's working okay for you, that's all that matters.
Glad to hear it worked for you!
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
GunRunner
23rd December 2008, 04:28 PM
Hi GunRunner,
Okay. There's no real problem with the script really except that when you get to 128, it's suddenly going to jump for no brake to about 50% brake. We could do the arithmetic and have it start at the 50% point (128) and then go smoothly from no braking to full braking in the second half, but if it's working okay for you, that's all that matters.
Glad to hear it worked for you!
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Hi Bob
How easy is to make it operate from no braking to full braking in the second half? The reason I am asking, is because I am dabbing the brakes and that is working, however, a more refined way would be far better. Please note, you would not be doing this for just me, there are several others watching this thread. Once again thanks and a Merry Xmas. :cheers:
Bob Church
23rd December 2008, 09:14 PM
Hi GunRunner,
Not really hard at all. You want "0" until you get an axis value of 128, that's what it does not. Then you want the output to go from 0 to 255 while the axis goes from 128 to 255.
Right now, that last "New Code" section at the end looks like this:
// New code
//
if([ cms.a1 < 128 ]) then
cms.a1 = 0;
endIf
You would just need to change that piece of it to look like this:
// New code
//
if([ cms.a1 < 128 ]) then
cms.a1 = 0;
else
cms.a1 = ( cms.a1 - 128 ) * 2;
endIf
It just locks it at 0 until you hit halfway, then doubles the difference between 128 and the input value to make the axis move through full deflection. If you change the 128 value to move the start point, you'd need to change the arithmetic a little so that whatever you've got left gets stretch to give you the 255. The multiplication/division that turns up can be a little bit trick. If you used 64 rather than 128 for example, the equation would need to look like:
if([ cms.a1 < 40 ]) then
cms.a1 = 0;
else
cms.a1 = (( cms.a1 - 40 ) * 255 ) / 215;
endIf
That's the more general form. That final divisor, the "215", is 255 - whatever you use for the deadzone. Using 128 or 64 is easier since it's just a multiplication by 2 (128) or 3 (64) but with the calculation you can set it to whatever value you want.
Give it a try, it should be much smoother in the transition. You can see the difference in the Test/Calibrate screen if you watch the thing in Mapped Mode, it'll hang at 0 until you cross the deadzone and then start to move, hitting full scale at the same time as the brake does. As it was, it would hang at 0 until you hit 128, then jump immediately to 128 and go up from there.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
akash
19th January 2009, 04:39 PM
I have carried out the instructions as per the link, and at the end I go into the controls section of the game under Hotas and press the toe brakes. If I press the left hand to brake, the braking is assigned to the left hand toe brake
Bob Church
19th January 2009, 09:37 PM
Hi akash,
I'm not sure what you're asking. That sounds more or less correct, depending on what you're trying to accomplish. Is that not what you want to happen?
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
GunRunner
7th May 2009, 06:48 PM
Bob. I forgot to say, this one works a treat! Thanks very much.
if([ cms.a1 < 40 ]) then
cms.a1 = 0;
else
cms.a1 = (( cms.a1 - 40 ) * 255 ) / 215;
endIf
Powered by vBulletin® Version 4.1.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.