PDA

View Full Version : Understanding the IL2 Toe brakes script



sobe
18th February 2010, 04:31 AM
Below is the toe brakes script for Il2 that someone wrote and I want to use. However, I don't understand the second part and what it does (everything starting with the <128). Also, I would like the toe brakes not to kick in until they are pressed about half way down as otherwise they are too sensitive when I press the rudder.

Finally, what are the settings for the toe brakes in CM Device 4 and in CMS controls A4

F ([JS4.A1 > JS4.A2]) then //*******LEFT OR RIGHT TOE BRAKES SCRIPT****
CMS.A4 = JS4.A1;
ELSE
CMS.A4 = JS4.A2;
ENDIF

if ([ js4.a1 < 128]) then
cms.a4 = 0;
else
cms.a4 = ( js4.a1 - 128 ) * 2;
endIf

:confused:

Bob Church
25th February 2010, 02:47 AM
Hi Sobe,

The brakes, all the CM axes actually, return values 0 to 255. With the brakes it's 0 at the top, 255 fully depressed. The 128 is the mid-value. Basically, the second part just returns 0 (released) until you push the brake halfway down, then it switches full on. The "* 2" at the end just scales the value back up to 255, full brake. Essentially, it does nothing until the pedal is halfway down, then the brakes come full on. It needs the "time 2" to get full brake back. Without it, the 128 would cut the range in half. The first part just responds to the brake pedal with the highest value. You really only need to press one brake or the other. When it goes down halfway, you should get full brake.

The Toe Brakes are the X and Y axes. It looks like the pedals are the fourth device (JS4). The CMS values are really just random. Whoever wrote the script used them, probably just the next unused CMS buttons in the lineup.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

sobe
25th February 2010, 03:40 AM
thanks