WiiMote script for racing games using vjoy

Official forum for open source FreePIE discussion and development.
Post Reply
TheDeadeye
One Eyed Hopeful
Posts: 2
Joined: Sat Jun 02, 2018 1:24 pm

WiiMote script for racing games using vjoy

Post by TheDeadeye »

does anyone have a script to use the wiimote as a steering wheel using vjoy would appreciate.

Jabberwock
Cross Eyed!
Posts: 160
Joined: Mon Mar 02, 2015 3:58 pm

Re: WiiMote script for racing games using vjoy

Post 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...

Post Reply

Return to “FreePIE”