Advertisement
julioCCs

Untitled

Jan 31st, 2013
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. /* ------------< Pvt. John Doe's Steering Wheel Script >------------
  2. | This is my script for car racing games. It has smooth steering,|
  3. | so you can tilt the controller a little bit or a lot to steer |
  4. | accordingly. Hold the Wii remote with the buttons facing up, |
  5. | as if you were playing Excite Truck. Steering is mapped to the |
  6. | X axis. The Wii remote's buttons are mapped from button 1 to |
  7. | button 11. Set them up however you like in the game. The Y |
  8. | axis is mapped to the tilt of the controller forward and back. |
  9. | This could come in handy for flight sims or shifting. |
  10. -----------------------------------------------------------------
  11.  
  12. !!!! Follow Steps 1 - 3 to get your remote working properly !!!!
  13. Be sure you have PPJoy installed before continuing.
  14.  
  15. ------------(Step 1 - Set up PPJoy Virtual Joystick)------------
  16. | 1. In GlovePIE, go to CP-Settings > PPJoy. |
  17. | 2. Click on Add, then select "Constoller 1". |
  18. | 3. Select "PPJoy Virtual Joystick 1" and click Mapping. |
  19. | 4. Choose "Set a custom mapping..." and click Next. |
  20. | 5. Select 2 Axes and 11 Buttons, then click Next. |
  21. | 6. Click Next again. |
  22. | 7. Set Button1 to "Digital 0", Button2 to "Digital 1", etc., |
  23. | then click next. |
  24. | 8. Click finish. |
  25. ----------------------------------------------------------------
  26.  
  27. ------------(Step 2 - Fill in the following values)-------------
  28. Run this script and user the info that is displayed in the debug
  29. area of GlovePIE. */
  30.  
  31. var.zmin = -24 // 1. Stand remote on IR end. Put the number next to RawZ here.
  32. var.zmax = 28 // 2. Stand remote on expansion port. Put the number next to RawZ here.
  33.  
  34. var.xmin = -31 // 3. Lay remote on right side. Put the number next to RawX here.
  35. var.xmax = 24 // 4. Lay remote on left side. Put the number next to RawX here.
  36.  
  37. /* ---------------------(Step 3 - Center Axes) -----------------------
  38. | 1. In GlovePIE, go to CP-Settings > Joystick. |
  39. | 2. Select "PPJoy Virtual Joystick 1" and click Properties. |
  40. | 3. Lay your remote on a flat surface with the buttons facing up.|
  41. | 4. Change the following values to center the axes. |
  42. ------------------------------------------------------------------- */
  43.  
  44. var.zoffset = 0 // This is shown as the X axis.
  45. var.xoffset = 0 // This is shown as the Y axis.
  46.  
  47. /* Now you're done. All that is left is to configure your game
  48. to your liking. Have fun!
  49.  
  50. Note: This script was originally designed for Need For Speed.
  51. Menus in NFS can be navigated by tilting the controller
  52. forward & back ( for up & down) and left & right. */
  53.  
  54.  
  55. var.z = Wiimote.RawForceZ
  56. var.x = Wiimote.RawForceX
  57.  
  58. Wiimote.Leds = 1 + 8 /* No fancy LED animations here. :) */
  59.  
  60. var.z = var.z + var.zoffset
  61. var.x = var.x + var.xoffset
  62.  
  63. ppjoy.analog0 = MapRange(var.z, var.zmin, var.zmax, -1, 1)
  64. ppjoy.analog1 = MapRange(var.x, var.xmin, var.xmax, -1, 1)
  65.  
  66. ppjoy.digital0 = Wiimote.A
  67. ppjoy.digital1 = Wiimote.B
  68. ppjoy.digital2 = Wiimote.Home
  69. ppjoy.digital3 = Wiimote.Plus
  70. ppjoy.digital4 = Wiimote.Minus
  71. ppjoy.digital5 = Wiimote.Up
  72. ppjoy.digital6 = Wiimote.Down
  73. ppjoy.digital7 = Wiimote.Left
  74. ppjoy.digital8 = Wiimote.Right
  75. ppjoy.digital9 = Wiimote.One
  76. ppjoy.digital10 = Wiimote.Two
  77.  
  78. debug = 'RawX: ' + Wiimote.RawForceX + ' RawZ: ' + Wiimote.RawForceZ
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement