.
Page 1 of 3 123 LastLast
Results 1 to 15 of 38

Thread: Don't joysticks work on TRS2019?

  1. #1
    Join Date
    Nov 2006
    Location
    United States of America, New Mexico, Rio Rancho
    Posts
    379

    Default Don't joysticks work on TRS2019?

    I have a GoFlight TQ-6 collecting dust on my shelf. It's a simple 6 axis joystick.

    I have it installed and calibrated through Windows.

    I have the "Enable game controller support" option checked on the General tab in the Trainz Launcher.

    TRS2019 doesn't recognize it when I try to assign one of the axis to Cab Throttle.

    Ever since Trainz 04(I think), joysticks have never worked.

    I'm coming from TRS2012 and have never even touched T:ANE so is there something else I need to know?

    Thank you for your time,
    Joe

    Build: 98592 | KUID:151329 | My System

  2. #2
    Join Date
    Nov 2006
    Location
    United States of America, Michagain, Berkley
    Posts
    5,309
    Blog Entries
    6

    Default

    Joysticks have never worked in Trainz, Raildriver dose work and an Xbox controller may work in TRS19, I have not tested if it was put in or not.

  3. #3
    Join Date
    Nov 2006
    Location
    United States of America, New Mexico, Rio Rancho
    Posts
    379

    Default

    Quote Originally Posted by whitepass View Post
    Joysticks have never worked in Trainz
    Wow, after 15+ years and they're still missing this core element. :SMH:
    Thanks for the response

    Build: 98592 | KUID:151329 | My System

  4. #4
    Join Date
    Nov 2006
    Location
    United States of America
    Posts
    74

    Default

    You can do this without official support,

    https://joytokey.net/en/

  5. #5
    Join Date
    Nov 2006
    Location
    United States of America, Massachusetts, Haverhill
    Posts
    24,514

    Default

    Quote Originally Posted by whitepass View Post
    Joysticks have never worked in Trainz, Raildriver dose work and an Xbox controller may work in TRS19, I have not tested if it was put in or not.
    Way, way, way back in the early days of TRS19 long before it had a real product name, we used an X-Box controller to check the interface. It was all proof of concept back then and it worked mostly as intended.

    I'm not sure if this works outside of Driver where we tested, nor do I think a regular Joystick works either.
    John
    Trainz User Since: 12-2003
    Trainz User ID: 124863
    T:ANE Build: 94829
    TRS2019: 98592

  6. #6
    Join Date
    Aug 2014
    Location
    Berlin, Germany
    Posts
    60

    Default

    This unfortunately seems limited to Raildrivers only at the moment so that anyone planning to use an axis controller that is not a raildriver seems required to write some small program that gets the axis, splits it into 9 areas and looks if you moved up or down to press W and Z keys accordingly...
    (if anyone ever writes such a piece of software, sharing it would be nice... I would try so myself but none of the languages I know can grab controller info and virtually press keys)



    Greets, Mika
    Last edited by Laurinlaki; January 11th, 2019 at 02:07 PM.
    German route builder.

  7. #7
    Join Date
    Nov 2006
    Location
    United States of America, New Mexico, Rio Rancho
    Posts
    379

    Default

    Quote Originally Posted by Laurinlaki View Post
    (if anyone ever writes such a piece of software, sharing it would be nice... I would try so myself but none of the languages I know can grab controller info and virtually press keys)
    Hmm... I'm still programming in VB6. I used to play with axis' before. My memory says it worked. I think there's a SendKeys command... I'll let you know.

    Yes, I can read joysticks and send key commands. Scaling the values... kicking my butt.
    Last edited by jcardana; January 11th, 2019 at 03:40 PM.

    Build: 98592 | KUID:151329 | My System

  8. #8
    Join Date
    Nov 2006
    Location
    United States of America
    Posts
    74

    Default

    Can be done still with JoyToKey. Play around with it, and the Stick/POV settings and axis mapping.

  9. #9
    Join Date
    Nov 2006
    Location
    United States of America, New Mexico, Rio Rancho
    Posts
    379

    Default

    Quote Originally Posted by Kilrbe3 View Post
    Can be done still with JoyToKey. Play around with it, and the Stick/POV settings and axis mapping.
    Didn't you tell me that before? As a programmer, what's the fun in that? Yeah, I'll check it out. My wife's missing me.

    I checked it out. It eliminated 2 of my axis' because they are assuming I'm using a normal joystick.
    Last edited by jcardana; January 11th, 2019 at 04:43 PM.

    Build: 98592 | KUID:151329 | My System

  10. #10
    Join Date
    Aug 2014
    Location
    Berlin, Germany
    Posts
    60

    Default

    Quote Originally Posted by jcardana View Post
    Yes, I can read joysticks and send key commands. Scaling the values... kicking my butt.
    Well I assume you will get some percentage number (0 being one end of the axis, 1 being the other) in which case I would try to make an array with the limits of each position that you get by dividing 1 by number of throttle notches + 1 (idle position)

    so in the case of 8 notches + idle = 1 / 9 you would end up with an array like [0.111, 0.222, 0.333, 0.444, 0.555, 0.666, 0.777, 0.888, 0.999] defining the center spots of each throttle position, then subtract the half of 1 / 9 from each array boundary so you get [0.0555, 0.1665, 0.2775 ... 0.9435].
    Now those should be the lower borders of each throttle notch. Now we just scan periodically through that array for the highest number that is still smaller than the current position of the controllers axis, we take its array index + 1 (assuming arrays start at 0 in VB) et voila theres our throttle position.
    Save the throttle position to a variable, now every time compare the current throttle position to the previous one in the variable,
    -> if they are the same the controller was not moved or not far enough, we will just ignore it this time
    -> if the previous throttle position is higher than the current one, we will tap the throttle down button for (previous position - current position) times
    -> if the previous throttle position is lower than the current one, we will tap the throttle up button for (current position - previous position) times

    This is the concept I came up some time ago as I too thought wouldn't this allow us to universally hook up all kinds of controllers to many train sim games, however it remained a concept as I don't know a language that can perform the nessescary actions (getting controller axis, pressing keys) as I already mentioned

    Hopefully this concept gives you an idea.


    Greets, Mika
    German route builder.

  11. #11
    Join Date
    Nov 2006
    Location
    United States of America, New Mexico, Rio Rancho
    Posts
    379

    Default

    Thanks Mika

    It's working!!!

    Build: 98592 | KUID:151329 | My System

  12. #12
    Join Date
    Nov 2006
    Location
    United States of America, New Mexico, Rio Rancho
    Posts
    379

    Default


    Build: 98592 | KUID:151329 | My System

  13. #13
    Join Date
    Nov 2008
    Location
    United Kingdom
    Posts
    14,318

    Default

    Nicely done!
    Malc


  14. #14
    Join Date
    Jun 2017
    Location
    United Kingdom
    Posts
    234

    Default

    Great work.

  15. #15

    Default

    I downloaded AntiMicro and configured my Xbox controller for use with Trainz. It was quite straight forward and I am quite happy with the result.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •