P.I. Engineering User Forum

Product Support, Technical Questions and Answers, and Examples for P.I. Engineering Products

You are not logged in.

#1 2016-09-11 15:26:36

Registered: 2016-09-11
Posts: 2

possible to develop for TANE?

Just got Trainz A New Era, but dissapointed that my RailDriver isn't supported. Is there a way to set the RailDriver to just send key presses (emulate a regular keyboard) as a workaround?


#2 2016-09-12 08:40:35

PIE Amber
Technical Software Developer
From: Williamston, MI
Registered: 2016-01-21
Posts: 120

Re: possible to develop for TANE?

You'd be better off doing this with MacroWorks 3.1 rather than the SDK. MW3.1 already has ability to send keypresses built in, you'd just need to figure out the logic you need to get the behavior you want.

Install MacroWorks 3.1 from the PI site; don't download the Train Simulator 2016 version. Then you can access MacroWorks 3.1's script file from the Window menu and then Script Code. You should see the case statements for all controls on the RailDriver. Help with the basic functionality can be found in the Advanced Help file, found through the Help menu. Otherwise, it's general VB code as far as logic goes. You can also look at the TrainSim script to see an example of how the analog controls are handled there.

To send keystrokes:

MW3.SendScanCode("##:1, ##:0")

The "##" should be replaced by the actual scan code numbers. Program a button through the GUI in order to see the proper scan code for a given key, if you don't know it.

I don't mean to claim it will be easy -- it won't be easy to get it working properly, it'll take some trial and error. And it'll be a half-solution at best, without ability to receive feedback from the sim itself. This is the reason we're not releasing it as a supposed solution -- if we offered something like that we'd get nothing but complaints. In order to properly handle analog you need to know what's going on in the sim too.

That's why, ultimately, we'd really like to receive that API from N3V. :)

Amber from P.I. Engineering


Board footer

Powered by FluxBB