PDA

View Full Version : Mouse does not like script again



Windturbin
1st September 2008, 11:17 PM
Hi Bob, or anyone who can help.....

I use to have some of my fighter stick buttons scripted to do some zoom out exterior views for IL2.

I recently changed them over to my throttle buttons. By doing so, I lose control of my mouse when downloading my map. It takes off to the upper left hand corner.

I had the same problem at first when I was using my fighter stick, but was able to get it to work after re-calibrating and adjusting the mouse sensitivity. Not this time, can't seem to figure it out.

JS1 = Device 1 = my pedals
JS2 = Device 2 = my throttle

My script.......


// IL_2 1946 CMS Script File

SCRIPT
// Peusdo/Revvins IL2 pedal toe brake script
IF ([JS1.A1 > JS1.A2]) then // left pedal is applied (greater than right pedal?)
CMS.A3 = JS1.A1; // CM device 2 R axis = toe brake a1
ELSE
CMS.A3 = JS1.A2; // CM device 2 U axis = toe brake a2
ENDIF

SEQUENCE // IL2 Map and mouse pointer script
WAIT( JS2.B1 ); // Wait for button 1 to be pressed on the Pro Throttle
DELAY( 3 ); // Wait approx an eighth of a second
SCREENX=900; // Move cursor to map pop up window
SCREENY=200;
DELAY( 3 ); // Wait approx an eighth of a second
CMS.B2 = TRUE; // Left Mouse Button is held down
WAIT( JS2.B1 ); // Wait for button 1 to be pressed again on the Pro Throttle
DELAY( 3 ); // Wait approx an eighth of a second
CMS.B2 = FALSE; // Left Mouse button is released
ENDSEQUENCE

sequence // External view and zoom out script
wait( js2.b3 ); // Wait for Button 3
b1 = TRUE; // Flag the fact that the sequence has started
cms.b5 = TRUE; // Turn on CMS Button 5, which is prograned as keystrock F2 exterior view
delay( 1 ); // Give it time for the F2
cms.b5 = FALSE; // Turn off CMS Button 5 so doesn't repeat
cms.b2 = TRUE; // Turn on the mouse button
cms.a1 = 128; // Set CMS Axis 1 to 128 (will center the X)
cms.a2 = 85; // Set CMS Axis 2 to move the mouse "Up"
delay( 10 ); // Let it move
cms.b2 = FALSE; // Turn off the mouse button
b1 = FALSE; // CLEAR THE "IN-SEQUENCE FLAG
endSequence

if( NOT b1 ) then // If it's not in the sequence, use the microstick
cms.a1 = js1.a1; // Force CMS Axes 1 and 2 to use the
cms.a2 = js1.a2; // ministick when not running the sequence.
endif

sequence //Chase view and zoom out script
wait( js2.b4 ); // Wait for Button 4
b1 = TRUE; // Flag the fact that the sequence has started
cms.b4 = TRUE; // Turn on CMS Button 4, sends F8
delay( 3 ); // Give it time for the F8
cms.b4 = FALSE; // Turn off CMS Button 4 so F8 doesn't repeat
cms.b2 = TRUE; // Turn on the mouse button
cms.a1 = 128; // Set CMS Axis 1 to 128 (will center the X)
cms.a2 = 85; // Set CMS Axis 2 to move the mouse "Up"
delay( 10 ); // Let it move
cms.b2 = FALSE; // Turn off the mouse button
b1 = FALSE; // Clear the "in-sequence" flag
endSequence

if( NOT b1 ) then // If it's not in the sequence, use the microstick
cms.a1 = js1.a1; // Force CMS Axes 1 and 2 to use the
cms.a2 = js1.a2; // ministick when not running the sequence.
endif
endScript

The only way my mouse does not go spastic after downloading the map is if i lower my mouse sensitivity down to 15, but then the zoom -scripts do not zoom.

Please help. :confused:

Bob Church
2nd September 2008, 12:16 AM
Hi Windturbin,

The problem is in the last 4 lines of the script I think:


if( not b1 ) then // if it's not in the sequence, use the microstick
cms.a1 = js1.a1; // force cms axes 1 and 2 to use the
cms.a2 = js1.a2; // ministick when not running the sequence.
endif

What you're telling it is that if b1 is FALSE, then to take the values from js1.a1 and js1.a2 and pss them to the mouse axes. They probably switched it back to the ProThrottle Ministick in the original.

Your script has JS1 assigned to the ProPedals, though, so what it really happen is that your switch the mouse axes to the toe brakes and since they're probably release and sending zero, that up and left at full speed.

You need to change those two js1 references to point to the axes that you actually want to use to control the mouse. If you don't want anything controlling the mouse, just set them to 128:


if( not b1 ) then // if it's not in the sequence, stop the mouse
cms.a1 = 128; // Center Mouse X
cms.a2 = 128; // Center Mouse Y
endIf

and that will just stop the mouse in its tracks.

Try that and see if it clears it up for you.

EDIT: I took another look at your post and if js2 is the ProThrottle now and you still want the cursor function to work, then:


if( not b1 ) then // if it's not in the sequence, use the microstick
cms.a1 = js2.a1; // force cms axes 1 and 2 to use the
cms.a2 = js2.a2; // ministick when not running the sequence.
endif

should be what you need.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Windturbin
2nd September 2008, 02:23 AM
Thats it Bob, your the best.

I read that script ten times before posting and could not see it.

Thank you very much.

Bob Church
2nd September 2008, 04:56 AM
Hi Windturbin,

I know. It's hard to find all the references like that. The mouse going up/left was the first clue, it's almost always that something is sending it zeros, so I just started looking for whatever was doing that. Narrowed it down a lot.

For changing axis names like that, probably the best way is to use the editor search and look for "js1." references. Change those to something meaningless like "js1x", then you can change the "js2." references to "js1.", and finally change "js1x" to "js2.". If the editor has a good search and replace facility, you can do the whole thing is a couple of minutes.

Anyway, I'm glad to hear it's working for you again!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Windturbin
2nd September 2008, 08:04 PM
For changing axis names like that, probably the best way is to use the editor search and look for "js1." references. Change those to something meaningless like "js1x", then you can change the "js2." references to "js1.", and finally change "js1x" to "js2.". If the editor has a good search and replace facility, you can do the whole thing is a couple of minutes.

ah ha, that makes sense, is good to know.

stalin12
15th September 2008, 07:51 AM
had the same problem at first when I was using my fighter stick, but was able to get it to work after re-calibrating and adjusting the mouse sensitivity. Not this time, can't seem to figure it out.

Bob Church
15th September 2008, 08:19 AM
Hi Stalin12,

Does it move rapidly or slowly. Slowly usually means you need to calibrate the mouse and maybe increase the deadzone. If it move rapidly, the problem is more likely that it's not assigned correctly. Check the assignments in the Map for the X and Y axes on the ProThrottle. They should be assigned to Mouse and X Axis, and to Mouse and Y Axis respectively.

See if you can find anything there.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com