Submitting loco configurations

Support forum for the Trainsim Helper program by Havner

Moderator: Havner

Submitting loco configurations

Unread postby Havner » Sun Dec 28, 2014 4:36 pm

If you configured your own loco and would like to have it included in the next version for others or simply not to merge the configs in case of the new version please post your code here.

Have a look at the section 13 of the readme available here:
https://github.com/Havner/trainsim-help ... readme.txt

I need 2 things:
- loco detection function you came up with
- the config itself, ranges, notches, etc
User avatar
Havner
 
Posts: 56
Joined: Wed Sep 10, 2014 8:46 pm

Re: Submitting loco configurations

Unread postby Timex » Sat Jan 17, 2015 1:24 pm

Hello all-
My UK Diesel and Electric loco/unit detects and configs for Havner’s excellent joystick helper.
I’m using a Saitek throttle quadrant with excellent results :D
Most of the configs are just to delete the emergency brake settings and throttle notches were needed, but feel free to modify yourself.
I’ve also added the engine script location to be patched from the engine data extractor- good when doing a fresh install.

I insert my code at the top of Havner’s original and have no duplicate loco/unit detections.

I have some more configs I’m working on, I will add later- and some of Havner’s I’ve tweaked.
The new 378 uses the 375/377 config.
I have an issue with class 76/77 starting up with pan down not detecting, not got around to fixing this yet.

Detects/Configs:
Shunters 08/09/10/11/13, Loco’s 20 Just Trains, 27, 45, 50, 52, 55, 55 Prototype, 56, 60, 66, 67, 70,76/77, 86, 87, 91,92, Units: 150, 153, 156, 158, 170, 319, 380, 390, 421 4CIG / 422 4BIG / 424 4VEP, 466, 456

Detects:

Code: Select all
function DetectClass08(DisablePopup) -- Shunters
-- Engine Script to edit = RSC\DieselShunterPack\RailVehicles\Diesel\Class08\Default\Engine\Class08EngineScript
-- This patches all shunters in folder
  if
      Call("*:ControlExists", "DummyWaterPressure", 0) == 1 and
      Call("*:ControlExists", "DummyBatteryAmps", 0) == 1 and
      Call("*:ControlExists", "DummyOilPressure", 0) == 1 and
      Call("*:ControlExists", "DummyFuelGauge", 0) == 1
   
   then
      if not DisablePopup then DisplayPopup("Class 08/09/10/11/13 Detected") end
      return 1
   end
end

function DetectClass20JT(DisablePopup) -- Class 20 Just Trains
   -- Engine Script to edit = JustTrains\Class20\RailVehicles\Diesel\Class20\Default\Engine\class_20_script
   if
      Call("*:ControlExists", "Wheelflat", 0) == 1 and
      Call("*:ControlExists", "RHTTSpray", 0) == 1 and
      Call("*:ControlExists", "BatteryIsolatingSwitch", 0) == 1 and
      Call("*:ControlExists", "Fan", 0) == 1
   then
      if not DisablePopup then DisplayPopup("Class 20 Just Trains Detected") end
      return 1
   end
end


function DetectClass27(DisablePopup) -- Class 27
-- Engine Script to edit = RSC\Class27Pack01\RailVehicles\Diesel\Class_27\Default\Engine\class_27 Headcode2

   if
      Call("*:ControlExists", "DialLights", 0) == 1 and
      Call("*:ControlExists", "CabLight", 0) == 1 and
      Call("*:ControlExists", "Wheelslip", 0) == 1 and
      Call("*:ControlExists", "LocoBrakeCylinderPressurePSIOld", 0) == 1
   then
      if not DisablePopup then DisplayPopup("Class 27 Detected") end
      return 1
   end
end


function DetectClass37SC(DisablePopup) -- Settle Carlisle
--Engine Script to edit = RSC\SettleCarlisle\RailVehicles\Diesel\Class37\Red\Engine\Class37_Script
   if
      Call("*:ControlExists", "Ammeter", 0) == 1 and
      Call("*:ControlExists", "DoorsOpenClose", 0) == 1 and
      Call("*:ControlExists", "GlarePanels", 0) == 1 and
      Call("*:ControlExists", "TrainBrakeCylinderPressurePSI", 0) == 1 and   
      Call("*:ControlExists", "CabLights", 0) == 1
   then
      if not DisablePopup then DisplayPopup("Class 37 SC Detected") end
   end
end

function DetectClass45(DisablePopup) -- 45 Peak
-- Engine Script to edit = DTG\Class_45Pack01\RailVehicles\Class_45\Default\Engine\Class_45_script
   if
      Call("*:ControlExists", "FanSpeed", 0) == 1 and
      Call("*:ControlExists", "CabIndex", 0) == 1 and
      Call("*:ControlExists", "HeatingRate", 0) == 1 and
      Call("*:ControlExists", "SteamHeatingPressureGaugePSI", 0) == 1
   then
      if not DisablePopup then DisplayPopup("Class 45 Detected") end
      return 1
   end
end

function DetectClass50(DisablePopup) -- 50
-- Engine Script to edit = MichaelWhiteley\Class 50\RailVehicles\Diesel\Class 50\Default\Engine\Class50Engine
  if
      Call("*:ControlExists", "CoolingFan", 0) == 1 and
      Call("*:ControlExists", "Vents", 0) == 1 and
      Call("*:ControlExists", "Revtemp", 0) == 1 and
      Call("*:ControlExists", "firetest", 0) == 1 and
      Call("*:ControlExists", "Thirdtone", 0) == 1 and
      Call("*:ControlExists", "Wipers Right", 0) == 1 and
      Call("*:ControlExists", "AirBrakePipePressurePSI", 0) == 1
   then
      if not DisablePopup then DisplayPopup("Class 50 Detected") end
      return 1
   end
end

function DetectClass52(DisablePopup) -- 52 Western
  if
      Call("*:ControlExists", "GlarePanels", 0) == 1 and
      Call("*:ControlExists", "DoorsOpenClose", 0) == 1 and
      Call("*:ControlExists", "Bell", 0) == 1 and
      Call("*:ControlExists", "TractiveEffort", 0) == 1 and
      Call("*:ControlExists", "CabLight", 0) == 1 and
      Call("*:ControlExists", "Wheelslip", 0) == 1 and
      Call("*:ControlExists", "AirBrakePipePressurePSI", 0) == 1 and
      Call("*:ControlExists", "Startup", 0) == 1 and
      Call("*:ControlExists", "CompressorState", 0) == 1
   then
      if not DisablePopup then DisplayPopup("Class 52 Detected") end
      return 1
   end
end

function DetectClass55(DisablePopup) -- 55 Deltic
-- Engine Script to edit = Kuju\RailSimulator\RailVehicles\Diesel\Class55\Default\Engine\Class55EngineScript
  if
      Call("*:ControlExists", "GlarePanels", 0) == 1 and
      Call("*:ControlExists", "DoorsOpenClose", 0) == 1 and
      Call("*:ControlExists", "Bell", 0) == 1 and
      Call("*:ControlExists", "TractiveEffort", 0) == 1 and
      Call("*:ControlExists", "RPM2", 0) == 1 and
      Call("*:ControlExists", "RPMDelta2", 0) == 1 and
      Call("*:ControlExists", "AirBrakePipePressurePSI", 0) == 1 and
      Call("*:ControlExists", "Startup", 0) == 1 and
      Call("*:ControlExists", "SteamHeatingPressureGaugePSI", 0) == 1
   then
      if not DisablePopup then DisplayPopup("Class 55 Detected") end
      return 1
   end
end

function DetectClass55P(DisablePopup) -- Deltic Prototype
-- Engine Script to edit = RSC\DelticPrototype\RailVehicles\Diesel\Deltic\Default\Engine\DelticEngineScript
   if
      Call("*:ControlExists", "SteamHeatingPressureGaugePSI", 0) == 1 and
      Call("*:ControlExists", "TractionAmps", 0) == 1 and
      Call("*:ControlExists", "Voltmeter1", 0) == 1 and
      Call("*:ControlExists", "Voltmeter2", 0) == 1
   then
      if not DisablePopup then DisplayPopup("Deltic Prototype Detected") end
      return 1
   end
end

function DetectClass56(DisablePopup) -- 56 RF Sectors
-- Engine Script to edit = RSC\Class56Pack01_RFSectors\RailVehicles\Diesel\Class_56\Default\CommonScripts\Class_56_Script
  if
      Call("*:ControlExists", "SSCSet", 0) == 1 and
      Call("*:ControlExists", "DSDPedal", 0) == 1 and
      Call("*:ControlExists", "DSDEnabled", 0) == 1 and
      Call("*:ControlExists", "SlowSpeedometerMPH", 0) == 1 and
      Call("*:ControlExists", "AbsoluteSpeedMPH", 0) == 1
   
   then
       if not DisablePopup then DisplayPopup("Class 56 Detected") end
      return 1
   end
end

function DetectClass57(DisablePopup) -- 57
-- Engine Script to edit = Oovee\BRClass57Pack01\RailVehicles\Diesel\Class57-0\Default\CommonScripts\Class57EngineScript
  if
      Call("*:ControlExists", "ActiveCab", 0) == 1 and
      Call("*:ControlExists", "Driven", 0) == 1 and
      Call("*:ControlExists", "ArmRestRight", 0) == 1 and
      Call("*:ControlExists", "ArmRestLeft", 0) == 1 and
      Call("*:ControlExists", "TrainLength", 0) == 1
   
   then
       if not DisablePopup then DisplayPopup("Class 57 Detected") end
      return 1
   end
end

function DetectClass60(DisablePopup) -- 60 Just Trains
-- Engine Script to edit = JustTrains\Class60\RailVehicles\Diesel\Class60\Default\Engine\class_60_script
  if
      Call("*:ControlExists", "AutoSandingLight", 0) == 1 and
      Call("*:ControlExists", "FireAlarmLight", 0) == 1 and
      Call("*:ControlExists", "AWSIsolation", 0) == 1 and
      Call("*:ControlExists", "FM1200Audio", 0) == 1 and
      Call("*:ControlExists", "FM1200Audio", 0) == 1
   
   then
      if not DisablePopup then DisplayPopup("Class 60 Detected") end
      return 1
   end
end


function DetectClass66(DisablePopup) -- 66 Freightliner
-- Engine Script to edit = RSC\Class66Pack02\RailVehicles\Diesel\Class 66\FL\emd_66_script

  if
      Call("*:ControlExists", "SwitchTaillight", 0) == 1 and
      Call("*:ControlExists", "WindowLeft", 0) == 1 and
      Call("*:ControlExists", "PassGoods", 0) == 1
   
   then
      if not DisablePopup then DisplayPopup("Class 66 Detected") end
      return 1
   end
end

function DetectClass67(DisablePopup) -- 67 EWS
-- Engine Script to edit = RSC\Class67Pack01\RailVehicles\Diesel\Class67\Default\Engine\EngineScript
  if
      Call("*:ControlExists", "DRAButton", 0) == 1 and
      Call("*:ControlExists", "Window Right", 0) == 1 and
      Call("*:ControlExists", "SpeedoSet", 0) == 1 and
      Call("*:ControlExists", "RealTrainLength", 0) == 1 and
      Call("*:ControlExists", "TrainLength", 0) == 1
   
   then
      if not DisablePopup then DisplayPopup("Class 67 Detected") end
      return 1
   end
end

function DetectClass70(DisablePopup) -- 70 Freightliner
-- Engine Script to edit = RSC\Class70Pack01\RailVehicles\Diesel\Class70\Default\Class_70_script
  if
      Call("*:ControlExists", "LocoBCTenths", 0) == 1 and
      Call("*:ControlExists", "MRUnits", 0) == 1 and
      Call("*:ControlExists", "DeskLight", 0) == 1
   
   then
      if not DisablePopup then DisplayPopup("Class 70 Detected") end
      return 1
   end
end

function DetectClass76Class77(DisablePopup) -- 76/77 Woodhead
-- Engine Script to edit = RSC\Class77Pack01\RailVehicles\Electric\Class76\CommonScripts\Class76_EngineScript
-- Engine Script to edit = RSC\Class77Pack01\RailVehicles\Electric\Class77\CommonScript\Class77_EngineScript
  if
      Call("*:ControlExists", "Prueba", 0) == 1 and
      Call("*:ControlExists", "FieldAmp", 0) == 1 and
      Call("*:ControlExists", "Gatillo", 0) == 1
   
   then
      if not DisablePopup then DisplayPopup("Class 76/77 Detected") end
      return 1
   end
end

function DetectClass86(DisablePopup) -- WCML / RSC
-- Engine Script to edit = RSC\Class86Pack\RailVehicles\Electric\Class86\BR Blue\Engine\EngineScript
-- Engine Script to edit = Keithmross\WCMLNorth\RailVehicles\Electric\Class86\Default\Engine\EngineScript
   if
      Call("*:ControlExists", "AntiSkid", 0) == 1 and
      Call("*:ControlExists", "Headlights", 0) == 1 and
      Call("*:ControlExists", "Sanding", 0) == 1 and
      Call("*:ControlExists", "TapChanger", 0) == 1

   then
      if not DisablePopup then DisplayPopup("Class 86 Detected") end
      return 1
   end
end

function DetectClass87(DisablePopup) -- WCML2
-- Engine Script to edit = keithmross\WCML2\RailVehicles\Electric\Class87\Default\Scripts\EngineScript
   if
      Call("*:ControlExists", "AntiSkid", 0) == 1 and
      Call("*:ControlExists", "ConsistLength", 0) == 1 and
      Call("*:ControlExists", "IntFanTimer", 0) == 1 and
      Call("*:ControlExists", "TapChanger", 0) == 1

   then
        if not DisablePopup then DisplayPopup("Class 87 Detected") end
      return 1
   end
end

function DetectClass91(DisablePopup) -- RSC 91
--Engine Script to edit = RSC\Class91Addon\RailVehicles\Electric\Class 91\Default\CommonScripts\Class files\Class91_EngineScript
  if
      Call("*:ControlExists", "Driver Guard Call", 0) == 1 and
      Call("*:ControlExists", "ClipLight Rear", 0) == 1 and
      Call("*:ControlExists", "SpeedSetmulit", 0) == 1     

   then
       if not DisablePopup then DisplayPopup("Class 91 Detected") end
      return 1
   end
end


function DetectClass92(DisablePopup) -- RSC 92 AP
  if
      Call("*:ControlExists", "SpeedSetAlarm", 0) == 1 and
      Call("*:ControlExists", "ETSCurrent", 0) == 1 and
      Call("*:ControlExists", "AnnunciatorPrev", 0) == 1 and
      Call("*:ControlExists", "OverTemp", 0) == 1 and
      Call("*:ControlExists", "Cab2WiperSpeed", 0) == 1     

   then
       if not DisablePopup then DisplayPopup("Class 92 Detected") end
      return 1
   end
end

function DetectClass150(DisablePopup) -- 150 DMU Thomson-Oovee
  if
      Call("*:ControlExists", "NRN", 0) == 1 and
      Call("*:ControlExists", "AuxHeat", 0) == 1 and
      Call("*:ControlExists", "SeatRight", 0) == 1 and
      Call("*:ControlExists", "ArmRight", 0) == 1 and
      Call("*:ControlExists", "GlareRight", 0) == 1     

   then
      if not DisablePopup then DisplayPopup("Class 150 Detected") end
      return 1
   end
end

function DetectClass153(DisablePopup) -- 153 Just Trains
  if
      Call("*:ControlExists", "NRNTest", 0) == 1 and
      Call("*:ControlExists", "BlindDown", 0) == 1 and
      Call("*:ControlExists", "GearboxFaultUnit", 0) == 1 and
      Call("*:ControlExists", "RPMAudio", 0) == 1 and
      Call("*:ControlExists", "FireSystemDelay", 0) == 1     

   then
      if not DisablePopup then DisplayPopup("Class 153 Detected") end
      return 1
   end
end

function DetectClass156(DisablePopup) -- 156 Oovee
  if
      Call("*:ControlExists", "Cable", 0) == 1 and
      Call("*:ControlExists", "CabCall", 0) == 1 and
      Call("*:ControlExists", "HeaterFan", 0) == 1 and
      Call("*:ControlExists", "VirtualFluid", 0) == 1 and
      Call("*:ControlExists", "Surge", 0) == 1     

   then
      if not DisablePopup then DisplayPopup("Class 156 Detected") end
      return 1
   end
end

function DetectClass158SC(DisablePopup) -- 158 Settle/Carlisle
   if
 
      Call("*:ControlExists", "SptEngineStartLight", 0) == 1 and
      Call("*:ControlExists", "GuardSignal", 0) == 1 and
      Call("*:ControlExists", "DoorsOpenCloseLeft", 0) == 1 and
      Call("*:ControlExists", "DoorsOpenCloseRight", 0) == 1 and
      Call("*:ControlExists", "SptDoorInterlock", 0) == 1 and
      Call("*:ControlExists", "Blower", 0) == 1

   then
      if not DisablePopup then DisplayPopup("Class 158 Detected") end
      return 1
   end
end

function DetectClass170_Thomson(DisablePopup) -- 170 Thomson
  if
      Call("*:ControlExists", "GlareScreen", 0) == 1 and
      Call("*:ControlExists", "DRAButton", 0) == 1 and
      Call("*:ControlExists", "RPMDelta", 0) == 1 and
      Call("*:ControlExists", "RPM", 0) == 1 and
      Call("*:ControlExists", "Bell", 0) == 1 and
      Call("*:ControlExists", "Buzzer", 0) == 1 and
      Call("*:ControlExists", "DoorsOpenCloseLeft", 0) == 1 and
      Call("*:ControlExists", "AWSWarnCount", 0) == 1     

   then
      if not DisablePopup then DisplayPopup("Class 170 (Thomson) Detected") end
      return 1
   end
end

function DetectClass319(DisablePopup) -- 319
-- Engine Script to edit = RSC\Class319Pack01\RailVehicles\Class319\Default\Engine\319_DT_Script
  if
      Call("*:ControlExists", "CarSlider", 0) == 1 and
      Call("*:ControlExists", "DSDPedal", 0) == 1 and
      Call("*:ControlExists", "DSD", 0) == 1 and
      Call("*:ControlExists", "LeftCabWindow", 0) == 1 and
      Call("*:ControlExists", "RightWindowBlind", 0) == 1     

   then
      if not DisablePopup then DisplayPopup("Class 319 Detected") end
      return 1
   end
end

function DetectClass380(DisablePopup) -- 380 Glasgow Airport Link
-- Engine Script to edit = TotalizeMedia\Class380Pack01\RailVehicles\Electric\class380\CommonScripts\380EngineScript
  if
      Call("*:ControlExists", "GangwayExtensionValue", 0) == 1 and
      Call("*:ControlExists", "GangwayExtensionSwitch", 0) == 1 and
      Call("*:ControlExists", "ThrottleAndBrakeDisplay", 0) == 1 and
      Call("*:ControlExists", "BrakeDemandIsolateLight", 0) == 1 and
      Call("*:ControlExists", "MotorSound", 0) == 1     

   then
      if not DisablePopup then DisplayPopup("Class 380 Detected") end
      return 1
   end
end



function DetectClass390(DisablePopup) -- 390 Pendolino
-- Engine Script to edit = S9BL\Class390Addon\RailVehicles\Electric\Class390\CommonScripts\390EngineScript
  if
      Call("*:ControlExists", "TbcpNewBAR", 0) == 1 and
      Call("*:ControlExists", "TiltTime", 0) == 1 and
      Call("*:ControlExists", "PantographDirection", 0) == 1 and
      Call("*:ControlExists", "CylinderCock", 0) == 1     

   then
      if not DisablePopup then DisplayPopup("Class 390 Pendolino Detected") end
      return 1
   end
end

function DetectClass421(DisablePopup) -- 421 4CIG /422 4BIG/ 423 4VEP
-- Engine Script to edit = RSC\Class421Pack02\RailVehicles\Electric\Class421\Southern\DTCL\EngineScript
-- Engine Script to edit = RSC\Class422Pack01\RailVehicles\Electric\Class422\BRGrey\DTCL\EngineScript
-- Engine Script to edit = RSC\Class423Pack01\RailVehicles\Electric\Class423\BRGrey\DTCL\EngineScript
  if
      Call("*:ControlExists", "AccelNotch", 0) == 1 and
      Call("*:ControlExists", "Acceleration", 0) == 1 and
      Call("*:ControlExists", "PantographControl", 0) == 1 and
      Call("*:ControlExists", "GlarePanel", 0) == 1     

   then
      if not DisablePopup then DisplayPopup("Class 421 4CIG / 422 4BIG / 424 4VEP Detected") end
      return 1
   end
end

function DetectClass444(DisablePopup) -- Portsmouth Line
-- Engine Script to edit = RSC\Class444Pack01\RailVehicles\Electric\Class444\CommonScripts\Class_444_Engine_Script
   if
      Call("*:ControlExists", "RegenerativeSound", 0) == 1 and
      Call("*:ControlExists", "MotorSound", 0) == 1 and
      Call("*:ControlExists", "SignalBell", 0) == 1 and
      Call("*:ControlExists", "DRA", 0) == 1
   then
      SysCall("ScenarioManager:ShowAlertMessageExt", "TrainSim Helper", "Class 444 detected", 3, 0)
      return 1
   end
end

function DetectClass466(DisablePopup) -- 466 RSC London Faversham
-- Engine Script to edit = RSC\Class466Pack01\RailVehicles\Electric\Class466\Default\DMSO\class466_DMSO_script
   if
      Call("*:ControlExists", "PA01", 0) == 1 and
      Call("*:ControlExists", "VigilAlarm", 0) == 1 and
      Call("*:ControlExists", "ShoesDown", 0) == 1 and
      Call("*:ControlExists", "SpeedSetDown", 0) == 1
   then
      SysCall("ScenarioManager:ShowAlertMessageExt", "TrainSim Helper", "Class 466 detected", 3, 0)
      return 1
   end
end

function DetectClass456(DisablePopup) -- London South
-- Engine Script to edit = RSC\SouthLondonLines\RailVehicles\Class456\Default\Engine\Class456_EngineScript
   if
      Call("*:ControlExists", "DestLights", 0) == 1 and
      Call("*:ControlExists", "GuardSignal", 0) == 1 and
      Call("*:ControlExists", "DriverSignal", 0) == 1 and
      Call("*:ControlExists", "TaillightSwitch", 0) == 1
   then
      SysCall("ScenarioManager:ShowAlertMessageExt", "TrainSim Helper", "Class 456 detected", 3, 0)
      return 1
   end
end


Joystick config:

Code: Select all
  if DetectClass08() then
      TrainBrakeRange = {0, 0.9}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
   
   elseif DetectClass20JT() then
      TrainBrakeRange = {0, 0.9}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
      ThrottleNotches = GenerateEqualNotches(8, ThrottleRange) -- (0,1)

   elseif DetectClass27() then
      TrainBrakeRange = {0, 0.94}
      TrainBrakeNotches = GenerateEqualNotches(3, TrainBrakeRange)
   
   elseif DetectClass37SC() then
      TrainBrakeRange = {0, 0.9}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)

   elseif DetectClass45() then
      TrainBrakeRange = {0, 0.77}     
      TrainBrakeNotches = {0, 0.15, 0.27, 0.77}
 
   elseif DetectClass50() then
      TrainBrakeRange = {0, 0.9}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
   
   elseif DetectClass52() then
       ThrottleRange = {0.0, 1}
       ThrottleNotches = {0.08, 0.17, 0.25, 0.33, 0.42, 0.5, 0.58, 0.67, 0.75, 0.83, 0.92, 1}
       TrainBrakeNotches = {0, 0.1, 0.2, 0.235, 0.27, 0.305, 0.34, 0.375, 0.41, 0.445, 0.48, 0.515, 0.55, 0.585, 0.62, 0.655, 0.69, 0.725, 0.76, 0.795, 0.83, 0.865, 0.9}
       -- If using AP soundpack only use entry below
       -- TrainBrakeRange = {0, 0.9}

   elseif DetectClass55() then
      TrainBrakeRange = {0, 0.75}
      TrainBrakeNotches = GenerateEqualNotches(3, TrainBrakeRange)

   elseif DetectClass55P() then
      TrainBrakeRange = {0, 0.6}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
   
   elseif DetectClass56() then
      TrainBrakeRange = {0, 0.94}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)

   elseif DetectClass57() then
      TrainBrakeRange = {0, 0.9}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
   
   elseif DetectClass60() then
      ThrottleNotches = GenerateEqualNotches(5) -- (0,1)
      TrainBrakeRange = {0, 0.51}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
   
   elseif DetectClass66() then
   
     -- TrainBrakeRange = {-10, 1}
     -- TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)

   elseif DetectClass67() then
      TrainBrakeRange = {0, 0.85}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
   
   elseif DetectClass70() then
        TrainBrakeRange = {0, 0.8}     
   TrainBrakeNotches = {0, 0.1, 0.5, 0.6, 0.8}
   
   elseif DetectClass76Class77() then
        TrainBrakeRange = {0, 0.66} -- removed emergency position
        TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)

   elseif DetectClass86() then
      ThrottleRange = {0.286, 1}
      ThrottleNotches = {0.286, 0.5, 0.6, 0.7, 1} -- removed OFF position
      TrainBrakeRange = {0, 0.77}     
      TrainBrakeNotches = {0, 0.15, 0.27, 0.77} -- removed emergency position

   elseif DetectClass87() then
      ThrottleRange = {0.286, 1}
      ThrottleNotches = {0.286, 0.5, 0.6, 0.7, 1} -- removed OFF position
      TrainBrakeRange = {0, 0.95}     
      TrainBrakeNotches = {0, 2, 0.25, 0.4, 0.95} -- removed emergency position
   
   elseif DetectClass91() then
       -- Not needed   

   elseif DetectClass92() then
      --TrainBrakeRange = {0, 0.9}
      --TrainBrakeNotches = GenerateEqualNotches(3, TrainBrakeRange)

   elseif DetectClass150() then
      ThrottleNotches = GenerateEqualNotches(8)
      TrainBrakeRange = {0, 3}     
      TrainBrakeNotches = {0, 1, 2, 3 }
   
   elseif DetectClass153() then
      ThrottleNotches = GenerateEqualNotches(8)
      TrainBrakeRange = {0, 0.75}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
   
   elseif DetectClass156() then
      ThrottleNotches = GenerateEqualNotches(8)
      TrainBrakeRange = {0, 3}     
      TrainBrakeNotches = {0, 1, 2, 3 }
   
   elseif DetectClass158SC() then
      ThrottleNotches = GenerateEqualNotches(8)
      -- Ignore emergency values (0.75, 1)
      TrainBrakeRange = {0, 0.75}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)

   elseif DetectClass170_Thomson() then
      CombinedThrottleRange = {0.1, 1}
      CombinedThrottleNotches = {0.5, 0.5713, 0.6427, 0.7142, 0.7857, 0.8571, 0.9285, 1}
   
   elseif DetectClass319() then
      ThrottleNotches = GenerateEqualNotches(5)
      TrainBrakeRange = {0, 0.75}
      TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
      --TrainBrakeRange = {0, 3}     
      -- TrainBrakeNotches = {0, 1, 2, 3 }
 
   elseif DetectClass380() then
      CombinedThrottleRange = {-0.75, 1}
      CombinedThrottleNotches = {-0.75, -0.5, -0.25, 0, 0.1, 0.18, 0.27, 0.36, 0.45, 0.54, 0.63, 0.72, 0.81, 0.9, 1}
   
   elseif DetectClass390() then
      -- CombinedThrottleCenterDetent = -0.68
      CombinedThrottleRange = {-0.76, 0.5}
      --CombinedThrottleNotches = {-0.76, -0.63, -0.5, -0.38, -0.25, -0.12, 0, 0.13, 0.25, 0.38, 0.5}
      CombinedThrottleNotches = {-0.76, -0.5 -0.38, -0.25, -0.12, 0, 0.13, 0.25, 0.38, 0.5}
     
   elseif DetectClass421() then
      TrainBrakeRange = {0, 0.8}
      ThrottleNotches = GenerateEqualNotches(5) -- (0,1)
   
   elseif DetectClass444() then   
      CombinedThrottleRange = {-0.81, 1} -- removed emergency position
      CombinedThrottleNotches = {-0.81, -0.68, -0.56, -0.44, -0.31, -0.18, 0, 0.2, 0.4, 0.6, 0.8, 1}
   
   elseif DetectClass466() then   
      CombinedThrottleRange = {0.1, 1} -- removed emergency position
      CombinedThrottleNotches = {0.1, 0.2, 0.33, 0.5, 0.625, 0.75, 0.875, 1}
   
   elseif DetectClass456() then
      ThrottleNotches = GenerateEqualNotches(5)
      TrainBrakeRange = {0, 0.75}     
      TrainBrakeNotches = {0, 0.25, 0.5, 0.75}
   
Timex
 

Re: Submitting loco configurations

Unread postby _o_OOOO_oo-Kanawha » Sat Jan 17, 2015 4:18 pm

How to proceed with foreign language locomotives?
I have French, Czech and Dutch locos and trains that appear to be heavily scripted, and the scripts probably use native language terms and variables. They often use different InputMapper key assignment, but the ControlValues do have their usual english names.

Take for example a look at these excellent freeware locos: modely-msts.cz/rusnerw.html, they come with separate cabview and sound files, much like MSTS.
Edwin "Kanawha"
Image
The Chessie, the train that never was ... (6000 hp Baldwin-Westinghouse steam turbine electric)
User avatar
_o_OOOO_oo-Kanawha
 
Posts: 2755
Joined: Mon Nov 14, 2011 2:12 pm

Re: Submitting loco configurations

Unread postby Havner » Sun Jan 18, 2015 5:09 am

Thanks Timex. I'll add them for the next version.

I have a problem with the following though:
CLass 27: only one unique control value.
Class 37: no unique values, I have this loco and I'm afraid this might caught a lot more then just this simple variant of Class 37.
Class 52: no unique values.
Class 55: only two kinda unique values, but I think I've seen them somewhere else.
Class 92: is this RSC or Armstrong Powerhouse?
Class 156 Oovee: I have this already, doesn't it work?
CLass 170: only one kinda unique control value, Buzzer.

The rest seems fine, although having done so much locos I try to put at least 6-8 values. Some of yours have only 3-4. Any chance you could extend this a little? When there are no unique control values maybe there are some unique ranges? (min/max values, I used that sometimes as well).

For the configs:
1. Where you remove the emergency brake range, have you done this empirically or did you actually take the limiting value from the notches definition of the engine's .bin file?
2. A definition like this is kinda strange:
TrainBrakeRange = {0, 0.9}
TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
You create a 4 equal notches for (0, 0.9). They are not equal for the whole range. Would you send me a .bin file e.g. for Class 08? I'd like to have this done properly. What you've done for the Class 45 seems more correct. You used the above a lot. Please clarify.
3. CLass 52. The notches are not for the full range. They start with 0.08. Meaning that between 0 and 0.08 there are no notches. Strange as well not to have notches for such a small range.
4. Class 66, Class 92: configs are commented out.
5. Class 150: why do you define range by hand? And the notches are equal, could have used the function.
6. For CLass 156 I've used a full range. Don't remember there being a emergency brake.

Also because I have no means of testing them I'd add them below my detections. Any chance you'd re-test them like that? Whether they are not caught by some of my detections?

BTW, where did you get the Pendolino, S9BL, who is that?

_o_OOOO_oo-Kanawha wrote:How to proceed with foreign language locomotives?

I only care about ControlValues. Doesn't matter what's inside the script or in the cab. The ControlValues are never displayed for a player. Whatever the language they are in is what is used internally. So it's fine.
User avatar
Havner
 
Posts: 56
Joined: Wed Sep 10, 2014 8:46 pm

Re: Submitting loco configurations

Unread postby Timex » Sun Jan 18, 2015 1:14 pm

Havner wrote:2. A definition like this is kinda strange:
TrainBrakeRange = {0, 0.9}
TrainBrakeNotches = GenerateEqualNotches(4, TrainBrakeRange)
You create a 4 equal notches for (0, 0.9). They are not equal for the whole range. Would you send me a .bin file e.g. for Class 08? I'd like to have this done properly. What you've done for the Class 45 seems more correct. You used the above a lot. Please clarify.
.


Thanks for the feedback Havner :)

going back to the above example (using a 08)

Code: Select all
CONTROL NAME "(TrainBrakeControl)",                    MIN VALUE "(0)",         MAX VALUE "(1)",         DEFAULT VALUE "(0.7)"
  Notch Name "(Release)",                              Notch Value "(0)"
  Notch Name "(GraduatedSelfLapLimitedHolding)",       Notch Value "(0.3)"
  Notch Name "(Supression)",                           Notch Value "(0.85)"
  Notch Name "(ContinuousService)",                    Notch Value "(0.9)"
  Notch Name "(Emergency)",                            Notch Value "(0.95)"


would the below be correct?

Code: Select all
  elseif DetectClass08() then
      TrainBrakeRange = {0, 0.9}     
      TrainBrakeNotches = {0, 0.3, 0.85, 0.9}


I'm still learning about this -so apologies, I'll look at your queries and reply
Timex
 

Re: Submitting loco configurations

Unread postby Havner » Sun Jan 18, 2015 3:27 pm

Timex wrote:would the below be correct?

Code: Select all
  elseif DetectClass08() then
      TrainBrakeRange = {0, 0.9}     
      TrainBrakeNotches = {0, 0.3, 0.85, 0.9}


I'm still learning about this -so apologies, I'll look at your queries and reply


Looking at the definition above I'm afraid not. The ranges defined above seem not to be notches but just the name to display for the RSC UI.

What you can do here is:

1. Launch the loco forgetting about joystick.
2. Use the brake with mouse (not keyboard, it can be used as well, but sometimes it's harder to see with it).
3. See if it's notched at all. E.g. when you change the value and release the mouse button does the lever move to some other value?
4a: YES: find the notches. Sometimes they are in the engine.bin for the TrainBrakeControl, sometimes for VirtualBrake (I don't expect 08 to have the latter).
4b: NO: you're fine.

Now, if there are no notches, don't add them. The author of a loco did not add them, so we don't want them as well. If you just want to remove the emergency brake do this with range, but go as high as you can go without applying it. From the code you pasted the emergency brake seem to start at 0.95, not 0.9. So if there are no notches only this should do:

TrainBrakeRange = {0, 0.9.5}

Also I only remove the emergency brake if it really does apply emergency (e.g. you need to completely stop before it at allows you to be back in the control, you should see this with big red "Emergency" on my HUD). If it's just the name on the HUD, don't remove it.

I'm sorry to be so strict. I'd really like people to start submitting configurations and I'm very happy you did :-). But I'd really like those entries I can't test myself to reflect the loco properly. And I'm more than happy to guide you and others. We'll get there :-)
User avatar
Havner
 
Posts: 56
Joined: Wed Sep 10, 2014 8:46 pm


Return to TrainSim Helper

Who is online

Users browsing this forum: No registered users and 2 guests