View Full Version : Wingtip smoke-intermittantly
ruggbutt
29-12-2004, 07:38 PM
In LOMAC we use wingtip smoke to help our nuggets form up. The flight leaders use smoke full on, and I'd like to be able to have the smoke fire intermittantly. Kind of like leaving a row of dashes in the sky rather than one line. Hit the switch once then it fires on and off, then hit the switch again and it shuts off completely. Could any of you scripting guru's help out w/this?
531_Ghost
29-12-2004, 08:45 PM
ruggbutt, is there a need to script it? Couldn't you just select whatever button you want to turn on the smoke and in the release of that same button the smoke turn off? I use this feature for view commands like, padlock, release, forward cockpit view. I do the same with speed brakes also so I don't forget to retract them :blush: Of corse that would mean you'd have to press, release, press, release, however many dashes you want or need in the sky. Simple I know, but I'm a simple kinda guy. :)
MichaelCHProd
29-12-2004, 09:46 PM
I have not tested this but it should work.....
SCRIPT
// Wingtip Smoke On and Off
TOGGLE( D2 ) = JS1.B3;
CMS.B1 = D2;
// Flash Wingtip Smoke
SEQUENCE
WHILE(CMS.B1);
CMS.B2 = TRUE;
DELAY( 2 );
CMS.B2 = FALSE;
DELAY( 2 );
CMS.B2 = TRUE;
DELAY( 2 );
CMS.B2 = FALSE;
ENDSEQUENCE
ENDSCRIPT[/b]
I set CMS.B2 to the command for "Toggle Wingtip Smoke"
ruggbutt
30-12-2004, 10:01 PM
I'm still learning w/all of this, but I have one question and it's probably quite the dumb one. I don't understand the first part of the script regarding the (D2) and the CMS.B1 = D2;
The rest makes sense to me.
Bob Church
31-12-2004, 01:11 AM
>> I'm still learning w/all of this, but I have one question and it's probably quite the dumb one. I don't understand the first part of the script regarding the (D2) and the CMS.B1 = D2; <<
It's just the "output" for the device. When you define a TOGGLE device like:
TOGGLE( D2 ) = JS1.B3
then D2 is the bit that actually toggles when the program is run so that you have something to reference in:
CMS.B1 = D2
Also, there is a bit simpler way to do what you're trying to do with the INTERVAL timer:
script
toggle( d2 ) = js1.b3;
timer( INTERVAL, d3, 2, 2 ) = d2;
cms.b2 = d3;
endScript
The INTERVAL timer just cycles off and on so long as it's input is TRUE so it does pretty much just what you want. You can adjust the on and off times with the two "2" values, one of them controls each period.
- Bob
The StickWorks
http://www.stickworks.com
ruggbutt
31-12-2004, 01:26 AM
Thanks, I'll give that a try. I appreciate you taking the time out to help me. :D
ruggbutt
02-01-2005, 02:50 AM
I'm still not getting it. To make sure I don't have a conflict w/my current LOMAC map, I'm using a clean map w/just this script (the second one). I have Joystick Button 3 mapped DirectX mode, CM Device 1, Button 3. Then I have CMS button 2 w/DirectX mode off, and mapped to the "t" key. Is that correct? All I'm getting is just standard smoke, no interval.
Bob Church
02-01-2005, 04:33 AM
>> I'm still not getting it. To make sure I don't have a conflict w/my current LOMAC map, I'm using a clean map w/just this script (the second one). I have Joystick Button 3 mapped DirectX mode, CM Device 1, Button 3. Then I have CMS button 2 w/DirectX mode off, and mapped to the "t" key. Is that correct? All I'm getting is just standard smoke, no interval. <<
Well, normally you'd just map Joystick Button 3 to "None" and "None", otherwise the sim is still going to see it. I don't know if that would interfere or not. Also, I had the impression that you were using a DX button to trigger the smoke, not a character. It should still work, though. The "2" values are probably way to small, that's only about 1/10th of a second, so you might need to adjust those out a bit.
You can check and see if it's cycling. Switch CMS.B2 back to DirectX mode temporarily and assign it to CM Device 1, Button 32 or some other unused button. Download that, then open the calibration screen. You should see selections for however many CM Devices your map creates. Pick CM Device 1 and watch the test screen while you hold the JS1.B3 down. The button you assigned should flash off and on. It will tell you if the logic is right and give you and idea of the relative off and on times. I usually tune things that way even if I'm ultimately going to send characters, that way I can see it happen and things like the system autorepeat, etc. don't muddy things up.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Bob Church
02-01-2005, 04:41 AM
One other note. If you're using characters, you should probably enter "t NULL" rather than "t". Without the NULL, the key autorepeats. Depending on your frame rate and your system autorepeat rate, it may be generating more than 1 "t" which can be a problem with toggle keys. When there are separate Off and On keys it's not a problem, but if a toggle autorepeats it just keeps turning things off and on continuously and it ends up in the state it was in at release.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
ruggbutt
02-01-2005, 10:22 AM
Thanks again. I have a better grasp now and I have it working. Now I have to work it into my joystick profile...........lol. Thanks again. :cheers:
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.