Real CAB Controller

VVMM

Trainz Scripter/Developer
Hi there!

I am currently building a trainz real cab controller, just like the one from PI Engineering, but resembling the one from my country.
In order to control the cab levers it emulates pressing keyboard keys.
Is there any way to set different keys for the different position of the levers (e.g.: ind. brake, light switch...) instead of just toggling them with "E" or "L" to make the cab controller work flawless?

More important, is there any way to read info from trainz (like velocity, pressure, ampermeter, throttle notch...) in order to display on my cab controller?
I have the RailDriver driver from P.I. installed (if it can help me with anything...)

I would be very grateful if anyone could help me on this! :)
 
You could build a full scale mockup of a cab, complete with a full size (wooden) control stand ... and label the handles Q, A, Z, W, S, X, E, D, C, V, R, F, V, L, H, B, J, Ctrl+J, [, ] ... and move the non-operating fake handles ... and instead speak using a microphone, using your PC's free built-in and Microsoft speach recognition program ... and operate the trainz via voice command, in conjunction with the levers.


A dumb idear' but ... Hmmmmmm ?
 
Last edited:
One member of SpainTrainzRutas, is building a cab, at real scale, with all details. From what i have learnt from Trainz, if you go into the options, in the trainz root folder, you can assign more than 1 key to a control, there are some things in the config currently unused and others with more of 1 control. You would need to make a script and learn about electronics, to make a controler to use the same key, for example, a throttle that every time that you move it forward, presses the key "W", so if you move to notch 3 it will make "W-W-W" and the same but with decelerating "X-X-X" and if you put it in the notch 0 it will press "S". I have seen very great things with electronic skills, my father haves a cab, of a plane, with real throttle and pad and controller and joystick and others, all made with wood and plastic, it works well with Flight Simulator, its superb. And can be possible in trainz. And for the info of velocity pressure and others you can see the "engine spec" and "traincar configs" to make an idea of pressures and others
Good luck with the project, and looking forward to progress

Greetings
 
I know some electronics and i have already designed the routines to press the existing keys. The problem is with the toggle controls and i don't have any idea how to read the onscreen realtime information about pressure and velocity.
I saw the keyboard.txt file, but for the ind. brake it has only toggle. Maybe i have to add a new line(?)
ivantr, can you give me a link to that member of SpainTrainzRutas? Or some contact info? Maybe he can help.
 
Look for a keyboard.txt file under TS2010's userdata directory. I want to say it's under Settings. See what options are available. If there are no position-based settings available, a good alternative may be to rig up some leaf-style switches, the kind that are used in push buttons on arcade games, tripped by lobes or extensions on the back of your controls.

Edit: As to your latest post, the second option might be the only one.
 
I know some electronics and i have already designed the routines to press the existing keys. The problem is with the toggle controls and i don't have any idea how to read the onscreen realtime information about pressure and velocity.
I saw the keyboard.txt file, but for the ind. brake it has only toggle. Maybe i have to add a new line(?)
ivantr, can you give me a link to that member of SpainTrainzRutas? Or some contact info? Maybe he can help.

I know that there are several people in several countries (me included) who are working on the same thing. A group of us from Australia and the US approached N3V a few years ago and as recently as last year asked for their help regarding extracting information from the game that would drive the controls and gauges. We found that they didn't want to know and would provide no help unless we paid for it and developed the sub program necessary ourselves. When you consider the scale of the homebuilt Flight Simulator add-on market it seems a bit short sighted.

Anyway, as to your problem, flight sim enthusiasts often use a potentiometer connected to a keyboard encoder to operate the throttles etc. It works on reading the value of the voltage. An increase is read as pressing the 'w' key, a decrease the same as pressing the 'x' key. I know very little about electronics but many of the flight sim sites could probably help you. I've several sets of controls in the garage that I want to use for the same purpose but my electronic illiteracy defeats me.

Railwayz
 
Back
Top