TS2015 Raildriver Interface

When downloads are added a topic is automatically created where discussion of that download can take place.

Re: TS2015 Raildriver Interface

Postby Nobkins » Tue Nov 18, 2014 2:30 pm

Hi Chris,

Not sure what has changed but it is all working correctly this morning. sorry about this.

I have another issue related to how the middle point of the combined throttle brake is handled.
The 166 has a combined throttle and brake range of 0 (max brake) to 1 (max throttle)
The notch values are as follows:
0, 0.08, 0.18, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.9, 1
In the 166 off or idle is actually -30% (according to the F4 hud). which is a value of 0.35 for the notch definition.

My Calibration for the DynBrake/Throttle is as follows:
Max DynBrake: 44
Min Dyn Brake: 114
Min Throttle: 171
Max Throttle: 216

I would like a way for "0.35" to be used as the notch between min Dyn Brake and Min Throttle (ie the middle of the lever movement) so that off in game corresponds to off on the RailDriver. The problem is not your software so much as the 166 does not use 0.5 as off but 0.35.

So to clarify further:
between raildriver values 114 and 171 I want 0.35 to be sent to the game.
Less than 114 I want the brake notches (i.e. notches less 0.35) to be used
Greater than 171 I want the throttle notches to be used (i.e. notches greater than 0.35)

A possible solution (not very elegant but....)
The current notch values are:
0, 0.08, 0.18, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.9, 1
If I were to enter:
0, 0.08, 0.18, 0.25, *0.35*, 0.45, 0.55, 0.65, 0.75, 0.85, 0.9, 1

Then maybe your software could look for the * character and then automatically assign that to the middle range on the RailDriver of 114 to 171.

Hope you don't mind all this input. I just happen to have picked a really difficult engine to start off with!

Jim

*Post Edited. Off (or brake release and no throttle) appears to be 0.35. I originally said it was 0.45. Ammended post to reflect this. What I want to achieve remains unchanged :D
The notches (I think) correspond as follows:
0 = Emergency
0.08 = Full service (step 3)
0.18 = Step 2 brake
0.25 = Step 1 brake
0.35 = Brakes released no throttle
0.45 = Throttle Notch 1
0.55 = Throttle Notch 2
0.65 = Throttle Notch 3
0.75 = Throttle Notch 4
0.85 = Throttle Notch 5
0.9 = Throttle Notch 6
1 = Throttle Notch 7 (full power)
TrainSimDev.com YouTube Channel
Video tutorials and other resources
User avatar
Nobkins
Site Admin
 
Posts: 547
Images: 3164
Joined: Wed Feb 05, 2014 12:24 am
Has thanked: 325 times
Been thanked: 185 times

Re: TS2015 Raildriver Interface

Postby CobraOne » Wed Nov 19, 2014 5:22 pm

Hi Jim

I had started looking at changing my code as you suggested and was getting good results but I was not happy with the fact that although I could get the ThrottleandBrake lever on the Raildriver to be in neutral at 0.35, the ThrottleandBrake in the cab was not in neutral. It then dawned on me that instead of changing my program for what appears to be a problem with only one engine, I should try changing the engine simulation file which has the settings for the notches instead of my program and hey presto I came up with the following that works exactly as it should.
The file I changed is located in Assets\Kuju\RailSimulator\RailVehicles\Diesel\Class166\Default\Simulation and is called Class166 Engine Simulation.lua. I changed the Combined lever settings from:-
Code: Select all
-- Train brake control.
      if (CombinedLever < 0.07) then
         SetBrake = 1
      elseif (CombinedLever < 0.17) then
         SetBrake = 0.98
      elseif (CombinedLever < 0.24) then
         SetBrake = 0.72
      elseif (CombinedLever < 0.34) then
         SetBrake = 0.44
      else
         SetBrake = 0
      end

      if (gEmergencyAWSSet == 0) then
         Call( "*:SetControlValue", "TrainBrakeControl", 0, SetBrake )
      end

-- Regulator control.
      if (CombinedLever == 1) then
         SetReg = 1
      elseif (CombinedLever >= 0.89) then
         SetReg = 0.857
      elseif (CombinedLever >= 0.84) then
         SetReg = 0.714
      elseif (CombinedLever >= 0.74) then
         SetReg = 0.571
      elseif (CombinedLever >= 0.64) then
         SetReg = 0.429
      elseif (CombinedLever >= 0.54) then
         SetReg = 0.286
      elseif (CombinedLever >= 0.44) then
         SetReg = 0.143
      else
         SetReg = 0
      end


To This
Code: Select all
-- Train brake control.
      if (CombinedLever < 0.01) then
         SetBrake = 1
      elseif (CombinedLever < 0.125) then
         SetBrake = 0.98
      elseif (CombinedLever < 0.25) then
         SetBrake = 0.72
      elseif (CombinedLever < 0.37) then
         SetBrake = 0.44
      else
         SetBrake = 0
      end

      if (gEmergencyAWSSet == 0) then
         Call( "*:SetControlValue", "TrainBrakeControl", 0, SetBrake )
      end

-- Regulator control.
      if (CombinedLever == 1) then
         SetReg = 1
      elseif (CombinedLever >= 0.92) then
         SetReg = 0.857
      elseif (CombinedLever >= 0.85) then
         SetReg = 0.714
      elseif (CombinedLever >= 0.78) then
         SetReg = 0.571
      elseif (CombinedLever >= 0.71) then
         SetReg = 0.429
      elseif (CombinedLever >= 0.64) then
         SetReg = 0.286
      elseif (CombinedLever >= 0.57) then
         SetReg = 0.143
      else
         SetReg = 0
      end


leaving everything else the same.

I also changed your notch values in your key map to:-
0.000, 0.126, 0.251, 0.375, 0.500, 0.571, 0.643, 0.714, 0.786, 0.857, 0.929, 1.000
and that was it. I now have the class 166 working as it should.

Chris
CobraOne
General Shed Duties
 
Posts: 23
Images: 1
Joined: Thu May 22, 2014 11:35 am
Has thanked: 0 time
Been thanked: 9 times

Re: TS2015 Raildriver Interface

Postby Nobkins » Wed Nov 19, 2014 5:39 pm

Hi Chris,

That looks good. My only concern is that modify the 166 file means the settings will be lost on a verify. That is why I was hoping to achieve this by adapting your program.

I fully appreciate the difficulty of trying to allow your program to handle the huge variety of simulation configurations. I am happy to go with your solution but if you do decide to make your program handle the 166 without modifying the 166 simulation it might also allow other "tricky" loco's to be configured correctly by using your excellent program.

I'll try your settings later tonight.

Cheers for your hard work.

Jim
TrainSimDev.com YouTube Channel
Video tutorials and other resources
User avatar
Nobkins
Site Admin
 
Posts: 547
Images: 3164
Joined: Wed Feb 05, 2014 12:24 am
Has thanked: 325 times
Been thanked: 185 times

Re: TS2015 Raildriver Interface

Postby CobraOne » Wed Nov 19, 2014 7:00 pm

Hi Jim
The only problem with altering my program to make the 166 work is that the throttleandBrake lever in the cab will be out of sync and the only way I can see around that is to edit the engine simulation file. You can always back the file up so when you do a verify, you can simply reinstate the backup.
I will carry on looking into adding the option to state where neutral is in your notch values, but as I said it won't alter what the cab lever perceives as neutral.
Chris
CobraOne
General Shed Duties
 
Posts: 23
Images: 1
Joined: Thu May 22, 2014 11:35 am
Has thanked: 0 time
Been thanked: 9 times

Re: TS2015 Raildriver Interface

Postby Nobkins » Wed Nov 19, 2014 7:36 pm

No problem Chris. Thanks for taking the time to look into this.
TrainSimDev.com YouTube Channel
Video tutorials and other resources
User avatar
Nobkins
Site Admin
 
Posts: 547
Images: 3164
Joined: Wed Feb 05, 2014 12:24 am
Has thanked: 325 times
Been thanked: 185 times

Re: TS2015 Raildriver Interface

Postby CobraOne » Thu Nov 27, 2014 12:28 pm

Version 1.02 released.
V1.02
TS2015 Raildriver Interface
1. Added option when assigning notch range to insert the letter N in front of the position you wish to use as neutral because, not all trains use 0.5 as in the Class 166 which uses 0.35, so by entering that position as N0.35, my program will re-align neutral to 0.35. as in
0, 0.08, 0.18, 0.25, N0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.9, 1 You do not need to do this for all your engines, only those whose neutral position you wish to change from the default.
2. When assigning range/notch value, if a value is already present when you select the assign option the values are copied into the textbox on the form that pops up ready for editing rather than you having to retype them all, makes it easier to insert the N for the neutral position too.
3. Also when assigning range/notch values as in 2 above I have added a button that will allow you to automatically reverse the values you enter. This is useful if you want to reverse the movement of a lever i.e throttle and brake range is normally 0 to 1 with 0 being full brake and 1 being full throttle, but if you reverse the values to 1 to 0 then full brake becomes full throttle and full throttle becomes full brake.
Another way to achieve the same thing is to enter the notch values as normal and enter the range value as 1,0 or whatever the reverse of you min/max notch range is.

Railworks_Getdata_Script
1. Added a 2 second delay in running the script once your scenario is loaded. This allows TS to settle and stops the cab controls being jittery on first run. It also means you don't have to restart the whole program each time you start a new scenario, just stop and start callback will do.
2. Minor adjustment to the calls to the headlights and wipers.
3. Corrected typing error in VirtualDynaminBrake which should be VirtualDynamicBrake which prevented the dynamic brake from working on some loco's.

TS2015 Data Extractor
1. Added a line at the top of the file that shows the name and location of the engine script file you need to edit for the selected train. e.g for the Class 170 from Academy :- Engine Script to edit = DTG\Academy\RailVehicles\Diesel\Class170\CommonScripts\class170_DMCL_script.
Unfortunately the engine bin file does not state whether the extension is lua or out.

Please note that if you are upgrading from a previous version, you need to copy the new Railworks_Getdata_Script to your plugins folder and overwrite the old one. If you have made any changes to your keymaps then copy those over to the v1.02 folder as well or simply copy the "TS2015 Raildriver Interface V1.02.exe" file to the old folder and run it from there.

Chris
CobraOne
General Shed Duties
 
Posts: 23
Images: 1
Joined: Thu May 22, 2014 11:35 am
Has thanked: 0 time
Been thanked: 9 times

Re: TS2015 Raildriver Interface

Postby CobraOne » Sun Feb 22, 2015 1:04 am

Version 2 released
http://www.trainsimdev.com/forum/downloads.php?view=detail&df_id=124

This is a major update to automate the extraction of all data and editing of all the engine script files with the press of one button.

Changes made:-
Data Extractor & Engine Script Editor (Replaced)
1. Now combined into one program (Railworks Editor) that automates the process so that the clicking of one button will
1. unzip all AP files
2. Extract the engine.bin and Inputmapper data
3. Extract the locations of the engine scripts to edit and edit the scripts
4. There is also the option to select a single asset to extract
5. There is no longer a need to install 7zip
See the Railworks Editor Readme.pdf inside the Railworks Editor folder for instructions on using the new software

TS2015 Raildriver Interface
1. Added extra controls names (these will be placed in a text file for easy editing in the next release so you can add them yourself without having to wait for a new release)
2. When you assign a button in the Edit Keymap, if the button is already assigned then that assignment is removed to stop one key sending more than one command.
3. Moved supplied 'keymaps' to 'keyMaps_Supplied' folder and only copy them to keymaps folder if the keymaps folder does not exist as in first time use. This stops your keymaps being overwritten when you update to a newer version.
4. Set the culture to InvariantCulture which should fix the problem of non english languages having to change their decimal symbol from comma to full stop. As yet untested.

Railworks_Getdata_Script.lua
1. Added extra control names
2. You can now use the keyboard or Raildriver levers at the same time
3. Updated script to only send changed values rather than values all the time. Speeds up execution.

Calculator Notch Values
1. Extended the Max/Min ranges so values less than -1 and greater than 1 can be input.
2. Added button to copy values to clipboard for pasting into TS2015 Raildriver Interface.

Engine_Script_Location.pdf/xls
1. Removed as no longer needed

TS2015 Interface Readme.pdf/doc
1. Updated to reflect changes in data extraction.
2. Added quick setup section.

Please note that if you are upgrading from a previous version, you need to copy the new Railworks_Getdata_Script to your plugins folder and overwrite the old one.
You can also copy all the files and folders from the enclosed TS 2015 Raildriver Interface folder into your current folder. Doing so will keep all your current keymaps and setting.txt files intact.
You can also delete the Engine Script Editor V1.01 and TS2015 Data Extractor V1.02 as these have been replaced with the Railworks Editor.
Finally just replace the CalculateNotchValues with the current one.

Chris
CobraOne
General Shed Duties
 
Posts: 23
Images: 1
Joined: Thu May 22, 2014 11:35 am
Has thanked: 0 time
Been thanked: 9 times

Previous

Return to Download Discussion

Who is online

Users browsing this forum: No registered users and 0 guests