View Full Version : Shift function disabled on CMS controled button?
Fever
10th February 2004, 04:17 AM
I can't seem to get the "Shifted" function of by throttle hat buttons to work when i reference the hat buttons in a CMS script. Is the shift function disabled when you are running a script that references the button?
Here is a portion of the script im running:
// Control the Flaps
SEQUENCE
// First Command Operates on the first press of Joystick 2 Button 8
WAIT( JS2.B8 );
CMS.B2 = TRUE;
DELAY( 2 );
CMS.B2 = FALSE;
DELAY( 2 );
// Second Command Operates on the second press of Joystick 2 Button 8
WAIT( JS2.B8 );
CMS.B3 = TRUE;
DELAY( 2 );
CMS.B3 = FALSE;
DELAY( 2 );
ENDSEQUENCE
The shift function doesnt work for JS2.B8 now. Am i doing something stupid???
Thanks for the help.
Fever
Bob Church
10th February 2004, 10:59 AM
Fever,
I'm not really sure I understand what you're saying. I think you mean that:
1. JS2.B8 is tagged as the Shift Button in the GUI.
2. You have the hat set to DX Mode or Character Mode (not POV mode in any case).
3. That you have things programmed to the hat for both normal and shifted operation.
4. That the shifted side doesn't work when JS2.B8 is pressed. Is the hat completely dead or does it just play back the unshifted side?
In any case, I'd need to see the actual files. There are a lot of things that might be wrong and without the files I can't see all the possibilities. Can you attach the .MAP, .CMS, and .CMC files that you're using?
- Bob
The StickWorks
http://www.stickworks.com
Fever
10th February 2004, 01:45 PM
Bob,
I'll explain my problem in a little more detail. I use JS2.B6 and B8 (Pro Throttle) in macro mode but have no characters in the regular unshifted box. In the shifted box for those 2 buttons i have macros. I can't get those shifted macros to work after i enabled a script that sent commands when JS2.B6 or B8 were pressed. The shift button is on my Combatstick B6 i believe. I'll try to attach my files. Thanks for the help.
Fever
Fever
10th February 2004, 01:46 PM
map file
Fever
10th February 2004, 01:47 PM
CMS file
MichaelCHProd
10th February 2004, 05:36 PM
Can you get those shifted functions to work when you don't have any scripting in place?
Fever
10th February 2004, 06:22 PM
Yes, they worked fine before i started messing with the scripts. The whole reason for me to assign 2 functions to the unshifted button (using scripts) was to have 3 possible outputs on the same button in the same mode. 2 from the script (which drive CMS.B2 and B3) and one from the shift button on the combatstick which activates the shifted function on the throttle hat switch. Thanks for your quick replyies, im sure we'll figure this out soon :).
Fever
10th February 2004, 07:03 PM
Figured out the problem. You need the NULL character in the regular character box to get the "shifted" characater to work (not just a blank space). I also add "AND NOT JS1.B6" to all the WAIT statements so that they would not execute when my SHIFT button was pressed. Thanks for the help anyway :). Hopefully someone else will learn from this. By the way, great forum.
Fever
MichaelCHProd
10th February 2004, 08:19 PM
Right on. Sorry I missed that. :cheers:
Bob Church
10th February 2004, 10:50 PM
>> Figured out the problem. You need the NULL character in the regular character box to get the "shifted" characater to work (not just a blank space). I also add "AND NOT JS1.B6" to all the WAIT statements so that they would not execute when my SHIFT button was pressed. Thanks for the help anyway . Hopefully someone else will learn from this. By the way, great forum. <<
Yeah, that will do it. You have to have an unshifted entry if you have a shifted entry. You also have to have a Mode 1 entry before you can use the other modes since Mode 1 will set the default for the other modes if they're not filled in explicitly. If you don't want Mode 1 to do anything, the trick is the same - put in the NULL as a placeholder.
Anyway, I'm glad to hear it's up and running for you. Have fun with it!
- Bob
The StickWorks
http://www.stickworks.com
hooktin
13th February 2004, 04:55 AM
Hi, braintrusts!
i am among the great unwashed of us who love the CH stuff but, for numerous reasons, can not develop these things such as the algebraic scripting...for example: take a game we all know, show exactly how keyboard and axis commands for a given game are plugged in to these various scripts. maybe show how you set it up, then apply the same scripts to two different games. I would consider a real boon. algebra to simpler stuff.
thanks in advance. you guys are at the top of the CH foodchain.
mark davis
hooktin
13th February 2004, 04:59 AM
Okay, i am not going to consider touching anything else tonite that could be an intoxicant...the thought that i wanted to convey but left out...is that you guys could show the rest of us how to plug the stuff in....
MichaelCHProd
13th February 2004, 05:19 AM
If you are just looking to plug in a command from the game the CMC files here at the Hangar are the way to go. Scripting is just if you find something that you wish the game did but doesn't...or least not with out a fight. :D Or more often if you just can't bear to push a button for each action and you would like the controllers to do some of the work.
Tell you what, you name the game and what you want done and I will get you there. :thumbsup:
hooktin
13th February 2004, 11:22 PM
Thanks, michael....let's see......
okay, say, in EAW, i want to sequence through various target options using one button on my combatstick...say, button #2
the button = 2
commands: target next enemy=t
target closest enemy=ctl t
target next ground object=e
target closest ground object=ctl e
how would this look as i press #2 each time, with a sequential set of script commands, with the proper key commands plugged into the script?
another one:
button #3 assigned command=zoom in=kp+ (in EAW)
when i hit button #3, the kp+ zooms in but because of the closer perspective, i want to change the sensitivity of the joystick so small motions don't cause big changes in the zoomed in view....
-button =#3
-key command=kp+
-kp+ is sent and starts a script that changes axis values to less sensitive
-F1 is later sent which reverts to front view without zoom (normal) and axis values return to normal (pick some stock values for illustration, and some others for less change in stick motion when zoomed in )
thanks, mike, i am sure this will be very instructive...
mark davis
Bob Church
14th February 2004, 12:33 AM
I posted an article that shows one method for doing the sequential command thing that you describe in the first part. Drop by my site and look for CMNOTE01.ZIP on my "Files" page, it's got a WordPad .DOC file in it that explains.
For the second part, you'd need to put together a script something like this:
script
sequence
wait( js1.b3 ); // Wait for the button click
scale( js1.a1, 100, 5, GAIN3 ); // Set a flatter response on the X axis
scale( js1.a2, 100, 5, GAIN3 ); // Set a flatter response on the Y axis
cms.b1 = TRUE; // Turn on the CMS button to zoom in
delay( 1 ); // Give it time to be seen
cms.b1 = FALSE; // Release the CMS button that zoomed in
wait( js1.b3 ); // Wait for the second button click
scale( js1.a1, 100, 5, GAIN6 ); // Set normal response on the X axis
scale( js1.a1, 100, 5, GAIN6 ); // Set normal response on the Y axis
cms.b2 = TRUE; // Turn off the CMS button to restore the zoom
delay( 1 ); // Give it time to be seen
cms.b2 = FALSE; // Release the CMS button that restored the zoom
endSequence
endScript
In the GUI you would need to set the CMS Controls Button 1 to send "Zoom In" and Button 2 to send "Zoom Out". Basically, the sequence just waits for you to push button 3. Then it sets the gain to something that's flatter in the center. You could also use the Sensitivity setting in the SCALE statement and just reduce the output, too. After it sets the scaling, it turns CMS Button 1 on, waits a scan to let it get seen by the sim, then turns the button off. Up in the GUI, that would be programmed to send the ZoomIn command.
Once that's done, the script stops and waits for you to click the button again. Then it basically "undoes" everything. It sets the SCALE back to linear for X and Y, then toggles CMS Button 2 on and off to send the ZoomOut command.
The attached Zip has the above CMS file as well as the MAP to implement it on a FighterStick and a CMC file for the ZoomIn (KP+) and ZoomOut (F1) keys.
- Bob
The StickWorks
http://www.stickworks.com
MichaelCHProd
14th February 2004, 01:04 AM
Way to go Bob! B)
You are all over this guy. :thumbsup:
Powered by vBulletin™ Version 4.0.2 Copyright © 2010 vBulletin Solutions, Inc. All rights reserved.