Revvin
13th April 2007, 08:45 PM
This script used here has been requested a number of times and was originally posted by Michael Sexton at CH Products. Its a simple script that can be used in flight simulations to provide war emergency power or 'WEP' as its commonly referred to as (or any other command for that matter) once the throttle is pushed past a certain point.
Scenario
A number of WWII fighter aircraft had a 'wired' stop at the end of the throttle lever that the pilot could 'punch through' to give him an extra boost of power in case of emergency - hence the name 'war emergency power'. IL-2 (and most other WWII combat flight simulations) have this function but of course we don't have a wired stop to punch through. Usually in those WWII combat flight sims WEP is enabled by means of a key press. Of course this can be done easily by mapping that command to a button but in this example we shall control WEP a little more realistically by having it at the end of our throttle travel. Once we get past around 96% of our throttle travel the WEP command will be given, and once we move out of that last 96% range of our throttle travel WEP will be disabled.
The Script
Load up your profile into the Control Manager software and click on the CMS Controls tab:
http://www.ch-hangar.com/SiteFiles/Images/faq/cms_controls_tab.jpg
If you do not have a CMS Controls tab then we will need to add CMS capability to your profile by clicking on the add button http://www.ch-hangar.com/SiteFiles/Images/faq/cmaddbtn.jpg and then selecting CMS Controls in the pop up window and click 'Okay'
http://www.ch-hangar.com/SiteFiles/Images/faq/adding_cms_controls.jpg
Now we need to open the CM Editor by clicking on the CM Editor button http://www.ch-hangar.com/SiteFiles/Images/faq/cmeditorbtn.jpg in the Control Manager toolbar. The CM Editor will pop up in a new window and you will see a part of the screen already has the text in place for the title, who wrote the script and the date. This text will be in green because it is commented out by use of the two forward slashes '//' at the start of the line. Underneath that you will see the words 'script' and 'endScript'. Between these two words is where we will enter out piece of CMS script which is as follows:
CMS.B1 = [JS1.A3 < 10];
The first part of the line 'CMS.B1' refers to CMS button number one which we will use in this script to trigger WEP. 'JS1.A3' is the axis we will use in the script so in this example its joystick 1 axis 3. This may be different in your profile if your Pro Throttle is device 2 or 3. If your Pro Throttle is device 2 then replace 'JS1.A3' with 'JS2.A3'. Once that is done you can close the CM Editor window (don't worry you don't need to save anything before closing the CM Editor window) The image below illustrates what we have just done.
http://www.ch-hangar.com/SiteFiles/Images/faq/wep_example_1.jpg
Now we need to assign a command (the WEP command) to CMS Button 1 which we referred to in our script above. To do this we now need to click on the CMS Control tab in the Control Manager GUI. Once we have the CMS Controls tab open we can now select Button 1 by clicking on it as shown in the image below. You will see rows and rows of buttons and all of these buttons can have commands assigned to them just like you would for a joystick button. In this example we're going to actually input the key character we want rather than insert a command from a .cmc file for the sake of simplicity. In our chosen sim the key to enable WEP is 'w' so we input that and the word 'NULL' into the dialogue boxes as shown.
http://www.ch-hangar.com/SiteFiles/Images/faq/wep_example_2.jpg
Thats it! you can now save the profile and download it to your Pro Throttle You can play around a little with this script, for example instead of having it enable WEP at one end of the throttle range why not have it enable brakes at the other end? You can also move the postion the point where WEP is enabled by altering the number at the end of the script. In the example we used the number 10 but it could be any range on the throttle from 0-255.
Scenario
A number of WWII fighter aircraft had a 'wired' stop at the end of the throttle lever that the pilot could 'punch through' to give him an extra boost of power in case of emergency - hence the name 'war emergency power'. IL-2 (and most other WWII combat flight simulations) have this function but of course we don't have a wired stop to punch through. Usually in those WWII combat flight sims WEP is enabled by means of a key press. Of course this can be done easily by mapping that command to a button but in this example we shall control WEP a little more realistically by having it at the end of our throttle travel. Once we get past around 96% of our throttle travel the WEP command will be given, and once we move out of that last 96% range of our throttle travel WEP will be disabled.
The Script
Load up your profile into the Control Manager software and click on the CMS Controls tab:
http://www.ch-hangar.com/SiteFiles/Images/faq/cms_controls_tab.jpg
If you do not have a CMS Controls tab then we will need to add CMS capability to your profile by clicking on the add button http://www.ch-hangar.com/SiteFiles/Images/faq/cmaddbtn.jpg and then selecting CMS Controls in the pop up window and click 'Okay'
http://www.ch-hangar.com/SiteFiles/Images/faq/adding_cms_controls.jpg
Now we need to open the CM Editor by clicking on the CM Editor button http://www.ch-hangar.com/SiteFiles/Images/faq/cmeditorbtn.jpg in the Control Manager toolbar. The CM Editor will pop up in a new window and you will see a part of the screen already has the text in place for the title, who wrote the script and the date. This text will be in green because it is commented out by use of the two forward slashes '//' at the start of the line. Underneath that you will see the words 'script' and 'endScript'. Between these two words is where we will enter out piece of CMS script which is as follows:
CMS.B1 = [JS1.A3 < 10];
The first part of the line 'CMS.B1' refers to CMS button number one which we will use in this script to trigger WEP. 'JS1.A3' is the axis we will use in the script so in this example its joystick 1 axis 3. This may be different in your profile if your Pro Throttle is device 2 or 3. If your Pro Throttle is device 2 then replace 'JS1.A3' with 'JS2.A3'. Once that is done you can close the CM Editor window (don't worry you don't need to save anything before closing the CM Editor window) The image below illustrates what we have just done.
http://www.ch-hangar.com/SiteFiles/Images/faq/wep_example_1.jpg
Now we need to assign a command (the WEP command) to CMS Button 1 which we referred to in our script above. To do this we now need to click on the CMS Control tab in the Control Manager GUI. Once we have the CMS Controls tab open we can now select Button 1 by clicking on it as shown in the image below. You will see rows and rows of buttons and all of these buttons can have commands assigned to them just like you would for a joystick button. In this example we're going to actually input the key character we want rather than insert a command from a .cmc file for the sake of simplicity. In our chosen sim the key to enable WEP is 'w' so we input that and the word 'NULL' into the dialogue boxes as shown.
http://www.ch-hangar.com/SiteFiles/Images/faq/wep_example_2.jpg
Thats it! you can now save the profile and download it to your Pro Throttle You can play around a little with this script, for example instead of having it enable WEP at one end of the throttle range why not have it enable brakes at the other end? You can also move the postion the point where WEP is enabled by altering the number at the end of the script. In the example we used the number 10 but it could be any range on the throttle from 0-255.