[Tutorial] How to use TrackIR/FreeTrack/FaceTrackNoIR with YSFlight.

YSFlight general discussion & everything in between
Post Reply
User avatar
windows_x_seven
Newbie
Newbie
Posts: 4
Joined: Wed Jul 27, 2016 12:38 am
Favorite Aircraft: SU-27/MiG-29
Location: Low Earth Orbit
OS: Windows 7 x64
Been thanked: 11 times
Contact:

[Tutorial] How to use TrackIR/FreeTrack/FaceTrackNoIR with YSFlight.

Post by windows_x_seven »

So, uh, yeah.

I've built a FreeTrack cap for use in other flight simulators, and tried to make it work with YSFlight.

There were no tutorials online for use with head tracking devices in this game, so I went ahead and "figured it out".

So! If you happen to have TrackIR or other head tracking mechanisms and didn't know how to use them in YSFlight, here you go:

*By the way, 6DOF won't work. You'll only have "2D" look, and won't be able to translate your head in the cockpit.

-Required software:
.Your head tracking software of choice, already configured.
.vJoy
.FreePIE

-How to set things up:

Install vJoy, then open the "Configure vJoy" app. Make sure that the "Enable vJoy" box is checked. Don't touch anything else.

Now, open up FreePIE. Click on "File" on the program's top left corner, then select "New". Then, on the white box, paste this in:

Code: Select all

def update():
	yaw = filters.mapRange(trackIR.yaw, -90, 90, -vJoy[0].axisMax, vJoy[0].axisMax)
	pitch = filters.mapRange(trackIR.pitch, -90, 90, -vJoy[0].axisMax, vJoy[0].axisMax)
	vJoy[0].x = yaw
	vJoy[0].y = pitch

if starting:
	trackIR.update += update
After doing that, go back and click on "File", then "Save As", so that you don't need to paste the code in every time. Then, click on "Script" (it's near "File") and then "Run". Leave the FreePIE window OPEN.

Next thing you want to do is to check if FreePIE is working. Open up the "Monitor vJoy" app and move your head. You should see the "X" and "Y" bars on the top right moving accordingly.

If everything's working correctly, go ahead and launch YSFlight. Click on "Options" and then "Joystick/Key Assignments" so that you can assign the vJoy joystick (aka your tracking device) to "X-Axis Point of View (+- 90 deg)" and "Y-Axis Point of View".

If you're not using any joysticks other than your tracking device, set them to "JOY1 AXIS 1" and "JOY1 AXIS 2 REVERSE", respectively.

Go ahead, create a quick flight and move your head around. Your head tracking should work.

-Troubleshooting

.If the axis are incorrect, try messing around in the "Joystick/Key Assignments" thing. Maybe my configs don't work with yours.

.Need any help? Make sure to reply to this thread and I'll help you as soon as I can.


So yeah, there's that. Hope to have helped you guys.

Peace.
Image
User avatar
HawkbitAlpha
2nd United Combat Wing
2nd United Combat Wing
Posts: 961
Joined: Thu Jun 23, 2011 6:08 am
Favorite Aircraft: Tristar, F-5 family
Location: Jackson, MS
OS: Win10 Pro
Has thanked: 227 times
Been thanked: 275 times
Contact:

Re: [Tutorial] How to use TrackIR/FreeTrack/FaceTrackNoIR with YSFlight.

Post by HawkbitAlpha »

Since it looks no one has reported this issue, I'm bumping this thread to share a warning:

VJOY WILL LIKELY CAUSE PROBLEMS WITH OTHER CONTROLLER INPUTS ON YOUR SYSTEM. I tried this YS setup with OpenTrack last week, and it requiring vJoy resulted in it completely breaking XInput (the Windows input protocol for Xbox controllers) across my whole PC. It also caused my Xbox controller to map in bizarre ways, like the right stick being locked into only left-right movements.

I would definitely not recommend using this setup if you regularly use non-flightsim controllers, especially those which tap into XInput. This interference seems to be a known problem with vJoy.
Image
Image

Owner, Narrator, Pilot @ VCAP Aerobatics | 2021-Present
"Wedge", CO @ 2nd United Combat Wing | 2020-Present
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests