Jump to content

Advanced (script level) configuration of input


Sigmoid

Recommended Posts

Hi all,

 

I have been using FlightGear for my flightsim needs so far, which is fine in its own right, but I'm thinking of buying X-Plane 10, partly because it seems totally awesome, and partly because I want to support Laminar Research. :) (I already did donate some money to the Uniloc defense. Being a software engineer, I have a soft spot for people creating great stuff.)

 

Anyway, before I buy, I'd like to make sure that this sim is right for me. :) One thing is, the only joystick-like input peripheral I own is an XBox 360 controller, and that isn't likely to change unless/until I start training for a real pilot's licence. :) Now the XBox controller is great in its own right, but definitely not something designed for flight sims.

 

In FlightGear, I was able to circumvent most of its shortcomings though, and I wonder if X-Plane also offers me a point of extensibility where I can modify/define joystick input in a script language.

 

What I need to do is:

  • Transform analog stick axes into a paraboloid shape (effective value := sgn(input) * input^2)
  • Merge the two analog triggers into a single rudder axis (rudder := (rightTrigger - leftTrigger)/2)
  • Generally be able to implement quickly whatever insanity or hack I come up with. :)
Edited by Sigmoid
Link to comment
Share on other sites

The first thing I'd recommend is that you download the demo and see whether you can get it to work the way you want it to before forking out.  The demo is fully functional, just with the scenery restricted to a tiny paddling pool, and a 10 minute time limit on flights.  Perfect for this kind of experimentation, though.

 

The keyboard/joystick set-up will let you do quite a lot.  You can adjust the main joystick inputs to give a "non-linear" response in the sim.  I attach a screenshot showing this.  Whether it's enough for you, you'll have to try it and see:

 

post-3879-0-54003000-1364988010_thumb.jp

 

Another screen gives you a panel of tick boxes.  Push the triggers or switches on your joystick to see which ones they map to, then give them a function.  You can either do this using the list on the RHS (as shown in the screenshot) or if you know the command path, enter that in the text box.

 

post-3879-0-31890400-1364988155_thumb.jp

 

If neither of these are sufficient, you might need to write your own extension to the simulator.  As a software engineer, it would be right up your street anyway.  You could create your own custom Datarefs (X-Plane's term for the public-access pointers to its internal variables)  to receive the joystick inputs, then apply the appropriate maths before passing them to the actual control inputs.  You could also create your own commands that way for use with joystick buttons (and you would enter your custom command path in the text box shown in the screenshot).

 

The first two might well provide what you need anyway.  If you want to know how customisable X-Plane really is, and  you are proficient and fluent in C, I suggest you read the documentation for the Plugin SDK here:

 

http://www.xsquawkbox.net/xpsdk/mediawiki/Main_Page

 

Guy.

Edited by guym-p
Link to comment
Share on other sites

Thanks, I read up on the plugins, and it seems that I can assign values to primary flight controls from a plugin.

 

The triggers on the XBox 360 aren't "clicky" buttons, they are axes. (Like pedals for your fingers.) One axis is the right one, another is the left one. I guess I could read them from a plugin, and adjust the yaw of the aircraft.

There is one thing I'm interested in though. According to the X-Plane documentation, if I don't assign a yaw axis, it will be auto-stabilized. Now to control yaw from a plugin, I need to leave it unassigned in the joystick setup dialog. Won't there be a "conflict"? Or does the plugin need to turn off auto-stabilization somehow? I didn't find much about this.

Link to comment
Share on other sites

I don't know anything about the XBox 360 controller, but X-Plane's joystick preferences can not merge two channels into one dataref.  You would need to write a plugin for that.  You'd also have to decide how the plugin should interpret when both triggers are partially depressed.

Edited by guym-p
Link to comment
Share on other sites

You'd also have to decide how the plugin should interpret when both triggers are partially depressed.

 

That's trivial, you want to subtract one from the other.

 

Anyway, I figured that it might need a plugin, that's why I asked about disabling the "auto-rudder" function from a plugin.

As an alternative, maybe I can do the merging at an OS level via an app I found (Controllermate) though.

Link to comment
Share on other sites

I've just carried out an experiment using DataRef Editor (part of the SDK) and observed the following:

  1. If you use a mouse as a joystick, clicking on the cross to enable it changes the dataref "sim/joystick/mouse_is_joystick" to 1 and the rudder moves in sync with roll input.
  2. If you do not enable the mouse as joystick, but simply enter a value of 1 for dataref "sim/joystick/yoke_roll_ratio", the ailerons move to their fullest extent but the rudder does not move.  The rudder can be moved independently using "sim/joystick/yoke_heading_ratio".

I don't know if you've followed my recommendation to try the demo yet, but it looks like your next step would be to download that and Dataref Editor and satisfy yourself that you could take control of the rudder yourself, which would get you closer to a decision about whether to invest in X-Plane.  It looks encouraging to me.

 

Guy.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...