View Full Version : Script for Spoilers?
Howard
11-11-2004, 05:17 PM
Hi Bob,
Could you please help write a script to set one of the available levers on the Yoke to arm, to deploy and to close the spoilers? Also, I would like to use another lever to open and close the cowlings. Is a script possible for that too?
Thanks a lot,
Howard
Bob Church
11-11-2004, 11:30 PM
Hi Howard,
>> Could you please help write a script to set one of the available levers on the Yoke to arm, to deploy and to close the spoilers? <<
I'd be happy to, Howard. Exactly what does it have to do?
>> Also, I would like to use another lever to open and close the cowlings. Is a script possible for that too? <<
I would think we can work something out. We looked at that the other day and there are individuatl "COWL_FLAPSn_SET" commands which are apparently for axis control, and then there are COWL_FLAPS_INC/COWL_FLAPS_DEC commands, it appears there's a single version that I'd guess works all engines a the same time using buttons (or keys) and then there are a set of 4 like that, one for each individual engine. If they can be moved with keystrokes, you could probably used the single INC/DEC commands and just program an Up/Down statement on the lever. The other option would seem to be generating 4 separate axes and then using the COWL_FLAPSn_SET commands, there doesn't look to be a "master" command in that set. It's not a real problem, though, if that's the case. If you wanted to use the 6th axis on the quad and the quad was js2, you'd need to do something like:
script
cms.a1 = js2.a6;
cms.a2 = js2.a6;
cms.a3 = js2.a6;
cms.a4 = js2.a6;
endscript
and then assign the COWL_FLAPS1_SET COWL_FLAPS4_SET commands to those 4 axes. I haven't actually done it, but that's what I'd try first to get single lever control. Have you tried the COWL_FLAPS commands? I guess the question is the same as for the spoilers, exactly what do you want it to do?
BTW, I've been meaning to get back to you on the reverse thrust thing. I talked to Pete and he didn't see any reason it shouldn't work with the 255-240-0 values either, so I think it's just a matter of some adjustments to FSUIPC settings for the deadzone around the detent. I haven't been able to try it yet, though.
- Bob
The StickWorks
http://www.stickworks.com
Howard
12-11-2004, 01:53 AM
Bob-
All I really want to do is when the throttle lever on the Yoke is pushed forward it will emulate the '/" and activate the spoilers, and when pulled back it will also emulate the "/" key, to close the spoilers.
Howard
Bob Church
12-11-2004, 04:38 AM
Hi Howard,
>> All I really want to do is when the throttle lever on the Yoke is pushed forward it will emulate the '/" and activate the spoilers, and when pulled back it will also emulate the "/" key, to close the spoilers. <<
Okay. Assuming the yoke is js1 (first tab) then the throttle axis is js1.a3. You'd need to add the CMS Controls to your map. I'm assuming you're not using any of the CMS buttons yet, if you are they'll have to move, but basically you want to program a CMS button, cms.b1 for this script. Uncheck the DirectX Mode box and then set the Normal Action "Press" box like this (there's a space between the slash and the NULL):
/ NULL
The NULL just keeps it from repeating. Also, program just the slash:
/
in the Normal Action "Release" box.
Next open click the CM Editor button and get to the CMS script. It needs to look like this:
script
cms.b1 = [js1.a3 < 128];
endScript
which basically tells it to turn cms.b1 on when the throttle lever is forward of it's center position. As you push it forward, it will generate a single slash as it goes past the halfway point, and when you pull it backward it will generate another single slash as it goes through the center. You'll just need to be sure that the throttle is back before you start the flight or it will come up working the wrong way around. You can probably fix that by hitting a slash on the keyboard itself to get the spoilers back in phase with the throttle position.
Is that what you wanted to do?
- Bob
The StickWorks
http://www.stickworks.com
Bob Church
12-11-2004, 04:47 AM
Hi Howard,
One thing I meant to mention. If the throttle lever was visible in FS before, that script will leave it there. You'll want to unassign anything that's assigned to it in FS. I wouldn't take the axis out, though, since if it disappears then FS is going to want to write a new CFG file.
- Bob
The StickWorks
http://www.stickworks.com
Howard
12-11-2004, 04:19 PM
Ho Bob,
I will give it a try tonite. I already unassigned the throttle from the yoke's axis when I installed the TQ.
Thanks,
Howard
Dirk98
12-12-2004, 11:44 PM
Reading your posts, Bob, learn every time something useful. Like Null in this simple script, is a good addition, I've just realised why my spoilers were always trembling when extended.
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.