PDA

View Full Version : Flaps setting in IL2



thdees
14th April 2008, 10:12 PM
Hello All,

I am after some suggestions here on how I might be able to solve the following problem.

I use the TQ in IL2. I have prop pitch mapped to an axis. I have flaps mapped to the lever beside it.

I don't want to have flaps as a directx axis as I still want to have the messages showing on my screen. It also means I'm using the flaps on planes with only an "on" or "off" setting correctly. To do this I use the standard method of mapping the F and V key via the control manager. .

The issue I have is that I only have to move the lever a fraction from the top and it immediately sends a "v" key. What I am after is the ability to send one key stroke as it passes downwards through a particular range and then send a different key stroke as it passes up through the same range. Is that possible? I would then be able set up the ranges to have a more visual representation of what my flap positions are.

Thanks in advance.
thdees

Bob Church
17th April 2008, 02:56 AM
Hi thdees,

It's certainly possible through CMS scripting. Neither of the GUI button functions will work very well, but if you "Add" the CMS Controls to the map the job is simple enough. Make a script that will do it. I'll assume the throttle is the second device and the flaps are the second lever, hence the JS2.A2 references. Also, I'm going to use CMS Button 1 and 2. If they're used already, you can use any unused CMS buttons. Doesn't matter, but you'll need to be changed to some other reference if that's not the case. If you don't exactly know what I'm talking about, tell me which lever you're using for flaps and how the tabs are labeled in the GUI. The first tab, will always be "Program Settings", I'd need to know the ordering of devices to the right of that.

Anyway, the script is simple enough. The Axis returns 0 to 255 so 128 is the center. I'd set it up with maybe 8 counts of hysteresis so it didn't bobble between the two. The script would look like this:


script
cms.b1 = [ js2.a2 < 120 ];
cms.b2 = [ js2.a2 > 136 ];
endScript

Button 1 on the CMS Controls tab will turn ON when the lever is about 8 counts ahead of center, Button 2 on the CMS Controls tab will turn ON when the lever is 8 counts behind center. You just need to program them to send the "F" and the "V" characters. You probably want them to only get sent once, and only use "F" and "V" if the sim specifically asks for upper case. Probably you want them programmed as:

f NULL

and:

v NULL

That way they just send the character once as the lever passes through the two points, but having sent the character for behind center, you have to move it forward at least 16 counts (not far, but enough) before it will send the character ahead of center. You can swap the two character to get working the way you want. The lever itself should not be assigned to do anything.

I don't know how well-versed you are in scripting, but if you need more help just ask and I'll help you sort it out! Takes about 5 minutes, and you can add the CMS Controls anytime. They're on the same list that shows up when you click the "Add" button.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

thdees
18th April 2008, 04:42 AM
Hi Bob,

Thanks for getting back to me.

I see your theory and I was working on the same principle but what I'm after is to be able to break up the whole range into separate segments. What your script does is split the axis in two which is not quite what I'm after but it is getting there. My requirement is a little more complicated.

What I'm wondering is that is it possible to use cms scripting to detect a certain direction of an axis through a segregated range and send one key stroke when the range the lever is passing through is increasing and another key when it is decreasing?

Like this: 0 - 75 = v (combat flaps), 76 - 120 = v (take off flaps), 121 - 175 = v (landing flaps) then the reverse 175 - 121 = f, 120 - 76 = f, 75 - 0 = f

The numbers are not exact and it would need some fine tuning to get the lever to respond in the correct areas but you can see what I mean from it.

Thanks again,
thdees

Bob Church
18th April 2008, 06:10 AM
Hi thdees,

Ah. Okay. Then you want multiple zones but different characters depending on the direction of movement, e.g Zone A -> Zone B sends "x", but Zone B -> Zone A sends "y", but with more than just two zones, yes?

If that's the case, I worked it out not too long ago. Check this thread:

http://www.ch-hangar.com/forum/showthread.php?t=5486

I didn't get it right until Message #3, at first I thought he was just looking to zone the thing, but I think it's what you're looking for. Have a look and see what you think. You can set up as many zones and use whatever characters you want.

Let me know if that takes care of it for you. If not, we'll work something else out.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

thdees
18th April 2008, 09:24 PM
Thanks Bob!

That's it in a nutshell!

I can now go to combat flaps with the lever at about a quarter throw. When I hit the detent on the way down I am at take off settings and landing when I get to the bottom. It then raises flaps at the same position when going back up. It works perfectly!

Here are my settings if anyone else is looking to try this.

TQ is js4 and axis is no.5. cms axis is a4 as I have 1,2 and 3 doing other things. Likewise b1 and b2 so I start at b3.

cms.a4 = js4.a5;

cms.b3 = [ cms.a4 > 245 ];
cms.b4 = [ cms.a4 > 185 ];
cms.b5 = [ cms.a4 > 80];

Buttons are all set to v null for press and f for release.

It was so simple in the end. Seems there isn't much you can't do with this software. :thumbsup:

Cheers,
thdees

Bob Church
19th April 2008, 02:40 AM
Hi thdees,

I'm glad it worked for you! It's come up quite a few time and there's no "built-in function for it. It just sort of occurred to me in that post I directed you to. A zone is easy, but it was originally made for character throttle and the direction didn't matter, onlly the positinon. Different characters depending on which way you're moving has always been difficult, I'm glad to finally have a method that will do the trick.

Have fun with it!

Best regards,

- Bob

The Stikckworks
http://www.stickworks.com