PDA

View Full Version : Axis Assignment Problems



TargetDrone
12th July 2005, 09:02 AM
Hi all. N00b to the forums here so sorry if this topic has already been covered. I could not find it with search. Here's my prob....

Related Game: Mechwarrior4 Mercs

I recently replaced my gameport CH VP Pro and CH Pedals with a FS Pro and CH Pro Pedals (both usb). Since switching over I can not seem to get the "Toe Brake" pedals to function as "Rudder." On my gameport version I used Toe Brake Left to turn the mech left and Toe Brake right to turn the mech right. NOTE: Turning a mech is from the waist down unlike Torso Twisitng which is from the waist up (x and y axis for torso twist).

I can get the Mech to turn if I use the pedal's Rudder function to do so BUT I've been meching with Toe Brake turning for many many years. It sure would be nice to continue that, if possible.

Problem comes in when I assign Rudder function Axis (default) to the two independant Toe Brake Pedals. Since the left and the right share the same axis I get a conflict and can not download the map. I would like to disable the slide rudders and chock them for this game and strictly use toe brakes for turning.

PS> This game only recognizes one JS + mouse and 4 axis, 32 buttons. I have what works set and saved as such.. Not relevant (i don't think) to my problem but the game allows me to use both the JS and mouse for torso movement, left, right, up, down (x,y axis). In-game I use the inverted Y axis option. Throttle is on the Z axis and has in-game option for one way throttle, which I use.

Does or can the two toe brakes be combined into one axis or would it need to be one axis divided by 0-255, half per pedal? Better yet, can the toe brakes be used as rudders at all? I probably have overkill for info here but I figured better to have it and not need it than to........ Any help would be greatly appreciated.

-TD

Bob Church
12th July 2005, 09:24 AM
Hi TargetDrone,

Sure. Probably the Rudder axis is assigned to CM Device 1, R Axis right now. You need to clear that assignment so it's "None" and "None" on the right side of the screen. Next, add the CMS Controls to your map. Click the "Add" button on the CM toolbar, it's in the list along with the yokes, sticks, etc. Select the CMS Controls tab and assign CMS Axis 1 to CM Device 1, Axis R (or whichever one you cleared from the pedals). It's the one that's going to replace the R axis going to MW4.

Next, you need to create a CMS script to generate 1 axis from the two toe brake axies. The toe brakes are the X and Y axes on the pedals. I'll assume that you added the stick first, pedals second when you created the map so the pedals are on the second tab and the script will see them as JS2. They produce raw values of 0 when release and 255 when pressed (more or less, calibration will fix up any discrepancy). Anyway, you need the rudder axis to go from 0 at full left to 128 at center and to 255 at full right. The basic trick is to start with the center value, then add half the value of one pedal and subtract half the value of the other. That will put the pedals in the center when both brakes are released, and then each pedal moves it one way or the other. The script is simpler than the explanation. :)


script
Â*cms.a1 = ( 128 - ( js2.a1 / 2 ) + ( js2.a2 / 2 ));
endScript

The js2.a1 reference is to the left brake (X Axis) so taking half of that and subtracting from 128 will get it to 0. The js2.a2 reference is to the right pedal (Y Axis), adding half will take it to 255. Easy deal.

One thing about MW4. If the stick actually shows 32 buttons, the game will crash. It really only seems to recognize 12 or 14 anyway i think. You can have more than that, you just can't use them directly. They need to use characters. If you actually set it up so it's showing 32 buttons in the test screen when the map is active, though, you'll probably crash MW4 as soon as it starts with a zero allocation length error and the report will tell you you've go zero buttons. Make it 31 buttons and it works fine.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

TargetDrone
12th July 2005, 06:47 PM
W00T!! Worked like a champ. I'm back in the saddle. :yahoo: Thanks a gazillion kind Sir. You may have just saved an old Mechwarrior's life for league drops this week.

I had a bit of the setup correct through research and piddling. My script was wrong. I had to change the TB's in the Pedals tab to none and none, then change the CMS axis from 3 and put it on 1. I'm still more than a little confused about how the scripting works (i'm no coder for sure) but I'm delighted at the level of support on this sight.

I am aware of the 32 button bug. It crashes MW to the desktop, though I've never encountered it personally.

Thanks Again,
-TD

TargetDrone
12th July 2005, 07:49 PM
OOOOPS!!! I got all 'cited a lil too soon. Seems both pedals are working but both are operating as Left Turn. Need Right Pedal to Turn Right. That's the only prob left to solve. All else works great.

-TD


EDIT/UPDATE: I played around with the script a little bit that you gave me. Switched it around some. Maybe just a n00b's dumb luck but IT WORKS!! Here's what I ended up with...

script
cms.a1 = 128 + (js2.a2/2) - (js2.a1/2);
endScript

-TD

Bob Church
12th July 2005, 10:36 PM
Hi TD,

Wierd. It looks like it's basically the same equation. Ah well, whatever works. Glad to here you got it working!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

TargetDrone
12th July 2005, 10:57 PM
Same equation but reversed a bit. Almost like a mirror image of the script. Reversed 128 - to 128 +, reversed JS order, and reversed + to -. For whatever reason that was the only way it would work. No idea why. Just my stubborn ignorance that made me keep trying things.

BTW, the pedals work much smotther, are more accurate, and are more responsive than the my old gameport version. Though they are almost 10 years old and still work! So does the VP Pro. Now if CH would just come up with a Lefty friendly stick and/or throttle...... CH FS Pro is as close as I could get... semi-friendly for lefties except for the throttle wheel placement. I keep smashing my finger between the throttle wheel and the JS hand rest on hard lefts. :rant:

-TD