PDA

View Full Version : HAT Mouse Look with Rudder Control using 1 other button


Chris0381
26-11-2006, 11:35 PM
The following is a script I altered that was provided by other forum members. It allows you to use one of the Hats as a mouse which in turn lets you assign left and right rudder to the hat using mouse control and also lets you use MouseLook on the same hat provided Button 1 is pressed at the same time as looking around.

The execution of Mouselook using Button 1 (my fire button) and Hat is nested in order to be able to fire and pitch up or down at the same time; and this is because when the mouse look command ( L-SHFT in my case) is executed the pitch axis freeze and you end up crashing otherwise. So its important that L-SHFT is only executed when intending to do a mouse look.

Thanks for other members providing the foundation of this script.


// CMS Script File
//
// Game Title: BF1942 MOUSE LOOK - RUDDER
// Altered by Chris P. written by CHPROD Forum Member
// Date: 11-25-06
//
script

IF( JS1.B1 ) THEN //PRESS BUTTOM 1 TRIGGER
CMS.B2 = TRUE; //SENDS FIRE COMMAND "f" ASSIGNED
ELSE
CMS.B2 = FALSE;
ENDIF

IF( JS1.B25 OR JS1.B27 OR JS1.B28 OR JS1.B29 OR JS1.B30 OR JS1.B31 OR JS1.B32 ) THEN
IF( JS1.B1 ) THEN //BUTTON 1 ALSO HAS TO BE PRESSED TO ACTIVATE MOUSE LOOK
CMS.B1 = TRUE; //ACTIVATES "L-SHIFT" (MOUSE LOOK)
ELSE
CMS.B1 = FALSE;
ENDIF
XRELATIVE = FALSE; //Makes the mouse X axis absolute
YRELATIVE = FALSE; //Makes the mouse Y axis absolute
ELSE
CMS.B1 = FALSE;
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

endScript


NOTES:
CMS.B2 = "f" to fire

CMS.B1 = "LSHF" to activate mouse look as I assigned "L-SHIFT" to mouse look in BF1942

CMS.a1 = "Mouse X-AXIS" as assigned in CMS
CMS.a2 = "Mouse Y-AXIS" as assigned in CMS


You will be firing as you are using mouse look.