PDA

View Full Version : Fighterstick Axis and Mode Toggling with CMS



TheCrimsonCrusader
12th January 2004, 05:59 AM
First of all, many thanks to Rev for creating this site! This will be a tremendous resources to the CH community. I am inquiring about whether there is a way to change the Fighterstick x/y axis to go to the x/y mouse axis within CMS, but in a particular way.

Right now, I can have Mode 1 as an example be assigned to the DirectX x/y access for the stick and then have Mode 2 be assigned to the DirectX mouse axis. This allows me to pan the view in the cockpit for sims that support such a function via the mouse. It's just a more natural control to look around the cockpit in this way versus the mouse stick on the CH Pro Throttle. The problem is, when I switch to Mode 2, I will obviously not have control of the aircraft during that time. So, here's the question...

Is there a way in the CMS to have Mode 1, 2 and 3 all utilizing the Fighterstick's x/y stick access, but have all of the modes temporary be on the DirectX mouse axis just when I have a button pressed like button four for example? Then when I release it, the stick would then go back to the x/y access of controlling the aircraft.

I hope this makes sense. :)


Thanks.

Bob Church
12th January 2004, 08:58 AM
>> I hope this makes sense. <<

I think so, but I may have missed something. It looks like what you want to do is this. First unassign the Mouse axes from wherever they are. Add the CMS Controls to the map. Assign the CM Device 1 X and Y to CMS Axis 1 and Axis 2. Assign Mouse X and Y to CMS Axis 3 and Axis 4. Now, open the CMS editor and add the following little script. I&#39;m assuming you mean button 4 on the stick and not the throttle, if I&#39;m wrong you&#39;ll need to make the appropriate change.

Anyway, something like:

script
if( js1.b4) then // if the button is pressed
cms.a3 = js1.a1; // Send the joystick X and Y values to the Mouse X and Y
cms.a4 = js1.a2;
else
cms.a1 = js1.a1; // Send the stick X and Y to the CM Device X and Y
cms.a2 = js1.a2;
cms.a3 = 128; // Stop the mouse
cms.a4 = 128;
endIf
endScript

This is a little experimental, really. I didn&#39;t set the joystick to center by setting cms.a1 and cms.a2 to 128 when the button is clicked. What I think should happen there is that cms.a1 and cms.a2 will just hang on to your last js1.a1 and js1.a2 values while you run the mouse and so hold your stick where it was when you pulled on js1.b4. Expect a bit of a bounce when you let go of js1.b4 and the aircraft control drops back to the stick again.

Anyway, give it a try and see how it goes.

- Bob

The StickWorks
http://www.stickworks.com

MichaelCHProd
21st January 2004, 04:52 AM
Works like a champ here at home on my rig Bob. If you can&#39;t get over loosing control of the plane for a moment you can always assign the POV hat to the mouse. Here is a cool script Bob helped me with while were testing CM 3...


// Move the POV off center and change the mouse to absolute
IF( JS1.B25 OR JS1.B26 OR JS1.B27 OR JS1.B28 OR JS1.B29 OR JS1.B30 OR JS1.B31 OR JS1.B32 ) THEN
XRELATIVE = FALSE; //Makes the mouse X axis absolute
YRELATIVE = FALSE; //Makes the mouse Y axis absolute
ELSE
cms.a1 = 128; //Makes the mouse X axis stop
cms.a2 = 128; //Makes the mouse Y axis stop
ENDIF

//If the mouse is absolute then the POV will move it.
IF( NOT XRELATIVE ) THEN
IF( js1.b32 or js1.b25 or js1.b26 ) THEN
cms.a2 = 72;
ENDIF
IF( js1.b26 or js1.b27 or js1.b28 ) THEN
cms.a1 = 184;
ENDIF
IF( js1.b28 or js1.b29 or js1.b30 ) THEN
cms.a2 = 184;
ENDIF
IF( js1.b30 or js1.b31 or js1.b32 ) THEN
cms.a1 = 72;
ENDIF
ENDIF