Wisst ihr was dieser Knopf soll wen man draufdrückt dann wird die Leistung auf 0% getan ist das ein Art AFB
wenn ja wie kann ich V-SOLL einstellen.
Danke für Hilfe/Tipps
habe noch ein teil vom Enginescript kopiert dort geht es um den Speedset.
Code
if brakeVal < 1 then
local mph = speed / MPH_TO_MS
local finalMph = nil
local lastMph = 0
local finalPercent = 0
for k,v in pairs(DYNAMIC_BRAKE_VALUES) do
if (k > mph) then
if (finalMph == nil or k - mph < finalMph - mph) then
finalMph = k
finalPercent = v
end
else
if (mph - k < mph - lastMph) then
lastMph = k
percentDynamic = v
end
end
end
if finalMph ~= nil then
mphRange = finalMph - lastMph
percentRange = finalPercent - percentDynamic
percentDynamic = (((mph - lastMph) / mphRange) * percentRange + percentDynamic)
end
if (percentDynamic == nil) then percentDynamic = 0 end
end
SetControlValue("TrainBrakeControl", 0, brakeVal)
SetConsistControlValue("TrainBrakeControl", 0, brakeVal)
local accel = math.min(brakeVal * percentDynamic * MAX_TRACTIVE_EFFORT, 99)
local accelTens = math.floor(accel / 10)
local accelUnits = accel - (accelTens * 10)
SetControlValue("DynaBrakeEffortUnits", 0, accelUnits)
SetControlValue("DynaBrakeEffortTens", 0, accelTens)
local tbcpValue = GetControlValue("TrainBrakeCylinderPressureBAR", 0)
if (tbcpValue ~= nil) then
tbcpValue = tbcpValue * (1 - percentDynamic)
SetControlValue("TbcpNewBAR", 0, tbcpValue)
end
if brakeVal > 0 or regulatorRequiresReset then
throttleVal = 0
else
local speedSet = GetControlValue("SpeedSet", 0) == 1
if (speedSet) then
if (not speedJustSet) then
speedSetVelocity = math.floor((speed / MPH_TO_MS) / SPEED_SET_MPHINTERVAL) * SPEED_SET_MPHINTERVAL * MPH_TO_MS
speedJustSet = true
end
local maxThrottle = throttleVal
throttleVal = GetControlValue("Regulator", 0)
speedSetLastTime = speedSetLastTime + interval
if (speedSetLastTime >= speedSetUpdateTime) then
if (speedSetVelocity < speed) then
throttleVal = math.min(throttleVal - 0.3 * speedSetLastTime, maxThrottle)
elseif (speedSetVelocity > speed) then
throttleVal = math.min(throttleVal + 0.3 * speedSetLastTime, maxThrottle)
end
speedSetLastTime = 0.0
end
else
speedJustSet = false
speedSetVelocity = 0
end
end
SetControlValue("Regulator", 0, throttleVal)
SetConsistControlValue("Regulator", 0, throttleVal)
SetControlValue("MotorSound", 0, math.max(throttleVal, brakeVal))
SetConsistControlValue("MotorSound", 0, math.max(throttleVal, brakeVal))
end
Alles anzeigen