PDA

View Full Version : Programming multiple throttles in IL2



abe_beson
26th August 2004, 09:20 AM
I've been testing an old idea on how to get the TQ work with IL2, and thus wrote this script. I had planned to wait with writing this script, but a suggestion from Bob Church made me rethink that. He suggested that my idea could be tested with the pro throttle and the throttle wheel on the fighterstick.

The result is working fine, but is not optimized. It is probably possible to reduce time and reduce the spam in the game a bit, but the script in its current form is enough to show the idea. :cheers:

I hope some of you might find this useful,
Abe :)


This script solves the problem for two throttle levers (pro throttle and throttle wheel on the fighterstick) and I see no reason that it should not be possible to extend to be used with the TQ:


%define deSelectAllOut cms.b5
%define toggleLeftOut cms.b6
%define toggleRightOut cms.b7

%define startEngineSeq b3
%define engineSeqRunning b4

%define oldLeftThrtl a1
%define oldRightThrtl a2

script

// If any throttle lever has changed, the engine sequence
// should be started.
if([js2.a3>oldLeftThrtl+2] OR
[js2.a3[list=1]oldRightThrtl+2] OR
[js1.a3<oldRightThrtl-2]) then
startEngineSeq=true;
endif

// Run the engine sequence only when needed, or
// the game will be spammed.
if(startEngineSeq or engineSeqRunning) then
sequence
engineSeqRunning=true;
startEngineSeq=false;
// deselect all engines
deSelectAllOut=true;
delay(2);
deSelectAllOut=false;
delay(2);

// left engine(s)
//
cms.a2 = oldLeftThrtl; // Copy the old left lever value
// into the throttle register
delay( 2 ); // Let the sim see that
toggleLeftOut=true; // Select the left engine
delay( 2 ); // Let the throttle value register
toggleLeftOut=false;
delay(2);
oldLeftThrtl=js2.a3;
cms.a2 = js2.a3; // Copy the left lever into the
// throttle register. (An event to the
// game is not generated until the
// driver sees a change.)
delay( 2 );
toggleLeftOut=true; // Deselect the left engine
delay( 2 ); // Let the sim see that
toggleLeftOut=false;
delay( 2 );

// right engine(s)
//
cms.a2 = oldRightThrtl; // Copy the old right lever value
// into the throttle register
delay( 2 ); // Let the sim see that
toggleRightOut=true; // Select the right engine
delay( 2 ); // Let the throttle value register
toggleRightOut=false;
delay(2);
oldRightThrtl=js1.a3;
cms.a2 = js1.a3; // Copy the right lever into the
// throttle register. (An event to the
// game is not generated until the
// driver sees a change.)
delay( 2 );
toggleRightOut=true; // Deselect the right engine
delay( 2 ); // Let the sim see that
toggleRightOut=false;
delay( 2 );
engineSeqRunning=false;
endSequence
endif
endscript

Yobbo
26th August 2004, 12:21 PM
Very nice idea abe! :thumbsup:

I agree it could be tweaked and or simplified but it explains the principal&#39;s perfectly.

Keep the ideas comin&#39; :salute:

IndioBlack
31st August 2004, 08:23 PM
Hi Abe,
I don&#39;t really understand this cms scripting stuff, but I think I see your concept.

Basically what I think you are doing is creating a situation where if the pilot moves a particular throttle lever - say for engine 2, then the script first causes the engine selection button to activate engine 2, and then accepts the lever inputs. When the pilot moves the lever for engine 1, the script causes the engine 1 selection button to activate, and then accepts the inputs.
This is a great idea.

Naturally, it would be a lot simpler if Oleg and his team elevated their thinking and adopted the approach that Microsoft did with CFS2, and allowed direct input of individual axes for throttle, mixture and prop pitch for four separate engines.
Microsoft foolishly dropped this idea for CFS3 and will be eternally damned.
If Oleg doesn&#39;t catch up, then when the throttle quadrant arrives, the Sim of choice will be CFS2.

It&#39;s a shame that a genius like you has to perform acrobatics in lateral thinking to make up for the lack of vision in our Simulator Producers. But, you know this stuff is just sent to try us.

abe_beson
31st August 2004, 09:34 PM
Genius, no way, but thanks!

Actually I love to program my stick, almost as much as I love flying with it! :)

There will be no need for you to go back to CFS2 since everyone with a TQ will be able to run this script. I am sure that by the time the TQ arrives there will be some good map ready to download in the control manager. All you got to do is a few clicks with your mouse and you have it!


Basically what I think you are doing is creating a situation where if the pilot moves a particular throttle lever - say for engine 2, then the script first causes the engine selection button to activate engine 2, and then accepts the lever inputs. When the pilot moves the lever for engine 1, the script causes the engine 1 selection button to activate, and then accepts the inputs.
This is a great idea.
[/b]

You are not in the bulls eye, but you are close enough. Nice to see that some people actually tries to understand this! :D

What I actually do is to output both levers to the game, as soon as at least one is moved.

Your idea however is the better one, and it probably is the one that will be used in the real maps to come. It is a bit more complicated than my example though, and I wanted to keep the example as clean and simple as I ever could!

/Abe

Bob Church
1st September 2004, 12:55 AM
I don&#39;t know if that will actually work better. I can see a potential problem when both levers move at once. One will get control, the other might not move until the first one was done. It might get a little bit "jerky".

If you try it, let us know how it works out!

- Bob

The StickWorks
http://www.stickworks.com

abe_beson
1st September 2004, 08:44 AM
Thx for the input Bob! :)

But I think you are not quite right, actually the timing would be the same. So if the "better" algorithm is jerky so is the simple one. The "better" algorithm would probably be more responsive, since all unecessary steps could be eliminated. Admittedly there would be more lines of code, but the only code that actually takes noticable time in the script, is the delay statements and fewer of these would be executed if only few levers moved!

However, the main reason for reducing amount of action going on in the script is that the game outputs a text as soon as an engine is selected or deselected. I think the users of this script would get confused if they see engine 2 selected, if they only moved the lever for engine 1. Further the throttle settings are displayed, even for an axis that is not moved. So if the user moves throttle lever 1 to say 50% and keep throttle level 2 at 100% he would see the 50% flash and then the 100% stay in the game window. This is obviously not very good.

I will probably not test a new script until I got the TQ, since there are other issues to be solved as well. For example how shall mixture and pitch control be implemented? Even the engine start sequence must be thought about, since you can start only one engine at a time in the game. Further I would not like to scrap the Pro Throttle since I think it is one of the best CH-devices. A movement on the Pro Throttle should make all throttles move from their relative positions. I am sure there are even more issues to be solved. All this is of course better presented as a complete map.

/Abe

Misha26
16th November 2004, 07:35 PM
So Abe,

Any progress on your script? Were you able to test it with the actual throttle Quadrant?

Anyone have a MAP for the IL2 series for multi-engined aircraft using the TQ, PP, and either FY or FS? If so can you please post. Thanks in advance!

Mike aka Misha26


Originally posted by abe_beson@Sep 1 2004, 07:44 AM
...I will probably not test a new script until I got the TQ, since there are other issues to be solved as well. For example how shall mixture and pitch control be implemented? Even the engine start sequence must be thought about, since you can start only one engine at a time in the game. Further I would not like to scrap the Pro Throttle since I think it is one of the best CH-devices. A movement on the Pro Throttle should make all throttles move from their relative positions. I am sure there are even more issues to be solved. All this is of course better presented as a complete map.

/Abe
<div align="right">6266
[/quote]

abe_beson
18th November 2004, 02:22 AM
Hi!
Yes, but I&#39;ve only had my TQ for a week yet. You will have to hold your horses for a little while more! :)

The unmodified script will only work with the pro pedals, pro throttle, fighterstick and the throttle quadrant combination (since this is my combination), but the script is easily modifiable to any other configuration involving the TQ. The targeted game is IL2-AEP, but there is no reason why it would not work with PF as well.

Some features you will get:
1. Ability to switch between 1, 2 and 4 engine modes on the fly.
2. The 1 and 2 engine modes are general in the sense that they will also work with aircrafts with more engines.
3. In the 1 and 2 engine modes, there will be full trimming capabilities and perhaps flap control on an axis.
4. The pro throttle will work as the main throttle control. This means that most of the time you can have your hands off the TQ and you can use your old HOTAS pretty much as you are used to. Of course you can set the pro throttle at maximum and stove it away, if you only intend to use the TQ.

Progress so far:
Everything above works smooth in my current script, but it is a tad bit slow. I&#39;m right now working on a partial solution for the speed problem so lets see where I end up. It will of course never be as good as if Oleg had chosen to implement muli throttle control in the game. Keep requesting this update from him!

Finally, as a teaser, I can say that flying the TB3 is a much more interesting experience than before. The flying shed has come alive! :)

Be patient, multi engine control in IL2 is soon ours!
/Abe

Misha26
18th November 2004, 06:29 AM
Thanks for the update Abe.

I tried adding your script into a couple of maps but couldn&#39;t get it working...(probably because I don&#39;t know what I&#39;m doing)...so I&#39;ll be patient and wait for you to do the hard work and just download your map when your done. ;)

Another thing I was thinking about trying, which is simpler but not as cool as what you&#39;re doing, is to just make a script to assign a button or buttons to swap axis. What I mean is this:

a)When I move a particular hat on my FS to the left, the left engine is selected and TQ axis 1 becomes the throttle axis and TQ axis 3 becomes the propeller axis.

b)When I move the same hat on my FS to the right, the right engine is selected and TQ axis 2 becomes the throttle axis and TQ axis 4 becomes the propeller axis.

Do you (or anyone else out there in cyberspace) know of a script to to accomplish this or if it is possible?

I haven&#39;t had much time to play with the TQ but I&#39;ve been very happy with it so far, even just in Direct mode.

Cheers.

abe_beson
18th November 2004, 10:51 AM
Hi!
It is possbile to implement your idea, but you still will not end up with a faster script than mine, since you will have to give the game the exactly the same input. This is actually what takes time in my script, not the 600 lines of logic! :)

/Abe

Junkman
11th December 2004, 09:02 PM
I hope you don&#39;t mind, but I&#39;ve got an idea about this, but can&#39;t really implement it because I only have Ch rudders. What you might want to try is editing your user settings ini file in IL2 and adding additonal axes that will also activate the throttle. You would only have to know how IL2 assigns the axes in game. I know that it is possible with the X and Y axes on the rudder pedals. I can assign the Brakes to one axis in game, then go to the settings ini file and add another line for the other axis and both axes will activate the brakes. If you want to use different axes for throttle on different engines you may only have to assign an engine command that is dependent on which throttle axis is being moved. I don&#39;t know if this will work but it might be something you could try. Hopefully I haven&#39;t posted something that is OT.

abe_beson
11th December 2004, 09:30 PM
Hi Junkman!
Nice idea, I should look into that for correcting the pitch bug. It might actually work your way. At least I&#39;ll try it! Thanks for letting me know! :)

/Abe

Junkman
12th December 2004, 06:08 AM
Sorry I didn&#39;t think of this sooner, but a couple of things you need to watch out for are:
1.Make sure you have values assigned in the conf.ini file for the axis you added
2.If you open up the controls setting in game after adding the axis in the setting.ini
file, your axis will be erased from the settings.ini file.

B16Enk
7th February 2006, 05:28 PM
Hi.

Looking through the forum here for inspiration, got my TQ yesterday to go with my PP and PT.

This Idea of yours Abe is pretty much what I was looking to do, particularly the idea of being able to use the PT and it effectively sending a &#39;select all engines&#39; and being a master throttle.

Have you managed to progress this at all?

The extra axis in conf.ini suggested by Junkman sounds good too.
I can feel some experimentation coming on :)