View Single Post
Old 02-27-2007, 09:49 AM   #8
andykars
Lurker
 
Join Date: Feb 2007
Posts: 1
Mouse can work with TIE95!

Quote:
Originally Posted by Keyan Farlander
I don't think it supports the mouse. You must have a joystick or gamepad.
It doesn't natively support the mouse, but you can make it behave almost the same! I have written some PIE code which works with TIE95. This uses the PPJOY driver for joystick emulation, and will allow you to use your mouse for in-flight navigation in TIE Fighter. It also enables the arrow keys on the keyboard for fast turning.

Download PPJOY at

http://www.simtel.net/product.downlo...s.php?id=75176

This requires some configuration. Follow the author's instructions to set up a virtual gamepad.

Next, download PIE (Programmable Input Emulator) from

http://geocities.com/carl_a_kenner/pie.html

Create a new script and paste in the following code:

//Code starts here
var.OldMouseX = MapRange(mouse.DirectInputX, 0,1023, -1,1)
var.OldMouseY = MapRange(mouse.DirectInputY, 0,767, -1,1)

wait 10 ms
ppjoy.Analog0 = 8*(MapRange(mouse.DirectInputX, 0,1023, -1,1) - var.OldMouseX)
ppjoy.Analog1 = 5*(MapRange(mouse.DirectInputY, 0,767, -1,1) - var.OldMouseY)

//Allow keyboard arrows to override the mouse
if key.Down then
ppjoy.Analog1 = 1

end if

if key.Up then
ppjoy.Analog1 = -1
end if

if key.Left then
ppjoy.Analog0 = -1
end if

if key.Right then
ppjoy.Analog0 = 1
end if

var.Analog0 = ppjoy.Analog0
var.Analog1 = ppjoy.Analog1

//ppjoy.analog2= mouse.ScreenFraction
ppjoy.digital0 = mouse.LeftButton
ppjoy.digital1 = mouse.RightButton
ppjoy.digital2 = mouse.MiddleButton
ppjoy.digital3 = mouse.XButton1
ppjoy.digital4 = mouse.XButton2
//Code ends here
andykars is offline   you may: quote & reply,