Page 1 of 1

WiiMote script for racing games using vjoy

Posted: Sat Jun 02, 2018 1:26 pm
by TheDeadeye
does anyone have a script to use the wiimote as a steering wheel using vjoy would appreciate.

Re: WiiMote script for racing games using vjoy

Posted: Mon Jun 04, 2018 1:12 am
by Jabberwock
Assuming you hold the wiimote vertically like this:

Image

you can start with:

Code: Select all

vJoy[0].x = filters.ensureMapRange((wiimote[0].acceleration.y-9.81), 12, -12, -16384, 16384)
9.81 is the assumed Earth's acceleration, but the actual vector depends on your geographical location (I think?), so for me it was about 8.5. Measure it by placing Wiimote on its side on a horizontal surface. Also, the range 12, -12 is what I found convenient for the 'wheel' movement - going up to 15 gives you a better range, but less convenient hold and the other way round. Finally, you should experiment with smoothing (filters.simple), as the readings are somewhat jerky.

Unfortunately, there is no other analog control on Wii, which makes acceleration and braking rather rough in racing sims. You could try to experiment with:

Code: Select all

vJoy[0].y = filters.ensureMapRange((wiimote[0].acceleration.z-9.81), 12, -12, -16384, 16384)
but I do not find it practical - you have to move the Wiimote in two planes at same time, which is somewhat tricky. Maybe with practice...