From d084511350b21e11b6747b883a8e266641ce1d9e Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Fri, 20 Dec 2024 19:30:03 +0300 Subject: [PATCH] manual door control for 81-717/714 added --- .../gmod_subway_81-714_lvz/cl_init.lua | 422 +++++++++++++++- lua/entities/gmod_subway_81-714_lvz/init.lua | 51 +- .../gmod_subway_81-714_lvz/shared.lua | 12 +- .../gmod_subway_81-714_mvm/cl_init.lua | 425 +++++++++++++++- lua/entities/gmod_subway_81-714_mvm/init.lua | 50 +- .../gmod_subway_81-714_mvm/shared.lua | 12 +- .../gmod_subway_81-717_lvz/cl_init.lua | 472 ++++++++++++++++- lua/entities/gmod_subway_81-717_lvz/init.lua | 53 +- .../gmod_subway_81-717_lvz/shared.lua | 21 +- .../gmod_subway_81-717_lvz_custom.lua | 8 + .../gmod_subway_81-717_mvm/cl_init.lua | 478 +++++++++++++++++- lua/entities/gmod_subway_81-717_mvm/init.lua | 53 +- .../gmod_subway_81-717_mvm/shared.lua | 22 +- .../gmod_subway_81-717_mvm_custom.lua | 8 + ...matic.lua => sys_81_714_new_pneumatic.lua} | 350 +++++++++---- ...matic.lua => sys_81_717_new_pneumatic.lua} | 372 ++++++++++---- lua/metrostroi/systems/sys_pr_14x_panels.lua | 2 +- lua/metrostroi_data/languages/en_717.lua | 137 +++++ lua/metrostroi_data/languages/ru_717.lua | 136 +++++ .../door_crans/cran_dooropen_head.dx80.vtx | 3 + .../door_crans/cran_dooropen_head.dx90.vtx | 3 + .../door_crans/cran_dooropen_head.mdl | 3 + .../door_crans/cran_dooropen_head.sw.vtx | 3 + .../door_crans/cran_dooropen_head.vvd | 3 + .../door_crans/cran_dooropen_int.dx80.vtx | 3 + .../door_crans/cran_dooropen_int.dx90.vtx | 3 + .../door_crans/cran_dooropen_int.mdl | 3 + .../door_crans/cran_dooropen_int.sw.vtx | 3 + .../door_crans/cran_dooropen_int.vvd | 3 + sound/subway_trains/717/door_cyl/vdo2_on.mp3 | 3 + sound/subway_trains/717/door_cyl/vdo3_on.mp3 | 3 + sound/subway_trains/717/door_cyl/vdo_on.mp3 | 3 + sound/subway_trains/717/door_cyl/vdz2_on.mp3 | 3 + sound/subway_trains/717/door_cyl/vdz3_on.mp3 | 3 + sound/subway_trains/717/door_cyl/vdz_on.mp3 | 3 + 35 files changed, 2856 insertions(+), 276 deletions(-) rename lua/metrostroi/systems/{sys_81_714_pneumatic.lua => sys_81_714_new_pneumatic.lua} (73%) rename lua/metrostroi/systems/{sys_81_717_pneumatic.lua => sys_81_717_new_pneumatic.lua} (74%) create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_head.dx80.vtx create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_head.dx90.vtx create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_head.mdl create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_head.sw.vtx create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_head.vvd create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_int.dx80.vtx create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_int.dx90.vtx create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_int.mdl create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_int.sw.vtx create mode 100644 models/metrostroi_train/door_crans/cran_dooropen_int.vvd create mode 100644 sound/subway_trains/717/door_cyl/vdo2_on.mp3 create mode 100644 sound/subway_trains/717/door_cyl/vdo3_on.mp3 create mode 100644 sound/subway_trains/717/door_cyl/vdo_on.mp3 create mode 100644 sound/subway_trains/717/door_cyl/vdz2_on.mp3 create mode 100644 sound/subway_trains/717/door_cyl/vdz3_on.mp3 create mode 100644 sound/subway_trains/717/door_cyl/vdz_on.mp3 diff --git a/lua/entities/gmod_subway_81-714_lvz/cl_init.lua b/lua/entities/gmod_subway_81-714_lvz/cl_init.lua index 81e3445..1ac9bdc 100644 --- a/lua/entities/gmod_subway_81-714_lvz/cl_init.lua +++ b/lua/entities/gmod_subway_81-714_lvz/cl_init.lua @@ -407,6 +407,31 @@ for i,button in pairs(ENT.ButtonMap.AV_T.buttons) do } button.ID = "1:"..button.ID end +-- ДВР() +ENT.ButtonMap["DVR_87"] = { + pos = Vector(448,-53,-28), + ang = Angle(0,180,-5), + width = 1000, + height = 300, + scale = 0.0625, + hide=0.8, + + buttons = { + {ID = "DVRDisconnectToggle", x=0, y=0, w=1000, h=300, tooltip="", model = { + var="DVRDisconnect",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 1, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientSounds["DVRDisconnect"] = {{"DVR_disconnect",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + +ENT.ClientProps["DVR_disconnect"] = { + model = "models/metrostroi_train/81-707/cran1.mdl", + pos = Vector(431.15,-43.5,-24.7), + ang = Angle(-90,0,-90), + hideseat=0.2, +} ENT.ButtonMap["DriverValveBLTLDisconnect"] = { pos = Vector(-466,44,-18), @@ -430,6 +455,12 @@ ENT.ButtonMap["DriverValveBLTLDisconnect"] = { }}, } } +ENT.ClientProps["cran_dooropen_int"] = { + model = "models/metrostroi_train/door_crans/cran_dooropen_int.mdl", + pos = Vector(-19,-0.2,1.2), + ang = Angle(0,90,0), + hide = 1, +} ENT.ClientProps["brake_disconnect"] = { model = "models/metrostroi_train/81-707/cran1.mdl", @@ -571,6 +602,341 @@ ENT.ClientProps["door2"] = { ang = Angle(0,-90,0), hide=2, } +--Выключение дверей () +ENT.ButtonMap["Doors1_2_left"] = { + pos = Vector(-387,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod4Set",x=304,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd4Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr1_2_lft"] = { + pos = Vector(-317.5,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + --hide = 1 + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK4Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK4",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors3_4_left"] = { + pos = Vector(-156.5,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod3Set",x=300,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd3Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr3_4_lft"] = { + pos = Vector(-87.4,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + --hide = 0.8 + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK3Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK3",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors5_6_left"] = { + pos = Vector(73,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod2Set",x=304,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd2Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr5_6_lft"] = { + pos = Vector(142.7,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + --hide = 0.8 + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK2Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK2",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors7_8_left"] = { + pos = Vector(302,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod1Set",x=312,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd1Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr7_8_lft"] = { + pos = Vector(372.8,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + --hide = 0.8 + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK1Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK1",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors1_2_right"] = { + pos = Vector(-389,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod5Set",x=324,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd5Set",x=0,y=0,w= 100,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr1_2_rgh"] = { + pos = Vector(-317.5,64.45,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK5Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK5",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors3_4_right"] = { + pos = Vector(-156.6,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod6Set",x=298,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd6Set",x=0,y=0,w= 100,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr3_4_rgh"] = { + pos = Vector(-87.5,64.45,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK6Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK6",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors5_6_right"] = { + pos = Vector(72,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod7Set",x=312,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd7Set",x=0,y=0,w= 100,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr5_6_rgh"] = { + pos = Vector(142.56,64.5,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK7Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK7",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors7_8_right"] = { + pos = Vector(302,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod8Set",x=314,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd8Set",x=0,y=0,w= 100,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr7_8_rgh"] = { + pos = Vector(372.7,64.5,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK8Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK8",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["DoorReleaseRight"] = { + pos = Vector(284,-62,15), + ang = Angle(0,180,90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseRightToggle",x=0,y=0,w= 100,h = 40,tooltip="",model = { + var="DoorReleaseRight",sndid="doorsmanual_r", + sndvol = 1,snd = function(val) return "disconnect_valve" end, + sndmin = 90,sndmax = 1e3,sndang = Angle(-90,0,0),}}, + } +} +ENT.ClientProps["doorsmanual_r"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(282,-62.5,13.5), + ang = Angle(180,180,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseRight"] = {{"doorsmanual_r",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + + +ENT.ButtonMap["DoorReleaseLeft"] = { + pos = Vector(274,62,15), + ang = Angle(0,0,90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseLeftToggle",x=0,y=0,w= 100,h = 40,tooltip="",model = { + var="DoorReleaseLeft",sndid="doorsmanual_l", + sndvol = 1,snd = function(val) return "disconnect_valve" end, + sndmin = 90,sndmax = 1e3,sndang = Angle(-90,0,0),}}, + } +} +ENT.ClientProps["doorsmanual_l"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(282,62,12.5), + ang = Angle(0,0,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseLeft"] = {{"doorsmanual_l",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} -------------------------------------------------------------------------------- ENT.ClientPropsInitialized = false @@ -906,6 +1272,12 @@ function ENT:Think() self.ClientEnts.seats_new_cap:SetSubMaterial(0,self.NewBlueSeats and "models/metrostroi_train/81-717/interior_kvr_blue" or "") end end + --() + local DrawDVR = self:GetPackedBool("CouchCap") + self:ShowHide("DVR_disconnect",DrawDVR) + self:HidePanel("DVR_87",not DrawDVR) + self:Animate("DVR_disconnect",self:GetPackedBool("DVRDisconnect") and 1 or 0,0.25,0, 4,false) + --() local Bortlamp_w = self:Animate("Bortlamp_w",self:GetPackedBool("DoorsW") and 1 or 0,0,1,16,false) local Bortlamp_g = self:Animate("Bortlamp_g",self:GetPackedBool("GRP") and 1 or 0,0,1,16,false) @@ -1007,6 +1379,8 @@ function ENT:Think() self:Animate("RearBrake", self:GetNW2Bool("RbI") and 0 or 1,0,1, 3, false) self:Animate("RearTrain", self:GetNW2Bool("RtI") and 1 or 0,0,1, 3, false) self:Animate("ParkingBrake", self:GetPackedBool("ParkingBrake") and 1 or 0,1,0, 3, false) + self:Animate("doorsmanual_r", self:GetNW2Bool("DoorReleaseRight") and 0 or 1, 0.25,0, 128, 3,false) + self:Animate("doorsmanual_l", self:GetNW2Bool("DoorReleaseLeft") and 0 or 1, 0.25,0, 128, 3,false) -- Main switch if self.LastGVValue ~= self:GetPackedBool("GV") then @@ -1018,42 +1392,46 @@ function ENT:Think() if not self.DoorStates then self.DoorStates = {} end if not self.DoorLoopStates then self.DoorLoopStates = {} end + if not self.DSprev then self.DSprev = {{},{},{},{}} end + if not self.DoorDelta then self.DoorDelta = {{0.0,0.0},{0.0,0.0},{0.0,0.0},{0.0,0.0}} end for i=0,3 do for k=0,1 do local st = k==1 and "DoorL" or "DoorR" - local doorstate = self:GetPackedBool(st) local id,sid = st..(i+1),"door"..i.."x"..k local state = self:GetPackedRatio(id) - --print(state,self.DoorStates[state]) - if (state ~= 1 and state ~= 0) ~= self.DoorStates[id] then - if doorstate and state < 1 or not doorstate and state > 0 then - else - if state > 0 then - self:PlayOnce(sid.."o","",1,math.Rand(0.8,1.2)) - else - self:PlayOnce(sid.."c","",1,math.Rand(0.8,1.2)) - end - end - self.DoorStates[id] = (state ~= 1 and state ~= 0) - end - if (state ~= 1 and state ~= 0) then + local prevstate = self.DSprev[i+1][k+1] + if (prevstate ~= state) then self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) + 2*self.DeltaTime,0,1) - else - self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) - 6*self.DeltaTime,0,1) - end + self.DoorDelta[i+1][k+1] = 0.0 + else + if self.DoorDelta[i+1][k+1] < 0.2 then + self.DoorDelta[i+1][k+1] = self.DoorDelta[i+1][k+1] + self.DeltaTime + else + self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) - 1.2*self.DeltaTime,0,1) + end + end + self.DSprev[i+1][k+1] = state self:SetSoundState(sid.."r",self.DoorLoopStates[id],0.8+self.DoorLoopStates[id]*0.2) - local n_l = "door"..i.."x"..k--.."a" - --local n_r = "door"..i.."x"..k.."b" + local n_l = "door"..i.."x"..k local dlo = 1 - --local dro = 1 + local drcsing = state-(self.Anims[n_l] and self.Anims[n_l].oldival or 0) < 0 if self.Anims[n_l] then dlo = math.abs(state-(self.Anims[n_l] and self.Anims[n_l].oldival or 0)) if dlo <= 0 and self.Anims[n_l].oldspeed then dlo = self.Anims[n_l].oldspeed/14 end end - self:Animate(n_l,state,0,0.95, dlo*14,false)--0.8 + (-0.2+0.4*math.random()),0) - --self:Animate(n_r,state,0,1, dlo*14,false)--0.8 + (-0.2+0.4*math.random()),0) + local retval = self:Animate(n_l,state,0,0.95, math.max(0.15, drcsing and state < 0.03 and dlo > 0 and 1 or dlo*14),false) + if (retval ~= 0.95 and retval ~= 0) ~= self.DoorStates[id] then + if retval == 0.95 then + self:PlayOnce(sid.."o","",1,math.Rand(0.8,1.2)) + elseif retval == 0 then + self:PlayOnce(sid.."c","",1,math.Rand(0.8,1.2)) + end + self.DoorStates[id] = (retval ~= 0.95 and retval ~= 0) + end end end + self:SetSoundState("releasedr",-0.5*(self:GetPackedRatio("RightDoorCloseCylPressure_dPdT",0) + 0.8),1) + self:SetSoundState("releasedl",-0.5*(self:GetPackedRatio("LeftDoorCloseCylPressure_dPdT",0) + 0.8),1) local dT = self.DeltaTime --self.TunnelCoeff = 0.8 diff --git a/lua/entities/gmod_subway_81-714_lvz/init.lua b/lua/entities/gmod_subway_81-714_lvz/init.lua index 6979a89..135706e 100644 --- a/lua/entities/gmod_subway_81-714_lvz/init.lua +++ b/lua/entities/gmod_subway_81-714_lvz/init.lua @@ -6,8 +6,8 @@ ENT.BogeyDistance = 650 -- Needed for gm trainspawner ENT.SyncTable = { "A53","A56","A54","A24","A39","A23","A14","A13","A31","A32","A16","A12","A49","A15","A27","A50","A8","A52","A19","A10","A22","A30","A1","A2","A3","A4","A5","A6","A72","A38","A20","A25","A37","A55","A45","A66","A51","A65","A28", "A70","A81","A80","A18", - "VB","GV", - "DriverValveBLDisconnect","DriverValveTLDisconnect","ParkingBrake", + "VB","GV","IDLK1","IDLK2","IDLK3","IDLK4","IDLK5","IDLK6","IDLK7","IDLK8", + "DriverValveBLDisconnect","DriverValveTLDisconnect","ParkingBrake","DVRDisconnect","DoorReleaseLeft","DoorReleaseRight", "A84","BPSNon","ConverterProtection","L_1","Start","VozvratRP","EmergencyBrakeValve" } @@ -145,6 +145,22 @@ function ENT:Initialize() self:SetNW2Int("BPSNType",self.BPSNType) self.OldTexture = 0 + self.OldPedestrianCount = 0 + + self.d_slow_speeds = { + {0.4, 0.8}, + --{0.3, 0.4}, + --{0.2, 0.3}, + --{0.3, 0.4}, + --{0.2, 0.3}, + } + self.d_fast_speeds = { + {1.2, 1.8}, + --{1.7, 1.8}, + --{1.8, 1.9}, + --{1.7, 1.8}, + --{2.1, 2.2}, + } self.Lamps = { broken = {}, } @@ -235,6 +251,11 @@ function ENT:TrainSpawnerUpdate() self.CompressorEfficiency = math.random()*0.05 + 0.02 self.AirConsumeRatio = math.random()*0.04 + 0.06 self.AirLeakRatio = math.random()*0.002 + 0.001 + self.DVRLag = math.random()*0.5 + self.DVRHiss = math.random(2,5) + self.d_speeds = nil + self.DoorSpeedsDone = false + self.StuckSet = nil math.randomseed(num+817171) local kvr=false @@ -365,7 +386,29 @@ function ENT:Think() (Pneumatic.RightDoorState[3] > 0.5) or (Pneumatic.RightDoorState[4] > 0.5) - --self:SetPackedRatio("Crane", Pneumatic.RealDriverValvePosition) + if self.Speed > 1 and not self.LeftDoorsOpen and not self.RightDoorsOpen and not self.PedChecked then + self.OldPedestrianCount = self:GetNW2Float("PassengerCount") + self.PedChecked = true + self.left_side = nil + self.StuckSet = false + end + if not self.StuckSet then + local passenger_count = self:GetNW2Float("PassengerCount") + if self.Speed < 1 and math.abs(self.OldPedestrianCount - passenger_count) >= 1 and self.left_side == nil then + self.OldPedestrianCount = self:GetNW2Float("PassengerCount") + self.left_side = self.Pneumatic.DoorLeft or false + self.PedChecked = false + end + if self.left_side ~= nil then + if not (self.Pneumatic.DoorLeft or self.Pneumatic.DoorRight) then + local luava = math.random() + self["CanStuckPassenger"..(self.left_side and "Left" or "Right")] = (1-passenger_count/200) < luava and luava < 1 and 1--0.912 < luava and luava < 0.987 + self.StuckSet = true + if self.CanStuckPassengerLeft or self.CanStuckPassengerRight then print(self,"passenger to be caught! :D") end + end + end + end + --self:SetPackedRatio("Crane", Pneumatic.RealDriverValvePosition) --self:SetPackedRatio("Controller", (self.KV.ControllerPosition+3)/7) if Pneumatic.ValveType == 1 then self:SetPackedRatio("BLPressure", Pneumatic.ReservoirPressure/16.0) @@ -458,7 +501,7 @@ function ENT:OnButtonPress(button,ply) if self.CouchCap and self.Pneumatic.DriverValvePosition>2 then return end self.CouchCap = not self.CouchCap end - if not self.CouchCap and (not button:find("VB") and not button:find("GV") and not button:find("Isolation") and not button:find("Parking") and not button:find("Air")) then return true end + --if not self.CouchCap and (not button:find("VB") and not button:find("GV") and not button:find("Isolation") and not button:find("Parking") and not button:find("Air")) then return true end if button == "DriverValveDisconnect" then if self.DriverValveBLDisconnect.Value == 0 or self.DriverValveTLDisconnect.Value == 0 then diff --git a/lua/entities/gmod_subway_81-714_lvz/shared.lua b/lua/entities/gmod_subway_81-714_lvz/shared.lua index 07ebda7..2a4242d 100644 --- a/lua/entities/gmod_subway_81-714_lvz/shared.lua +++ b/lua/entities/gmod_subway_81-714_lvz/shared.lua @@ -196,6 +196,16 @@ function ENT:InitializeSounds() self.SoundNames["release2"] = {loop=true,"subway_trains/common/pneumatic/release_low.wav"} self.SoundPositions["release2"] = {350,1e9,Vector(-183,0,-70),0.4} + self.SoundNames["releasedl"] = {loop=true,"subway_trains/717/door_cyl/vdo_on.mp3"} + self.SoundPositions["releasedl"] = {150,20,Vector(282,62,12.5),1.5} + self.SoundNames["releasedr"] = {loop=true,"subway_trains/717/door_cyl/vdo2_on.mp3"} + self.SoundPositions["releasedr"] = {150,20,Vector(281,-62,12.8),1.5} + + self.SoundNames["dcyl_op_exh"] = "subway_trains/common/pneumatic/parking_brake_stop2.mp3" + self.SoundNames["dcyl_cl_exh"] = self.SoundNames["dcyl_op_exh"] + self.SoundPositions["dcyl_op_exh"] = {480,1e9,Vector(-420,45,-30),0.4} + self.SoundPositions["dcyl_cl_exh"] = {480,1e9,Vector(-420,45,-30),1.2} + self.SoundNames["parking_brake"] = {loop=true,"subway_trains/common/pneumatic/parking_brake.wav"} self.SoundNames["parking_brake_en"] = "subway_trains/common/pneumatic/parking_brake_stop.mp3" self.SoundNames["parking_brake_rel"] = "subway_trains/common/pneumatic/parking_brake_stop2.mp3" @@ -343,7 +353,7 @@ function ENT:InitializeSystems() -- Панель управления 81-710 self:LoadSystem("Panel","81_714_Panel") -- Пневмосистема 81-710 - self:LoadSystem("Pneumatic","81_714_Pneumatic",{br013_1 = true}) + self:LoadSystem("Pneumatic","81_714_NewPneumatic",{br013_1 = true}) -- Everything else self:LoadSystem("Battery") self:LoadSystem("PowerSupply","BPSN") diff --git a/lua/entities/gmod_subway_81-714_mvm/cl_init.lua b/lua/entities/gmod_subway_81-714_mvm/cl_init.lua index 974d47c..eb199ac 100644 --- a/lua/entities/gmod_subway_81-714_mvm/cl_init.lua +++ b/lua/entities/gmod_subway_81-714_mvm/cl_init.lua @@ -410,6 +410,31 @@ for i,button in pairs(ENT.ButtonMap.AV_T.buttons) do } button.ID = "1:"..button.ID end +-- ДВР() +ENT.ButtonMap["DVR_87"] = { + pos = Vector(448,-53,-28), + ang = Angle(0,180,-5), + width = 1000, + height = 300, + scale = 0.0625, + hide=0.8, + + buttons = { + {ID = "DVRDisconnectToggle", x=0, y=0, w=1000, h=300, tooltip="", model = { + var="DVRDisconnect",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 1, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientSounds["DVRDisconnect"] = {{"DVR_disconnect",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + +ENT.ClientProps["DVR_disconnect"] = { + model = "models/metrostroi_train/81-707/cran1.mdl", + pos = Vector(431.15,-43.5,-24.7), + ang = Angle(-90,0,-90), + hideseat=0.2, +} ENT.ButtonMap["DriverValveBLTLDisconnect"] = { pos = Vector(-466,44,-18), @@ -433,6 +458,12 @@ ENT.ButtonMap["DriverValveBLTLDisconnect"] = { }}, } } +ENT.ClientProps["cran_dooropen_int"] = { + model = "models/metrostroi_train/door_crans/cran_dooropen_int.mdl", + pos = Vector(-19,-0.2,1.2), + ang = Angle(0,90,0), + hide = 1, +} ENT.ClientProps["brake_disconnect"] = { model = "models/metrostroi_train/81-707/cran1.mdl", @@ -580,6 +611,342 @@ ENT.ClientProps["door2"] = { hide=2, } +--Выключение дверей () +ENT.ButtonMap["Doors1_2_left"] = { + pos = Vector(-387,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod4Set",x=304,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd4Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr1_2_lft"] = { + pos = Vector(-317.5,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + --hide = 1 + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK4Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK4",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors3_4_left"] = { + pos = Vector(-156.5,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod3Set",x=300,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd3Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr3_4_lft"] = { + pos = Vector(-87.4,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + --hide = 0.8 + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK3Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK3",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors5_6_left"] = { + pos = Vector(73,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod2Set",x=304,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd2Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr5_6_lft"] = { + pos = Vector(142.7,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + --hide = 0.8 + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK2Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK2",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors7_8_left"] = { + pos = Vector(302,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod1Set",x=312,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd1Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr7_8_lft"] = { + pos = Vector(372.8,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + --hide = 0.8 + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK1Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK1",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors1_2_right"] = { + pos = Vector(-389,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod5Set",x=324,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd5Set",x=0,y=0,w= 100,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr1_2_rgh"] = { + pos = Vector(-317.5,64.45,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK5Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK5",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors3_4_right"] = { + pos = Vector(-156.6,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod6Set",x=298,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd6Set",x=0,y=0,w= 100,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr3_4_rgh"] = { + pos = Vector(-87.5,64.45,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK6Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK6",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors5_6_right"] = { + pos = Vector(72,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod7Set",x=312,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd7Set",x=0,y=0,w= 100,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr5_6_rgh"] = { + pos = Vector(142.56,64.5,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK7Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK7",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors7_8_right"] = { + pos = Vector(302,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "iod8Set",x=314,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "icd8Set",x=0,y=0,w= 100,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr7_8_rgh"] = { + pos = Vector(372.7,64.5,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "IDLK8Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="IDLK8",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["DoorReleaseRight"] = { + pos = Vector(284,-62,15), + ang = Angle(0,180,90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseRightToggle",x=0,y=0,w= 100,h = 40,tooltip="",model = { + var="DoorReleaseRight",sndid="doorsmanual_r", + sndvol = 1,snd = function(val) return "disconnect_valve" end, + sndmin = 90,sndmax = 1e3,sndang = Angle(-90,0,0),}}, + } +} +ENT.ClientProps["doorsmanual_r"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(282,-62.5,13.5), + ang = Angle(180,180,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseRight"] = {{"doorsmanual_r",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + + +ENT.ButtonMap["DoorReleaseLeft"] = { + pos = Vector(274,62,15), + ang = Angle(0,0,90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseLeftToggle",x=0,y=0,w= 100,h = 40,tooltip="",model = { + var="DoorReleaseLeft",sndid="doorsmanual_l", + sndvol = 1,snd = function(val) return "disconnect_valve" end, + sndmin = 90,sndmax = 1e3,sndang = Angle(-90,0,0),}}, + } +} +ENT.ClientProps["doorsmanual_l"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(282,62,12.5), + ang = Angle(0,0,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseLeft"] = {{"doorsmanual_l",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + -------------------------------------------------------------------------------- ENT.ClientPropsInitialized = false @@ -934,6 +1301,12 @@ function ENT:Think() self.ClientEnts.schemes:SetSubMaterial(1,scheme and scheme[1]) self.PassSchemesDone = true end + --() + local DrawDVR = self:GetPackedBool("CouchCap") + self:ShowHide("DVR_disconnect",DrawDVR) + self:HidePanel("DVR_87",not DrawDVR) + self:Animate("DVR_disconnect",self:GetPackedBool("DVRDisconnect") and 1 or 0,0.25,0, 4,false) + --() local Bortlamp_w = self:Animate("Bortlamp_w",self:GetPackedBool("DoorsW") and 1 or 0,0,1,16,false) local Bortlamp_g = self:Animate("Bortlamp_g",self:GetPackedBool("GRP") and 1 or 0,0,1,16,false) @@ -1053,13 +1426,13 @@ function ENT:Think() self:PlayOnce("door2","bass",self.Door2 and 1 or 0) end - - self:Animate("FrontBrake", self:GetNW2Bool("FbI") and 0 or 1,0,1, 3, false) self:Animate("FrontTrain", self:GetNW2Bool("FtI") and 1 or 0,0,1, 3, false) self:Animate("RearBrake", self:GetNW2Bool("RbI") and 0 or 1,0,1, 3, false) self:Animate("RearTrain", self:GetNW2Bool("RtI") and 1 or 0,0,1, 3, false) self:Animate("ParkingBrake", self:GetPackedBool("ParkingBrake") and 1 or 0,1,0, 3, false) + self:Animate("doorsmanual_r", self:GetNW2Bool("DoorReleaseRight") and 0 or 1, 0.25,0, 128, 3,false) + self:Animate("doorsmanual_l", self:GetNW2Bool("DoorReleaseLeft") and 0 or 1, 0.25,0, 128, 3,false) -- Main switch if self.LastGVValue ~= self:GetPackedBool("GV") then @@ -1071,42 +1444,46 @@ function ENT:Think() if not self.DoorStates then self.DoorStates = {} end if not self.DoorLoopStates then self.DoorLoopStates = {} end + if not self.DSprev then self.DSprev = {{},{},{},{}} end + if not self.DoorDelta then self.DoorDelta = {{0.0,0.0},{0.0,0.0},{0.0,0.0},{0.0,0.0}} end for i=0,3 do for k=0,1 do local st = k==1 and "DoorL" or "DoorR" - local doorstate = self:GetPackedBool(st) local id,sid = st..(i+1),"door"..i.."x"..k local state = self:GetPackedRatio(id) - --print(state,self.DoorStates[state]) - if (state ~= 1 and state ~= 0) ~= self.DoorStates[id] then - if doorstate and state < 1 or not doorstate and state > 0 then - else - if state > 0 then - self:PlayOnce(sid.."o","",1,math.Rand(0.8,1.2)) - else - self:PlayOnce(sid.."c","",1,math.Rand(0.8,1.2)) - end - end - self.DoorStates[id] = (state ~= 1 and state ~= 0) - end - if (state ~= 1 and state ~= 0) then + local prevstate = self.DSprev[i+1][k+1] + if (prevstate ~= state) then self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) + 2*self.DeltaTime,0,1) - else - self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) - 6*self.DeltaTime,0,1) - end + self.DoorDelta[i+1][k+1] = 0.0 + else + if self.DoorDelta[i+1][k+1] < 0.2 then + self.DoorDelta[i+1][k+1] = self.DoorDelta[i+1][k+1] + self.DeltaTime + else + self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) - 1.2*self.DeltaTime,0,1) + end + end + self.DSprev[i+1][k+1] = state self:SetSoundState(sid.."r",self.DoorLoopStates[id],0.8+self.DoorLoopStates[id]*0.2) - local n_l = "door"..i.."x"..k--.."a" - --local n_r = "door"..i.."x"..k.."b" + local n_l = "door"..i.."x"..k local dlo = 1 - --local dro = 1 + local drcsing = state-(self.Anims[n_l] and self.Anims[n_l].oldival or 0) < 0 if self.Anims[n_l] then dlo = math.abs(state-(self.Anims[n_l] and self.Anims[n_l].oldival or 0)) if dlo <= 0 and self.Anims[n_l].oldspeed then dlo = self.Anims[n_l].oldspeed/14 end end - self:Animate(n_l,state,0,0.95, dlo*14,false)--0.8 + (-0.2+0.4*math.random()),0) - --self:Animate(n_r,state,0,1, dlo*14,false)--0.8 + (-0.2+0.4*math.random()),0) + local retval = self:Animate(n_l,state,0,0.95, math.max(0.15, drcsing and state < 0.03 and dlo > 0 and 1 or dlo*14),false) + if (retval ~= 0.95 and retval ~= 0) ~= self.DoorStates[id] then + if retval == 0.95 then + self:PlayOnce(sid.."o","",1,math.Rand(0.8,1.2)) + elseif retval == 0 then + self:PlayOnce(sid.."c","",1,math.Rand(0.8,1.2)) + end + self.DoorStates[id] = (retval ~= 0.95 and retval ~= 0) + end end end + self:SetSoundState("releasedr",-0.5*(self:GetPackedRatio("RightDoorCloseCylPressure_dPdT",0) + 0.8),1) + self:SetSoundState("releasedl",-0.5*(self:GetPackedRatio("LeftDoorCloseCylPressure_dPdT",0) + 0.8),1) local dT = self.DeltaTime local rollingi = math.min(1,self.TunnelCoeff+math.Clamp((self.StreetCoeff-0.82)/0.3,0,1)) diff --git a/lua/entities/gmod_subway_81-714_mvm/init.lua b/lua/entities/gmod_subway_81-714_mvm/init.lua index 43b0a1f..797c9ee 100644 --- a/lua/entities/gmod_subway_81-714_mvm/init.lua +++ b/lua/entities/gmod_subway_81-714_mvm/init.lua @@ -9,8 +9,8 @@ ENT.SyncTable = { "A22","A30","A1","A2","A3","A4","A5","A6","A72","A38","A20", "A25","A37","A55","A45","A66","A51","A65","A28","A70","AV2", "AV3","AV4","AV5","A81","AV6","A80","A18", - "VB","GV", - "DriverValveBLDisconnect","DriverValveTLDisconnect","ParkingBrake", + "VB","GV","IDLK1","IDLK2","IDLK3","IDLK4","IDLK5","IDLK6","IDLK7","IDLK8", + "DriverValveBLDisconnect","DriverValveTLDisconnect","ParkingBrake","DVRDisconnect","DoorReleaseLeft","DoorReleaseRight", "A84","BPSNon","ConverterProtection","L_1","OtklBV","Start","VozvratRP","EmergencyBrakeValve" } @@ -142,9 +142,25 @@ function ENT:Initialize() [31] = 32, -- Doors L<->R } + self.OldPedestrianCount = 0 + self.Lamps = { broken = {}, } + self.d_slow_speeds = { + {0.4, 0.8}, + --{0.3, 0.4}, + --{0.2, 0.3}, + --{0.3, 0.4}, + --{0.2, 0.3}, + } + self.d_fast_speeds = { + {1.2, 1.8}, + --{1.7, 1.8}, + --{1.8, 1.9}, + --{1.7, 1.8}, + --{2.1, 2.2}, + } local rand = math.random() > 0.8 and 1 or math.random(0.95,0.99) for i = 1,27 do if math.random() > rand then self.Lamps.broken[i] = math.random() > 0.5 end @@ -239,6 +255,9 @@ function ENT:TrainSpawnerUpdate() self.CompressorEfficiency = math.random()*0.05 + 0.02 self.AirConsumeRatio = math.random()*0.04 + 0.06 self.AirLeakRatio = math.random()*0.002 + 0.001 + self.DVRLag = math.random()*0.5 + self.DVRHiss = math.random(2,5) + self.d_speeds = nil if self.CustomSettings then local dot5 = self:GetNW2Int("Type")==2 @@ -296,6 +315,9 @@ function ENT:TrainSpawnerUpdate() self.Pneumatic.ValveType = self:GetNW2Int("Crane",1) self.Announcer.AnnouncerType = self:GetNW2Int("Announcer",1) + self.DoorSpeedsDone = false + self.StuckSet = nil + self.WorkingLights = 6 self:SetPackedBool("Crane013",self.Pneumatic.ValveType == 2) self:UpdateTextures() @@ -356,6 +378,28 @@ function ENT:Think() (Pneumatic.RightDoorState[3] > 0.5) or (Pneumatic.RightDoorState[4] > 0.5) + if self.Speed > 1 and not self.LeftDoorsOpen and not self.RightDoorsOpen and not self.PedChecked then + self.OldPedestrianCount = self:GetNW2Float("PassengerCount") + self.PedChecked = true + self.left_side = nil + self.StuckSet = false + end + if not self.StuckSet then + local passenger_count = self:GetNW2Float("PassengerCount") + if self.Speed < 1 and math.abs(self.OldPedestrianCount - passenger_count) >= 1 and self.left_side == nil then + self.OldPedestrianCount = self:GetNW2Float("PassengerCount") + self.left_side = self.Pneumatic.DoorLeft or false + self.PedChecked = false + end + if self.left_side ~= nil then + if not (self.Pneumatic.DoorLeft or self.Pneumatic.DoorRight) then + local luava = math.random() + self["CanStuckPassenger"..(self.left_side and "Left" or "Right")] = (1-passenger_count/200) < luava and luava < 1 and 1--0.912 < luava and luava < 0.987 + self.StuckSet = true + if self.CanStuckPassengerLeft or self.CanStuckPassengerRight then print(self,"passenger to be caught! :D") end + end + end + end --self:SetPackedRatio("Crane", Pneumatic.RealDriverValvePosition) --self:SetPackedRatio("Controller", (self.KV.ControllerPosition+3)/7) if Pneumatic.ValveType == 1 then @@ -485,7 +529,7 @@ function ENT:OnButtonPress(button,ply) if self.CouchCap and self.Pneumatic.DriverValvePosition>2 then return end self.CouchCap = not self.CouchCap end - if not self.CouchCap and (not button:find("VB") and not button:find("GV") and not button:find("Isolation") and not button:find("Parking") and not button:find("Air")) then return true end + --if not self.CouchCap and (not button:find("VB") and not button:find("GV") and not button:find("Isolation") and not button:find("Parking") and not button:find("Air")) then return true end if button == "DriverValveDisconnect" then if self.DriverValveBLDisconnect.Value == 0 or self.DriverValveTLDisconnect.Value == 0 then diff --git a/lua/entities/gmod_subway_81-714_mvm/shared.lua b/lua/entities/gmod_subway_81-714_mvm/shared.lua index 07c2efd..9afa4a9 100644 --- a/lua/entities/gmod_subway_81-714_mvm/shared.lua +++ b/lua/entities/gmod_subway_81-714_mvm/shared.lua @@ -216,6 +216,16 @@ function ENT:InitializeSounds() self.SoundNames["release2"] = {loop=true,"subway_trains/common/pneumatic/release_low.wav"} self.SoundPositions["release2"] = {350,1e9,Vector(-183,0,-70),0.4} + self.SoundNames["releasedl"] = {loop=true,"subway_trains/717/door_cyl/vdo_on.mp3"} + self.SoundPositions["releasedl"] = {150,20,Vector(282,62,12.5),1.5} + self.SoundNames["releasedr"] = {loop=true,"subway_trains/717/door_cyl/vdo2_on.mp3"} + self.SoundPositions["releasedr"] = {150,20,Vector(281,-62,12.8),1.5} + + self.SoundNames["dcyl_op_exh"] = "subway_trains/common/pneumatic/parking_brake_stop2.mp3" + self.SoundNames["dcyl_cl_exh"] = self.SoundNames["dcyl_op_exh"] + self.SoundPositions["dcyl_op_exh"] = {480,1e9,Vector(-420,45,-30),0.4} + self.SoundPositions["dcyl_cl_exh"] = {480,1e9,Vector(-420,45,-30),1.2} + self.SoundNames["parking_brake"] = {loop=true,"subway_trains/common/pneumatic/parking_brake.wav"} self.SoundNames["parking_brake_en"] = "subway_trains/common/pneumatic/parking_brake_stop.mp3" self.SoundNames["parking_brake_rel"] = "subway_trains/common/pneumatic/parking_brake_stop2.mp3" @@ -360,7 +370,7 @@ function ENT:InitializeSystems() -- Панель управления 81-710 self:LoadSystem("Panel","81_714_Panel") -- Пневмосистема 81-710 - self:LoadSystem("Pneumatic","81_714_Pneumatic",{br013_1 = true}) + self:LoadSystem("Pneumatic","81_714_NewPneumatic",{br013_1 = true}) -- Everything else self:LoadSystem("Battery") self:LoadSystem("PowerSupply","BPSN") diff --git a/lua/entities/gmod_subway_81-717_lvz/cl_init.lua b/lua/entities/gmod_subway_81-717_lvz/cl_init.lua index 00681ce..dc0a3c1 100644 --- a/lua/entities/gmod_subway_81-717_lvz/cl_init.lua +++ b/lua/entities/gmod_subway_81-717_lvz/cl_init.lua @@ -2393,6 +2393,12 @@ ENT.ClientProps["gv_wrench"] = { hide = 0.5, } +ENT.ClientProps["cran_dooropen_head"] = { + model = "models/metrostroi_train/door_crans/cran_dooropen_head.mdl", + pos = Vector(5,0.15,1), + ang = Angle(0,-90,0), + hide = 1, +} ENT.ClientProps["parking_brake"] = { model = "models/metrostroi_train/81-707/cran3.mdl", @@ -2428,9 +2434,34 @@ ENT.ButtonMap["AutostopValve"] = { screenHide = true, buttons = { - {ID = "AutostopValveSet",x=0,y=0,w= 130,h = 40,tooltip="Сорвать срывной клапан"}, + {ID = "AutostopValveSet",x=0,y=0,w= 130,h = 40,tooltip=""}, } } +-- ДВР () +ENT.ButtonMap["DVR_87"] = { + pos = Vector(-398,35,-28), + ang = Angle(0,180,5), + width = 1000, + height = 300, + scale = 0.0625, + hide=0.8, + + buttons = { + {ID = "DVRDisconnectToggle", x=0, y=0, w=1000, h=300, tooltip="", model = { + var="DVRDisconnect",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 1, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientSounds["DVRDisconnect"] = {{"DVR_disconnect",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + +ENT.ClientProps["DVR_disconnect"] = { + model = "models/metrostroi_train/81-707/cran1.mdl", + pos = Vector(-451.15,43.5,-24.7), + ang = Angle(-90,-180,-90), + hideseat=0.2, +} for i=0,4 do ENT.ClientProps["TrainNumberL"..i] = { @@ -2866,6 +2897,378 @@ for i = 0,11 do hideseat = 1.1, } end + +ENT.ButtonMap["Doors7_8_right"] = { + pos = Vector(-386,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod4Set",x=298,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd4Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr7_8_rgh"] = { + pos = Vector(-317.5,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK4Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK4",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors5_6_right"] = { + pos = Vector(-157,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod3Set",x=306,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd3Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr5_6_rgh"] = { + pos = Vector(-87.5,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK3Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK3",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors3_4_right"] = { + pos = Vector(73,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod2Set",x=302,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd2Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr3_4_rgh"] = { + pos = Vector(142.6,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK2Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK2",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors1_2_right"] = { + pos = Vector(300,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod1Set",x=334,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd1Set",x=15,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["Doors1_2_right_outer"] = { + pos = Vector(332.5,-66,47), + ang = Angle(0,0,90), + width = 120, + height = 952, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "outerhod1Set",x=10,y=0,w= 100,h = 952,tooltip=""}, + } +} +ENT.ButtonMap["bldr1_2_rgh"] = { + pos = Vector(372.8,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK1Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK1",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + +ENT.ButtonMap["Doors7_8_left"] = { + pos = Vector(-386,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod5Set",x=294,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd5Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr7_8_lft"] = { + pos = Vector(-317.58,64.45,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK5Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK5",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors5_6_left"] = { + pos = Vector(-158,62.8,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod6Set",x=314,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd6Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr5_6_lft"] = { + pos = Vector(-87.5,64.45,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK6Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK6",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors3_4_left"] = { + pos = Vector(74,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod7Set",x=294,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd7Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr3_4_lft"] = { + pos = Vector(142.56,64.5,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK7Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK7",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors1_2_left"] = { + pos = Vector(303,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod8Set",x=306,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd8Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr1_2_lft"] = { + pos = Vector(372.7,64.5,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK8Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK8",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + +ENT.ButtonMap["DoorReleaseExtra"] = { + pos = Vector(278,-62,-2), + ang = Angle(0,0,-90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseExtraToggle",x=0,y=130,w= 100,h = 30,tooltip="", model = { + var="DoorReleaseExtra",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 1, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientProps["doorsmanual_e"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(281,-62.3,12.3), + ang = Angle(0,180,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseExtra"] = {{"DoorReleaseExtra",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + + +ENT.ButtonMap["DoorReleaseRight"] = { + pos = Vector(-290,-62,14.5), + ang = Angle(0,180,90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseRightToggle",x=0,y=0,w= 100,h = 30,tooltip="", model = { + var="DoorReleaseRight",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 1, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientProps["doorsmanual_r"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(-296,-62.13,12.5), + ang = Angle(0,180,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseRight"] = {{"doorsmanual_r",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + + +ENT.ButtonMap["DoorReleaseLeft"] = { + pos = Vector(-298,62,14.5), + ang = Angle(0,0,90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseLeftToggle",x=0,y=0,w= 100,h = 30,tooltip="", model = { + var="DoorReleaseLeft",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 50, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientProps["doorsmanual_l"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(-295.9,62.5,13.59), + ang = Angle(180,0,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseLeft"] = {{"doorsmanual_l",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,90,0)}} --[[ local pos = Vector(454.3,-28.3,12+3.5) local ang = Angle(60,-30,180) @@ -3140,9 +3543,14 @@ function ENT:Think() self:Animate("voltmeter2",self:GetPackedRatio("EnginesVoltage"),0.398-0.002,0.648+0.002,nil,nil)--,256,2,0.01) self:Animate("ampermeter2",self:GetPackedRatio("EnginesCurrent"),0.398-0.009,0.648+0.008,nil,nil,256,2,0.01) self:Animate("volt1",self:GetPackedRatio("BatteryVoltage"),0.625,0.376,256,0.2,false) + ----------------- + self:Animate("doorsmanual_e", self:GetNW2Bool("DoorReleaseExtra") and 0 or 1, 0.25,0, 128, 3,false) + self:Animate("doorsmanual_r", self:GetNW2Bool("DoorReleaseRight") and 0 or 1, 0.25,0, 128, 3,false) + self:Animate("doorsmanual_l", self:GetNW2Bool("DoorReleaseLeft") and 0 or 1, 0.25,0, 128, 3,false) + ----------------- --self:Animate("voltmeter",0.5 or self:GetPackedRatio("EnginesVoltage"),0.396,0.658,nil,nil)--,256,2,0.01) --self:Animate("ampermeter",0.5 or self:GetPackedRatio("EnginesCurrent"),0.39,0.655,nil,nil,256,2,0.01) - self:Animate("stopkran", self:GetPackedBool("EmergencyBrakeValve") and 0 or 1, 0.25,0, 128, 3,false) + --self:Animate("stopkran", self:GetPackedBool("EmergencyBrakeValve") and 0 or 1, 0.25,0, 128, 3,false) self:ShowHide("SSpeed1",self:GetPackedBool("LUDS")) self:ShowHide("SSpeed2",self:GetPackedBool("LUDS")) @@ -3376,6 +3784,11 @@ function ENT:Think() self:ShowHide("EPV_disconnect",c013) self:HidePanel("EPVDisconnect",not c013) self:HidePanel("DriverValveDisconnect",not c013) + + local DrawDVR = self:GetPackedBool("ShowDVR") + self:ShowHide("DVR_disconnect",DrawDVR) + self:HidePanel("DVR_87",not DrawDVR) + self:Animate("DVR_disconnect",self:GetPackedBool("DVRDisconnect") and 1 or 0,0.25,0, 4,false) --[[ -- Animate AV switches for i in ipairs(self.Panel.AVMap) do local value = self:GetPackedBool(64+(i-1)) and 1 or 0 @@ -3391,43 +3804,54 @@ function ENT:Think() self:Animate("gv_wrench",self.LastGVValue and 1 or 0,0.5,0.9,128,1,false) self:ShowHideSmooth("gv_wrench", CurTime() < self.ResetTime and 1 or 0.1) --self:InitializeSounds() + -- reworked doors animation and sounds + local dT = self.DeltaTime if not self.DoorStates then self.DoorStates = {} end if not self.DoorLoopStates then self.DoorLoopStates = {} end - for i=0,3 do + if not self.DSprev then self.DSprev = {{},{},{},{}} end + if not self.DoorDelta then self.DoorDelta = {{0,0},{0,0},{0,0},{0,0}} end + for i=0,3 do for k=0,1 do local st = k==1 and "DoorL" or "DoorR" - local doorstate = self:GetPackedBool(st) local id,sid = st..(i+1),"door"..i.."x"..k local state = self:GetPackedRatio(id) - --print(state,self.DoorStates[state]) - if (state ~= 1 and state ~= 0) ~= self.DoorStates[id] then - if doorstate and state < 1 or not doorstate and state > 0 then - else - if state > 0 then - self:PlayOnce(sid.."o","",1,math.Rand(0.8,1.2)) - else - self:PlayOnce(sid.."c","",1,math.Rand(0.8,1.2)) - end - end - self.DoorStates[id] = (state ~= 1 and state ~= 0) - end - if (state ~= 1 and state ~= 0) then + local prevstate = self.DSprev[i+1][k+1] + + if (prevstate ~= state) then self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) + 2*self.DeltaTime,0,1) - else - self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) - 6*self.DeltaTime,0,1) - end - self:SetSoundState(sid.."r",self.DoorLoopStates[id],0.8+self.DoorLoopStates[id]*0.2) - local n_l = "door"..i.."x"..k--.."a" + self.DoorDelta[i+1][k+1] = 0.0 + else + if self.DoorDelta[i+1][k+1] < 0.2 then + self.DoorDelta[i+1][k+1] = self.DoorDelta[i+1][k+1] + self.DeltaTime + else --was 6 + self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) - 1*self.DeltaTime,0,1) + end + end + self.DSprev[i+1][k+1] = state + self:SetSoundState(sid.."r",self.DoorLoopStates[id],0.8+self.DoorLoopStates[id]*0.2) + local n_l = "door"..i.."x"..k--.."a" --local n_r = "door"..i.."x"..k.."b" local dlo = 1 + local drcsing = state-(self.Anims[n_l] and self.Anims[n_l].oldival or 0) < 0 if self.Anims[n_l] then dlo = math.abs(state-(self.Anims[n_l] and self.Anims[n_l].oldival or 0)) if dlo <= 0 and self.Anims[n_l].oldspeed then dlo = self.Anims[n_l].oldspeed/14 end end - self:Animate(n_l,state,0,0.95,dlo*14,false)--0.8 + (-0.2+0.4*math.random()),0) - --self:Animate(n_r,state,0,1,dlo*14,false)--0.8 + (-0.2+0.4*math.random()),0) + + local retval = self:Animate(n_l,state,0,0.95,math.max(0.15, drcsing and state < 0.03 and dlo > 0 and 1 or dlo*14),false) + if (retval ~= 0.95 and retval ~= 0) ~= self.DoorStates[id] then + if retval == 0.95 then -- was state > 0 + self:PlayOnce(sid.."o","",1,math.Rand(0.8,1.2)) + elseif retval == 0 then -- was else + self:PlayOnce(sid.."c","",1,math.Rand(0.8,1.2)) + end + self.DoorStates[id] = (retval ~= 0.95 and retval ~= 0) + end end end + self:SetSoundState("releasedr",-0.5*(self:GetPackedRatio("RightDoorCloseCylPressure_dPdT",0) + 0.8),1) + self:SetSoundState("releasedl",-0.5*(self:GetPackedRatio("LeftDoorCloseCylPressure_dPdT",0) + 0.8),1) + self:SetSoundState("releasede",-0.3*(self:GetPackedRatio("_1stRightDoorCloseCylPressure_dPdT",0) + 1.2),2) --[[local dT = self.DeltaTime --self.TunnelCoeff = 0.8 diff --git a/lua/entities/gmod_subway_81-717_lvz/init.lua b/lua/entities/gmod_subway_81-717_lvz/init.lua index 1021c24..07eff2f 100644 --- a/lua/entities/gmod_subway_81-717_lvz/init.lua +++ b/lua/entities/gmod_subway_81-717_lvz/init.lua @@ -17,7 +17,7 @@ ENT.SyncTable = { "A58","A59","A61","A15","A66", "RC1","VB","VRD","PB", "UAVA","UAVAC", "DriverValveBLDisconnect","DriverValveTLDisconnect","DriverValveDisconnect","ParkingBrake","EPK", - "VUD2","VDL","VOPD","Wiper", "GV", "RC2","VAU", + "VUD2","VDL","VOPD","Wiper", "GV", "RC2","VAU", "HDLK1","HDLK2","HDLK3","HDLK4","HDLK5","HDLK6","HDLK7","HDLK8","DVRDisconnect","DoorReleaseLeft","DoorReleaseRight","DoorReleaseExtra", "KH","VAV","KSZD","VZP","VSOSD", "PAM7","PAM8","PAM9","PAMLeft","PAMRight","PAM4","PAM5","PAM6","PAMUp","PAM1","PAM2","PAM3","PAMDown","PAM0","PAMEnter","PAMEsc","PAMF","PAMM","PAMP", } @@ -248,9 +248,25 @@ function ENT:Initialize() self.OtsekDoor1 = false self.OtsekDoor2 = false + self.OldPedestrianCount = 0 + self.Lamps = { broken = {}, } + self.d_slow_speeds = { + {0.4, 0.8}, + --{0.3, 0.4}, + --{0.2, 0.3}, + --{0.3, 0.4}, + --{0.2, 0.3}, + } + self.d_fast_speeds = { + {1.2, 1.8}, + --{1.7, 1.8}, + --{1.8, 1.9}, + --{1.7, 1.8}, + --{2.1, 2.2}, + } local rand = math.random() > 0.95 and 1 or math.random(0.95,0.99) for i = 1,12 do if math.random() > rand then self.Lamps.broken[i] = math.random() > 0.7 end @@ -355,6 +371,9 @@ function ENT:TrainSpawnerUpdate() self.CompressorEfficiency = math.random()*0.05 + 0.02 self.AirConsumeRatio = math.random()*0.04 + 0.06 self.AirLeakRatio = math.random()*0.002 + 0.001 + self.DVRLag = math.random()*0.5 + self.DVRHiss = math.random(2,5) + self.d_speeds = nil if typ == 1 then --PAKSDM self.Electric:TriggerInput("X2PS",0) @@ -450,6 +469,8 @@ function ENT:TrainSpawnerUpdate() self:SetNW2Bool("NewSeats",self:GetNW2Int("SeatType") == 4 or self:GetNW2Int("SeatType") == 3 or self:GetNW2Int("SeatType") == 1 and math.random()>0.5)--(kvr or seats)) self:SetNW2Bool("NewSeatsBlue",self:GetNW2Int("SeatType") == 4 or self:GetNW2Bool("NewSeats") and self:GetNW2Int("SeatType") == 1 and math.random()>0.5) end + self.StuckSet = nil + self.DoorSpeedsDone = false self.Pneumatic.ValveType = self:GetNW2Int("Crane",1)+1 self.Announcer.AnnouncerType = self:GetNW2Int("Announcer",1) self:UpdateTextures() @@ -521,6 +542,7 @@ function ENT:Think() self:SetPackedBool("RedLights",Panel.RedLight2 > 0) self:SetPackedBool("CabLights",Panel.CabLights>0) self:SetPackedBool("EqLights",Panel.EqLights>0) + self:SetPackedBool("ShowDVR",self.OtsekDoor1) self:SetPackedBool("PanelLights",Panel.PanelLights > 0.5) --[[if not self.KEKTimer or CurTime()-self.KEKTimer > 3 then @@ -602,6 +624,35 @@ function ENT:Think() (self.Pneumatic.RightDoorState[3] > 0.5) or (self.Pneumatic.RightDoorState[4] > 0.5) + if #self.WagonList == self.CarCount and not self.d_speeds then + local d_spd_type = math.random() + for k,v in ipairs(self.WagonList) do + v.d_speeds = d_spd_type < 0.5 and v.d_fast_speeds or v.d_slow_speeds + end + end + + if self.Speed > 1 and not self.LeftDoorsOpen and not self.RightDoorsOpen and not self.PedChecked then + self.OldPedestrianCount = self:GetNW2Float("PassengerCount") + self.PedChecked = true + self.left_side = nil + self.StuckSet = false + end + if not self.StuckSet then + local passenger_count = self:GetNW2Float("PassengerCount") + if self.Speed < 1 and math.abs(self.OldPedestrianCount - passenger_count) >= 1 and self.left_side == nil then + self.OldPedestrianCount = self:GetNW2Float("PassengerCount") + self.left_side = self.Pneumatic.DoorLeft or false + end + if self.left_side ~= nil then + if not (self.Pneumatic.DoorLeft or self.Pneumatic.DoorRight) then + local luava = math.random() + self["CanStuckPassenger"..(self.left_side and "Left" or "Right")] = (1-passenger_count/200)*0.8 < luava and luava < 1 and 1--0.912 < luava and luava < 0.987 + self.StuckSet = true + --if self.CanStuckPassengerLeft or self.CanStuckPassengerRight then print(self,"passenger to be caught! :D") end + end + end + end + -- DIP/power self:SetPackedBool("LUDS",Panel.LUDS > 0.5) diff --git a/lua/entities/gmod_subway_81-717_lvz/shared.lua b/lua/entities/gmod_subway_81-717_lvz/shared.lua index 83855d5..f3696cf 100644 --- a/lua/entities/gmod_subway_81-717_lvz/shared.lua +++ b/lua/entities/gmod_subway_81-717_lvz/shared.lua @@ -405,6 +405,17 @@ function ENT:InitializeSounds() self.SoundNames["release2"] = {loop=true,"subway_trains/common/pneumatic/release_low.wav"} self.SoundPositions["release2"] = {350,1e9,Vector(-183,0,-70),0.4} + self.SoundNames["releasedl"] = {loop=true,"subway_trains/717/door_cyl/vdo_on.mp3"} + self.SoundPositions["releasedl"] = {150,20,Vector(282,62,12.5),1.5} + self.SoundNames["releasedr"] = {loop=true,"subway_trains/717/door_cyl/vdo2_on.mp3"} + self.SoundPositions["releasedr"] = {150,20,Vector(281,-62,12.8),1.5} + self.SoundNames["releasede"] = {loop=true,"subway_trains/717/door_cyl/vdo3_on.mp3"} + self.SoundPositions["releasede"] = {150,20,Vector(278,-62,-2),1.5} + + self.SoundNames["dcyl_op_exh"] = "subway_trains/common/pneumatic/parking_brake_stop2.mp3" + self.SoundNames["dcyl_cl_exh"] = self.SoundNames["dcyl_op_exh"] + self.SoundPositions["dcyl_op_exh"] = {480,1e9,Vector(-420,45,-30),0.4} + self.SoundPositions["dcyl_cl_exh"] = {480,1e9,Vector(-420,45,-30),1.2} self.SoundNames["parking_brake"] = {loop=true,"subway_trains/common/pneumatic/parking_brake.wav"} self.SoundNames["parking_brake_en"] = "subway_trains/common/pneumatic/parking_brake_stop.mp3" self.SoundNames["parking_brake_rel"] = "subway_trains/common/pneumatic/parking_brake_stop2.mp3" @@ -832,7 +843,7 @@ function ENT:InitializeSystems() self:LoadSystem("PR_14X_Panels") -- Пневмосистема 81-710 - self:LoadSystem("Pneumatic","81_717_Pneumatic") + self:LoadSystem("Pneumatic","81_717_NewPneumatic") -- Панель управления 81-710 self:LoadSystem("Panel","81_717LVZ_Panel") -- Everything else @@ -1002,6 +1013,14 @@ ENT.Spawner = { if ent._SpawnerStarted~=val then ent.VB:TriggerInput("Set",val<=2 and 1 or 0) ent.ParkingBrake:TriggerInput("Set",val==3 and 1 or 0) + ent.Pneumatic.LeftDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0} + ent.Pneumatic.RightDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0} + for _i = 1,4 do + ent.Pneumatic.DSprev[_i][1] = ent.Pneumatic.RightDoorState[_i] + ent.Pneumatic.DSprev[_i][2] = ent.Pneumatic.LeftDoorState[_i] + end + ent.Pneumatic.DoorLeft = val == 4 and true or false + ent.Pneumatic.DoorRight = val == 4 and true or false if ent.AR63 then local first = i==1 or _LastSpawner~=CurTime() ent.OhrSig:TriggerInput("Set",val<4 and 1 or 0) diff --git a/lua/entities/gmod_subway_81-717_lvz_custom.lua b/lua/entities/gmod_subway_81-717_lvz_custom.lua index 4f6f1b0..4790416 100644 --- a/lua/entities/gmod_subway_81-717_lvz_custom.lua +++ b/lua/entities/gmod_subway_81-717_lvz_custom.lua @@ -75,6 +75,14 @@ ENT.Spawner = { if ent._SpawnerStarted~=val then ent.VB:TriggerInput("Set",val<=2 and 1 or 0) ent.ParkingBrake:TriggerInput("Set",val==3 and 1 or 0) + ent.Pneumatic.LeftDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0} + ent.Pneumatic.RightDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0} + for _i = 1,4 do + ent.Pneumatic.DSprev[_i][1] = ent.Pneumatic.RightDoorState[_i] + ent.Pneumatic.DSprev[_i][2] = ent.Pneumatic.LeftDoorState[_i] + end + ent.Pneumatic.DoorLeft = val == 4 and true or false + ent.Pneumatic.DoorRight = val == 4 and true or false if ent.AR63 then local first = i==1 or _LastSpawner~=CurTime() ent.OhrSig:TriggerInput("Set",val<4 and 1 or 0) diff --git a/lua/entities/gmod_subway_81-717_mvm/cl_init.lua b/lua/entities/gmod_subway_81-717_mvm/cl_init.lua index afe5a49..1814500 100644 --- a/lua/entities/gmod_subway_81-717_mvm/cl_init.lua +++ b/lua/entities/gmod_subway_81-717_mvm/cl_init.lua @@ -2048,9 +2048,34 @@ ENT.ButtonMap["AutostopValve"] = { screenHide = true, buttons = { - {ID = "AutostopValveSet",x=0,y=0,w= 130,h = 40,tooltip="Сорвать срывной клапан"}, + {ID = "AutostopValveSet",x=0,y=0,w= 130,h = 40,tooltip=""}, } } +-- ДВР () +ENT.ButtonMap["DVR_87"] = { + pos = Vector(-398,35,-28), + ang = Angle(0,180,5), + width = 1000, + height = 300, + scale = 0.0625, + hide=0.8, + + buttons = { + {ID = "DVRDisconnectToggle", x=0, y=0, w=1000, h=300, tooltip="", model = { + var="DVRDisconnect",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 1, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientSounds["DVRDisconnect"] = {{"DVR_disconnect",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + +ENT.ClientProps["DVR_disconnect"] = { + model = "models/metrostroi_train/81-707/cran1.mdl", + pos = Vector(-451.15,43.5,-24.7), + ang = Angle(-90,-180,-90), + hideseat=0.2, +} for i=0,4 do ENT.ClientProps["TrainNumberL"..i] = { @@ -2116,6 +2141,13 @@ ENT.ClientProps["route2"] = { end, } +ENT.ClientProps["cran_dooropen_head"] = { + model = "models/metrostroi_train/door_crans/cran_dooropen_head.mdl", + pos = Vector(5,0.15,1), + ang = Angle(0,-90,0), + hide = 1, +} + ENT.ButtonMap["CabinDoor"] = { pos = Vector(414.5,64,56.7), ang = Angle(0,0,90), @@ -2555,6 +2587,378 @@ for i = 0,24 do hideseat = 1.1, } end + +ENT.ButtonMap["Doors7_8_right"] = { + pos = Vector(-386,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod4Set",x=298,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd4Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr7_8_rgh"] = { + pos = Vector(-317.5,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK4Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK4",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors5_6_right"] = { + pos = Vector(-157,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod3Set",x=306,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd3Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr5_6_rgh"] = { + pos = Vector(-87.5,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK3Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK3",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors3_4_right"] = { + pos = Vector(73,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod2Set",x=302,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd2Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr3_4_rgh"] = { + pos = Vector(142.6,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK2Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK2",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors1_2_right"] = { + pos = Vector(300,-62,-50), + ang = Angle(0,0,-90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod1Set",x=334,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd1Set",x=15,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["Doors1_2_right_outer"] = { + pos = Vector(332.5,-66,47), + ang = Angle(0,0,90), + width = 120, + height = 952, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "outerhod1Set",x=10,y=0,w= 100,h = 952,tooltip=""}, + } +} +ENT.ButtonMap["bldr1_2_rgh"] = { + pos = Vector(372.8,-64.48,-50), + ang = Angle(0,90,-90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK1Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK1",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + +ENT.ButtonMap["Doors7_8_left"] = { + pos = Vector(-386,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod5Set",x=294,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd5Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr7_8_lft"] = { + pos = Vector(-317.58,64.45,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK5Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK5",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors5_6_left"] = { + pos = Vector(-158,62.8,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod6Set",x=314,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd6Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr5_6_lft"] = { + pos = Vector(-87.5,64.45,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK6Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK6",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors3_4_left"] = { + pos = Vector(74,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod7Set",x=294,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd7Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr3_4_lft"] = { + pos = Vector(142.56,64.5,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK7Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK7",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + + +ENT.ButtonMap["Doors1_2_left"] = { + pos = Vector(303,62,50), + ang = Angle(0,0,90), + width = 520, + height = 1000, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "hod8Set",x=306,y=0,w= 100,h = 1000,tooltip=""}, + {ID = "hcd8Set",x=0,y=0,w= 60,h = 1000,tooltip=""}, + } +} +ENT.ButtonMap["bldr1_2_lft"] = { + pos = Vector(372.7,64.5,0), + ang = Angle(0,-90,90), + width = 20, + height = 450, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "HDLK8Toggle", x=0, y=180, w=20, h=100, tooltip="", model = { + model = "models/metrostroi_train/81-717/battery_enabler.mdl", + var="HDLK8",speed=0.5,vmin=1,vmax=0.8, + sndvol = 0.8, snd = function(val) return val and "pak_on" or "pak_off" end,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0), + }}, + } +} + +ENT.ButtonMap["DoorReleaseExtra"] = { + pos = Vector(278,-62,-2), + ang = Angle(0,0,-90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseExtraToggle",x=0,y=130,w= 100,h = 30,tooltip="", model = { + var="DoorReleaseExtra",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 1, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientProps["doorsmanual_e"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(281,-62.3,12.3), + ang = Angle(0,180,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseExtra"] = {{"DoorReleaseExtra",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + + +ENT.ButtonMap["DoorReleaseRight"] = { + pos = Vector(-290,-62,14.5), + ang = Angle(0,180,90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseRightToggle",x=0,y=0,w= 100,h = 30,tooltip="", model = { + var="DoorReleaseRight",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 1, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientProps["doorsmanual_r"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(-296,-62.13,12.5), + ang = Angle(0,180,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseRight"] = {{"doorsmanual_r",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,0,0)}} + + +ENT.ButtonMap["DoorReleaseLeft"] = { + pos = Vector(-298,62,14.5), + ang = Angle(0,0,90), + width = 100, + height = 160, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "DoorReleaseLeftToggle",x=0,y=0,w= 100,h = 30,tooltip="", model = { + var="DoorReleaseLeft",sndid="disconnect_valve",--"brake_disconnect", + sndvol = 50, snd = function(val) return "disconnect_valve" end, + sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),} + }, + } +} +ENT.ClientProps["doorsmanual_l"] = { + model = "models/metrostroi_train/81-717/stop_mvm.mdl", + pos = Vector(-295.9,62.5,13.59), + ang = Angle(180,0,0), + hideseat=0.2, +} +ENT.ClientSounds["DoorReleaseLeft"] = {{"doorsmanual_l",function() return "disconnect_valve" end,1,1,50,1e3,Angle(-90,90,0)}} --[[ local pos = Vector(450.273468,-32.306019,13.236823) @@ -2810,6 +3214,11 @@ function ENT:Think() self:HidePanel("DriverValveBLDisconnect",self:GetPackedBool("Crane013")) self:HidePanel("DriverValveTLDisconnect",self:GetPackedBool("Crane013")) + local DrawDVR = self:GetPackedBool("ShowDVR") + self:ShowHide("DVR_disconnect",DrawDVR) + self:HidePanel("DVR_87",not DrawDVR) + self:Animate("DVR_disconnect",self:GetPackedBool("DVRDisconnect") and 1 or 0,0.25,0, 4,false) + self:Animate("brake334",self:GetPackedRatio("CranePosition")/5,0.35,0.65,256,24) self:Animate("brake013", Cpos[self:GetPackedRatio("CranePosition")] or 0, 0.03, 0.458, 256,24) @@ -2944,6 +3353,11 @@ function ENT:Think() self:Animate("train_disconnect",self:GetPackedBool("DriverValveTLDisconnect") and 1 or 0,0.25,0, 4,false) self:Animate("valve_disconnect",self:GetPackedBool("DriverValveDisconnect") and 1 or 0,0.25,0, 4,false) self:Animate("stopkran", self:GetPackedBool("EmergencyBrakeValve") and 0 or 1, 0.25,0, 128, 3,false) + ----------------- + self:Animate("doorsmanual_e", self:GetNW2Bool("DoorReleaseExtra") and 0 or 1, 0.25,0, 128, 3,false) + self:Animate("doorsmanual_r", self:GetNW2Bool("DoorReleaseRight") and 0 or 1, 0.25,0, 128, 3,false) + self:Animate("doorsmanual_l", self:GetNW2Bool("DoorReleaseLeft") and 0 or 1, 0.25,0, 128, 3,false) + ----------------- local c013 = self:GetNW2Int("Crane",1)==2 self:ShowHide("brake_valve_334",not c013) @@ -3060,41 +3474,61 @@ function ENT:Think() self:ShowHideSmooth("gv_wrench", CurTime() < self.ResetTime and 1 or 0.1) --self:InitializeSounds() - for i=0,3 do + -- reworked doors animation and sounds + local dT = self.DeltaTime + if not self.DoorStates then self.DoorStates = {} end + if not self.DoorLoopStates then self.DoorLoopStates = {} end + if not self.DSprev then self.DSprev = {{},{},{},{}} end + if not self.DoorDelta then self.DoorDelta = {{0,0},{0,0},{0,0},{0,0}} end + for i=0,3 do for k=0,1 do local st = k==1 and "DoorL" or "DoorR" - local doorstate = self:GetPackedBool(st) local id,sid = st..(i+1),"door"..i.."x"..k local state = self:GetPackedRatio(id) - if (state ~= 1 and state ~= 0) ~= self.DoorStates[id] then - if doorstate and state < 1 or not doorstate and state > 0 then - else - if state > 0 then - self:PlayOnce(sid.."o","",1,math.Rand(0.8,1.2)) - else - self:PlayOnce(sid.."c","",1,math.Rand(0.8,1.2)) - end - end - self.DoorStates[id] = (state ~= 1 and state ~= 0) - end - if (state ~= 1 and state ~= 0) then + local prevstate = self.DSprev[i+1][k+1] + + if (prevstate ~= state) then self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) + 2*self.DeltaTime,0,1) - else - self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) - 6*self.DeltaTime,0,1) - end - self:SetSoundState(sid.."r",self.DoorLoopStates[id],0.8+self.DoorLoopStates[id]*0.2) - local n_l = "door"..i.."x"..k--.."a" + self.DoorDelta[i+1][k+1] = 0.0 + else + if self.DoorDelta[i+1][k+1] < 0.2 then + self.DoorDelta[i+1][k+1] = self.DoorDelta[i+1][k+1] + self.DeltaTime + else --was 6 + self.DoorLoopStates[id] = math.Clamp((self.DoorLoopStates[id] or 0) - 1*self.DeltaTime,0,1) + end + end + self.DSprev[i+1][k+1] = state + self:SetSoundState(sid.."r",self.DoorLoopStates[id],0.8+self.DoorLoopStates[id]*0.2) + local n_l = "door"..i.."x"..k--.."a" --local n_r = "door"..i.."x"..k.."b" local dlo = 1 + local drcsing = state-(self.Anims[n_l] and self.Anims[n_l].oldival or 0) < 0 if self.Anims[n_l] then dlo = math.abs(state-(self.Anims[n_l] and self.Anims[n_l].oldival or 0)) if dlo <= 0 and self.Anims[n_l].oldspeed then dlo = self.Anims[n_l].oldspeed/14 end end - self:Animate(n_l,state,0,0.95,dlo*14,false)--0.8 + (-0.2+0.4*math.random()),0) - --self:Animate(n_r,state,0,1,dlo*14,false)--0.8 + (-0.2+0.4*math.random()),0) + local retval = self:Animate(n_l,state,0,0.95,math.max(0.15, drcsing and state < 0.03 and dlo > 0 and 1 or dlo*14),false) + --Заменил в условии "серверное" положение створок на возвращаемое из функции Animate, чтобы хлопок не раздавался раньше фактического смыкания створок + --UPD: зато он стал раздаваться после прихода КД :D (исправил это другим костылем, а именно: принудительным захлопыванием створок на максимальной скорости, если сервер + -- говорит, что двери закрыты, а на клиенте они еще нет) + if (retval ~= 0.95 and retval ~= 0) ~= self.DoorStates[id] then + --if doorstate and state < 1 or not doorstate and state > 0 then Закомментил, чтобы хлопанье раздавалось даже при + --else открытии-закрытии дверей руками + if retval == 0.95 then -- was state > 0 + self:PlayOnce(sid.."o","",1,math.Rand(0.8,1.2)) + elseif retval == 0 then -- was else + self:PlayOnce(sid.."c","",1,math.Rand(0.8,1.2)) + end + --end + --self.DoorStates[id] = (state ~= 1 and state ~= 0) + self.DoorStates[id] = (retval ~= 0.95 and retval ~= 0) + end end end + self:SetSoundState("releasedr",-0.5*(self:GetPackedRatio("RightDoorCloseCylPressure_dPdT",0) + 0.8),1) + self:SetSoundState("releasedl",-0.5*(self:GetPackedRatio("LeftDoorCloseCylPressure_dPdT",0) + 0.8),1) + self:SetSoundState("releasede",-0.3*(self:GetPackedRatio("_1stRightDoorCloseCylPressure_dPdT",0) + 1.2),2) local dT = self.DeltaTime local rollingi = math.min(1,self.TunnelCoeff+math.Clamp((self.StreetCoeff-0.82)/0.3,0,1)) diff --git a/lua/entities/gmod_subway_81-717_mvm/init.lua b/lua/entities/gmod_subway_81-717_mvm/init.lua index 62b38fd..2b83e44 100644 --- a/lua/entities/gmod_subway_81-717_mvm/init.lua +++ b/lua/entities/gmod_subway_81-717_mvm/init.lua @@ -18,7 +18,7 @@ ENT.SyncTable = { "AIS","A15","A81","A68","A80", "RC1","VB","BPS","UOS", "PB", "UAVA","UAVAC", "DriverValveBLDisconnect","DriverValveTLDisconnect","DriverValveDisconnect","ParkingBrake","EPK","EmergencyBrakeValve", - "VUD2","VDL","Wiper", "GV", + "VUD2","VDL","Wiper", "GV", "HDLK1","HDLK2","HDLK3","HDLK4","HDLK5","HDLK6","HDLK7","HDLK8","DVRDisconnect","DoorReleaseLeft","DoorReleaseRight","DoorReleaseExtra", "R_ASNPMenu","R_ASNPUp","R_ASNPDown","R_ASNPOn" , "ALSFreq","Ring","VBD", "V11","V12","V13","UPPS_On","SAB1" @@ -224,9 +224,25 @@ function ENT:Initialize() self.OtsekDoor1 = false self.OtsekDoor2 = false + self.OldPedestrianCount = 0 + self.Lamps = { broken = {}, } + self.d_slow_speeds = { + {0.4, 0.8}, + --{0.3, 0.4}, + --{0.2, 0.3}, + --{0.3, 0.4}, + --{0.2, 0.3}, + } + self.d_fast_speeds = { + {1.2, 1.8}, + --{1.7, 1.8}, + --{1.8, 1.9}, + --{1.7, 1.8}, + --{2.1, 2.2}, + } local rand = math.random() > 0.8 and 1 or math.random(0.95,0.99) for i = 1,25 do if math.random() > rand then self.Lamps.broken[i] = math.random() > 0.5 end @@ -387,6 +403,9 @@ function ENT:TrainSpawnerUpdate() self.CompressorEfficiency = math.random()*0.05 + 0.02 self.AirConsumeRatio = math.random()*0.04 + 0.06 self.AirLeakRatio = math.random()*0.002 + 0.001 + self.DVRLag = math.random()*0.5 + self.DVRHiss = math.random(2,5) + self.d_speeds = nil local num = self.WagonNumber self:SetNW2Bool("Custom",self.CustomSettings) @@ -513,6 +532,8 @@ function ENT:TrainSpawnerUpdate() self.Lights[31][2] = Vector(465,45 , -23.5) self.Lights[32][2] = Vector(465,0 , 52) end]] + self.StuckSet = nil + self.DoorSpeedsDone = false self.Announcer.AnnouncerType = self:GetNW2Int("Announcer",1) self.LampType = self:GetNW2Int("LampType",1) self.Pneumatic.ValveType = self:GetNW2Int("Crane",1) @@ -577,6 +598,7 @@ function ENT:Think() self:SetPackedBool("RedLights",Panel.RedLight2 > 0) self:SetPackedBool("CabLights",Panel.CabLights>0) self:SetPackedBool("EqLights",Panel.EqLights>0) + self:SetPackedBool("ShowDVR",self.OtsekDoor1) self:SetPackedBool("PanelLights",Panel.PanelLights > 0.5) @@ -624,6 +646,35 @@ function ENT:Think() self.LeftDoorsOpen = (Pneumatic.LeftDoorState[1] > 0.5) or (Pneumatic.LeftDoorState[2] > 0.5) or (Pneumatic.LeftDoorState[3] > 0.5) or (Pneumatic.LeftDoorState[4] > 0.5) self.RightDoorsOpen = (Pneumatic.RightDoorState[1] > 0.5) or (Pneumatic.RightDoorState[2] > 0.5) or (Pneumatic.RightDoorState[3] > 0.5) or (Pneumatic.RightDoorState[4] > 0.5) + if #self.WagonList == self.CarCount and not self.d_speeds then + local d_spd_type = math.random() + for k,v in ipairs(self.WagonList) do + v.d_speeds = d_spd_type < 0.5 and v.d_fast_speeds or v.d_slow_speeds + end + end + + if self.Speed > 1 and not self.LeftDoorsOpen and not self.RightDoorsOpen and not self.PedChecked then + self.OldPedestrianCount = self:GetNW2Float("PassengerCount") + self.PedChecked = true + self.left_side = nil + self.StuckSet = false + end + if not self.StuckSet then + local passenger_count = self:GetNW2Float("PassengerCount") + if self.Speed < 1 and math.abs(self.OldPedestrianCount - passenger_count) >= 1 and self.left_side == nil then + self.OldPedestrianCount = self:GetNW2Float("PassengerCount") + self.left_side = self.Pneumatic.DoorLeft or false + end + if self.left_side ~= nil then + if not (self.Pneumatic.DoorLeft or self.Pneumatic.DoorRight) then + local luava = math.random() + self["CanStuckPassenger"..(self.left_side and "Left" or "Right")] = (1-passenger_count/200)*0.8 < luava and luava < 1 and 1--0.912 < luava and luava < 0.987 + self.StuckSet = true + --if self.CanStuckPassengerLeft or self.CanStuckPassengerRight then print(self,"passenger to be caught! :D") end + end + end + end + -- DIP/power self:SetPackedBool("LUDS",Panel.LUDS > 0.5) diff --git a/lua/entities/gmod_subway_81-717_mvm/shared.lua b/lua/entities/gmod_subway_81-717_mvm/shared.lua index ce1b755..29d43c7 100644 --- a/lua/entities/gmod_subway_81-717_mvm/shared.lua +++ b/lua/entities/gmod_subway_81-717_mvm/shared.lua @@ -429,6 +429,18 @@ function ENT:InitializeSounds() self.SoundNames["release2"] = {loop=true,"subway_trains/common/pneumatic/release_low.wav"} self.SoundPositions["release2"] = {350,1e9,Vector(-183,0,-70),0.4} + self.SoundNames["releasedl"] = {loop=true,"subway_trains/717/door_cyl/vdo_on.mp3"} + self.SoundPositions["releasedl"] = {150,20,Vector(282,62,12.5),1.5} + self.SoundNames["releasedr"] = {loop=true,"subway_trains/717/door_cyl/vdo2_on.mp3"} + self.SoundPositions["releasedr"] = {150,20,Vector(281,-62,12.8),1.5} + self.SoundNames["releasede"] = {loop=true,"subway_trains/717/door_cyl/vdo3_on.mp3"} + self.SoundPositions["releasede"] = {150,20,Vector(278,-62,-2),1.5} + + self.SoundNames["dcyl_op_exh"] = "subway_trains/common/pneumatic/parking_brake_stop2.mp3" + self.SoundNames["dcyl_cl_exh"] = self.SoundNames["dcyl_op_exh"] + self.SoundPositions["dcyl_op_exh"] = {480,1e9,Vector(-420,45,-30),0.4} + self.SoundPositions["dcyl_cl_exh"] = {480,1e9,Vector(-420,45,-30),1.2} + self.SoundNames["parking_brake"] = {loop=true,"subway_trains/common/pneumatic/parking_brake.wav"} self.SoundNames["parking_brake_en"] = "subway_trains/common/pneumatic/parking_brake_stop.mp3" self.SoundNames["parking_brake_rel"] = "subway_trains/common/pneumatic/parking_brake_stop2.mp3" @@ -823,7 +835,7 @@ function ENT:InitializeSystems() self:LoadSystem("PR_14X_Panels") -- Пневмосистема 81-710 - self:LoadSystem("Pneumatic","81_717_Pneumatic") + self:LoadSystem("Pneumatic","81_717_NewPneumatic") -- Панель управления 81-710 self:LoadSystem("Panel","81_717_Panel") -- Everything else @@ -973,6 +985,14 @@ ENT.Spawner = { if ent._SpawnerStarted~=val then ent.VB:TriggerInput("Set",val<=2 and 1 or 0) ent.ParkingBrake:TriggerInput("Set",val==3 and 1 or 0) + ent.Pneumatic.LeftDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0} + ent.Pneumatic.RightDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0} + for _i = 1,4 do + ent.Pneumatic.DSprev[_i][1] = ent.Pneumatic.RightDoorState[_i] + ent.Pneumatic.DSprev[_i][2] = ent.Pneumatic.LeftDoorState[_i] + end + ent.Pneumatic.DoorLeft = val == 4 and true or false + ent.Pneumatic.DoorRight = val == 4 and true or false if ent.AR63 then local first = i==1 or _LastSpawner~=CurTime() ent.A53:TriggerInput("Set",val<=2 and 1 or 0) diff --git a/lua/entities/gmod_subway_81-717_mvm_custom.lua b/lua/entities/gmod_subway_81-717_mvm_custom.lua index 5702852..383137e 100644 --- a/lua/entities/gmod_subway_81-717_mvm_custom.lua +++ b/lua/entities/gmod_subway_81-717_mvm_custom.lua @@ -88,6 +88,14 @@ ENT.Spawner = { if ent._SpawnerStarted~=val then ent.VB:TriggerInput("Set",val<=2 and 1 or 0) ent.ParkingBrake:TriggerInput("Set",val==3 and 1 or 0) + ent.Pneumatic.LeftDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0} + ent.Pneumatic.RightDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0} + for _i = 1,4 do + ent.Pneumatic.DSprev[_i][1] = ent.Pneumatic.RightDoorState[_i] + ent.Pneumatic.DSprev[_i][2] = ent.Pneumatic.LeftDoorState[_i] + end + ent.Pneumatic.DoorLeft = val == 4 and true or false + ent.Pneumatic.DoorRight = val == 4 and true or false if ent.AR63 then local first = i==1 or _LastSpawner~=CurTime() ent.A53:TriggerInput("Set",val<=2 and 1 or 0) diff --git a/lua/metrostroi/systems/sys_81_714_pneumatic.lua b/lua/metrostroi/systems/sys_81_714_new_pneumatic.lua similarity index 73% rename from lua/metrostroi/systems/sys_81_714_pneumatic.lua rename to lua/metrostroi/systems/sys_81_714_new_pneumatic.lua index 3153871..65e8f44 100644 --- a/lua/metrostroi/systems/sys_81_714_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_714_new_pneumatic.lua @@ -4,7 +4,7 @@ -- Copyright (C) 2013-2018 Metrostroi Team & FoxWorks Aerospace s.r.o. -- Contains proprietary code. See license.txt for additional information. -------------------------------------------------------------------------------- -Metrostroi.DefineSystem("81_714_Pneumatic") +Metrostroi.DefineSystem("81_714_NewPneumatic") TRAIN_SYSTEM.DontAccelerateSimulation = true function TRAIN_SYSTEM:Initialize(parameters) @@ -39,6 +39,13 @@ function TRAIN_SYSTEM:Initialize(parameters) self.OldBrakeLinePressure = 0.0 -- Pressure in the door line self.DoorLinePressure = 0.0 -- atm + self.LeftDoorCloseCylPressure = 0.0 + self.LeftDoorOpenCylPressure = 0.0 + self.RightDoorCloseCylPressure = 0.0 + self.RightDoorOpenCylPressure = 0.0 + self.LeftExhausted = false + self.RightExhausted = false + self.OldBrakeLinePressure = 0.0 self.BCPressure = 0 -- Air distrubutor part @@ -85,6 +92,38 @@ function TRAIN_SYSTEM:Initialize(parameters) self.Train:LoadSystem("RearBrakeLineIsolation","Relay","Switch", { normally_closed = true, bass = true}) self.Train:LoadSystem("FrontTrainLineIsolation","Relay","Switch", { normally_closed = true, bass = true}) self.Train:LoadSystem("RearTrainLineIsolation","Relay","Switch", { normally_closed = true, bass = true}) + ------------------------------------------------------------------------------------------------ + --Ручное управление дверьми + --Краны выключения дверей и разобщительный кран ДВР + self.Train:LoadSystem("DoorReleaseRight","Relay","Switch") + self.Train:LoadSystem("DoorReleaseLeft","Relay","Switch") + self.Train:LoadSystem("DVRDisconnect","Relay","Switch", { normally_closed = false, bass = true}) + --Механическая блокировка дверей + self.Train:LoadSystem("IDLK1","Relay","VB-11", {bass = true}) --4 левый + self.Train:LoadSystem("IDLK2","Relay","VB-11", {bass = true}) --3 левый + self.Train:LoadSystem("IDLK3","Relay","VB-11", {bass = true}) --2 левый + self.Train:LoadSystem("IDLK4","Relay","VB-11", {bass = true}) --1 левый + self.Train:LoadSystem("IDLK5","Relay","VB-11", {bass = true}) --1 правый + self.Train:LoadSystem("IDLK6","Relay","VB-11", {bass = true}) --2 правый + self.Train:LoadSystem("IDLK7","Relay","VB-11", {bass = true}) --3 правый + self.Train:LoadSystem("IDLK8","Relay","VB-11", {bass = true}) --4 правый + --раздвинуть/сдвинуть створки руками + self.Train:LoadSystem("iod1","Relay","Switch") + self.Train:LoadSystem("iod2","Relay","Switch") + self.Train:LoadSystem("iod3","Relay","Switch") + self.Train:LoadSystem("iod4","Relay","Switch") + self.Train:LoadSystem("iod5","Relay","Switch") + self.Train:LoadSystem("iod6","Relay","Switch") + self.Train:LoadSystem("iod7","Relay","Switch") + self.Train:LoadSystem("iod8","Relay","Switch") + self.Train:LoadSystem("icd1","Relay","Switch") + self.Train:LoadSystem("icd2","Relay","Switch") + self.Train:LoadSystem("icd3","Relay","Switch") + self.Train:LoadSystem("icd4","Relay","Switch") + self.Train:LoadSystem("icd5","Relay","Switch") + self.Train:LoadSystem("icd6","Relay","Switch") + self.Train:LoadSystem("icd7","Relay","Switch") + self.Train:LoadSystem("icd8","Relay","Switch") -- Brake cylinder atmospheric valve open self.BrakeCylinderValve = 0 @@ -95,15 +134,23 @@ function TRAIN_SYSTEM:Initialize(parameters) -- Compressor simulation self.Compressor = 0 --Simulate overheat with TRK FIXME + -- Door release valve status + self.DoorReleaseRightPrevious = 0 + self.DoorReleaseLeftPrevious = 0 + -- Doors state if not TURBOSTROI then - self.LeftDoorState = { 0,0,0,0 } - self.RightDoorState = { 0,0,0,0 } - self.LeftDoorDir = { 0,0,0,0 } - self.RightDoorDir = { 0,0,0,0 } - self.LeftDoorSpeed = {0,0,0,0} - self.RightDoorSpeed = {0,0,0,0} - local start = math.Rand(0.6,0.8) + self.LeftDoorState = self.LeftDoorState or { 0,0,0,0 } + self.RightDoorState = self.RightDoorState or { 0,0,0,0 } + --self.LeftDoorDir = { 0,0,0,0 } + --self.RightDoorDir = { 0,0,0,0 } + self.LeftDoorSpeed = {1,1,1,1} + self.RightDoorSpeed = {1,1,1,1} + self.DSprev = {{0,0},{0,0},{0,0},{0,0}} + self.LeftDoorStuck = {false, false, false, false} + self.RightDoorStuck = {false, false, false, false} + + local start = math.Rand(0.6,1.0) -- 0.6-1 self.DoorSpeedMain = -math.Rand(start,math.Rand(start+0.1,start+0.2)) for i=1,#self.LeftDoorSpeed do @@ -133,8 +180,8 @@ function TRAIN_SYSTEM:Inputs() end function TRAIN_SYSTEM:Outputs() - return { "BrakeLinePressure", "BrakeCylinderPressure", "DriverValvePosition", "WorkingChamberPressure", - "ReservoirPressure", "TrainLinePressure", "DoorLinePressure", "WeightLoadRatio" } + return { "BrakeLinePressure", "BrakeCylinderPressure", "DriverValvePosition", "WorkingChamberPressure", "LeftDoorCloseCylPressure", "LeftDoorOpenCylPressure", + "ReservoirPressure", "TrainLinePressure", "DoorLinePressure", "WeightLoadRatio", "RightDoorCloseCylPressure", "RightDoorOpenCylPressure" } end function TRAIN_SYSTEM:TriggerInput(name,value) @@ -290,6 +337,45 @@ function TRAIN_SYSTEM:Think(dT) local retainer = Train:GetNW2Int("RetainerLoad", 4) self.WeightLoadRatio = retainer == 4 and math.max(0,math.min(1,(Train:GetNW2Float("PassengerCount")/200))) or (retainer-1)*0.5 + --if not Train.DoorSpeedsDone then + -- local start + -- if #Train.WagonList == Train.CarCount and Train.d_speeds then + -- start = math.Rand(unpack(Train.d_speeds[math.random(1,#Train.d_speeds)])) + -- end + -- if start then + -- MsgC(Color(200,200,200),"Setting doors speed for car "..tostring(self.Train).."; start = "..tostring(start).."...") + -- self.DoorSpeedMain = start--math.Rand(start,math.Rand(start+0.1,start+0.2)) + -- for i=1,#self.LeftDoorSpeed do + -- --if math.random() > 0.7 then + -- -- self.LeftDoorSpeed[i] = math.Rand(self.DoorSpeedMain-0.2,self.DoorSpeedMain+0.2) + -- -- self.RightDoorSpeed[i] = math.Rand(self.DoorSpeedMain-0.2,self.DoorSpeedMain+0.2) + -- --else + -- self.LeftDoorSpeed[i] = math.Rand(self.DoorSpeedMain-0.1,self.DoorSpeedMain) + -- self.RightDoorSpeed[i] = math.Rand(self.DoorSpeedMain-0.1,self.DoorSpeedMain) + -- --end + -- end + -- Train.DoorSpeedsDone = true + -- MsgC(Color(200,200,200),"done\n") + -- else + -- MsgC(Color(200,200,200),"failed!\n") + -- end + --end + if not Train.DoorSpeedsDone and Train.CarCount then + local set + if #Train.WagonList == Train.CarCount and Train.d_speeds then + set = math.random(1,#Train.d_speeds) + local a,b = unpack(Train.d_speeds[set]) + --MsgC(Color(200,200,200),"Setting doors speed for car "..tostring(self.Train).."; set = {"..a..", "..b.."} ...") + for i=1,#self.LeftDoorSpeed do + self.LeftDoorSpeed[i] = math.Rand(a,b) + self.RightDoorSpeed[i] = math.Rand(a,b) + end + Train.DoorSpeedsDone = true + --MsgC(Color(200,200,200),"done\n") + else + --MsgC(Color(200,200,200),"failed!\n") + end + end ---------------------------------------------------------------------------- -- Accumulate derivatives self.TrainLinePressure_dPdT = 0.0 @@ -299,10 +385,17 @@ function TRAIN_SYSTEM:Think(dT) self.ParkingBrakePressure_dPdT = 0.0 self.WorkingChamberPressure_dPdT = 0.0 + -- Doors + self.LeftDoorCloseCylPressure_dPdT = 0.0 + self.RightDoorCloseCylPressure_dPdT = 0.0 + self.LeftDoorOpenCylPressure_dPdT = 0.0 + self.RightDoorOpenCylPressure_dPdT = 0.0 + self.DoorLinePressure_dPdT = 0.0 + -- Reduce pressure for brake line self.TrainToBrakeReducedPressure = math.min(self.KM013offset,self.TrainLinePressure) -- * 0.725) -- Feed pressure to door line - self.DoorLinePressure = self.TrainToBrakeReducedPressure * 0.90 + self.DoorLinePressure = Train.DVRDisconnect.Value == 0 and math.min(3.6,self.TrainLinePressure) or self.DoorLinePressure local trainLineConsumption_dPdT = 0.0 local wagc = Train:GetBLConnectedWagonCount() local HaveEPK = not Train.SubwayTrain or not Train.SubwayTrain.ARS or not Train.SubwayTrain.ARS.NoEPK @@ -578,12 +671,168 @@ function TRAIN_SYSTEM:Think(dT) -- Simulate cross-feed between different wagons self:UpdatePressures(Train,dT) + ---------------------------------------------------------------------------- + -- Simulate doors opening, closing + local LeftRelease = Train.DoorReleaseLeft.Value == 0 + local RightRelease = Train.DoorReleaseRight.Value == 0 + if self.DoorLinePressure >= 1.9 then --was > 2.6 + -- Simulate DVR engage lag + if Train.VDOL.Value == 1.0 and not Train.VDOLEnergized then + Train.VDOLEnergized = true + Train.VDOLTime = RealTime() + elseif Train.VDOL.Value == 0.0 then + Train.VDOLEnergized = false + end + if Train.VDOP.Value == 1.0 and not Train.VDOPEnergized then + Train.VDOPEnergized = true + Train.VDOPTime = RealTime() + elseif Train.VDOP.Value == 0.0 then + Train.VDOPEnergized = false + end + if (Train.VDOL.Value == 1.0) and (Train.VDOP.Value == 0.0) and not self.DoorLeft then + if Train.VDOLTime and RealTime() - Train.VDOLTime > (Train.DVRLag or 0) then self.DoorLeft = true end + if self.VDOLLoud then Train:PlayOnce("vdol_loud","cabin",0.8+math.random()*0.2,self.VDOLLoud) end + end + if (Train.VDOL.Value == 0.0) and (Train.VDOP.Value == 1.0) and not self.DoorRight then + if Train.VDOPTime and RealTime() - Train.VDOPTime > (Train.DVRLag or 0) then self.DoorRight = true end + if self.VDORLoud then Train:PlayOnce("vdop_loud","cabin",0.8+math.random()*0.2,self.VDORLoud) end + end + if Train.DVRHiss == 2 then + if Train.RD.Value == 1 and Train.VDOL.Value == 1 and not self.LeftExhausted then + Train:PlayOnce("dcyl_op_exh","bass",1,1) + self.LeftExhausted = true + end + if Train.RD.Value == 1 and Train.VDOP.Value == 1 and not self.RightExhausted then + Train:PlayOnce("dcyl_op_exh","bass",1,1) + self.RightExhausted = true + end + end + if (Train.VDZ.Value == 1.0 or Train.VDOL.Value == 1.0 and Train.VDOP.Value == 1.0 or self.RZDTimer) and (self.DoorLeft or self.DoorRight) then + --if not self.OpenWaitL or CurTime()-self.OpenWaitL < 0.2 then + self.DoorLeft = false + --end + --if not self.OpenWaitR or CurTime()-self.OpenWaitR < 0.2 then + self.DoorRight = false + --end + if Train.DVRHiss == 2 then + if Train.RD.Value == 0 and (self.LeftExhausted or self.RightExhausted) then + Train:PlayOnce("dcyl_cl_exh","bass",1,0.6) + self.LeftExhausted = false + self.RightExhausted = false + end + end + else + self.CloseValue = nil + end + if Train.VDOL.Value == 1.0 and Train.VDOP.Value == 1.0 then + self.RZDTimer = CurTime() + elseif self.RZDTimer and CurTime()-self.RZDTimer > 0.1 then + self.RZDTimer = nil + end + end + -- Тут было бы лучше сделать не 2 цилиндра на вагон, а 8, но тогда будет не 4 вызова функции, а 16... + self:equalizePressure(dT,"RightDoorOpenCylPressure", self.DoorRight and self.DoorLinePressure or 0.0, 2.2, 10) + self:equalizePressure(dT,"RightDoorCloseCylPressure", not self.DoorRight and RightRelease and self.DoorLinePressure or 0.0, 2.2, 10) + self:equalizePressure(dT,"LeftDoorOpenCylPressure", self.DoorLeft and self.DoorLinePressure or 0.0, 2.2, 10) + self:equalizePressure(dT,"LeftDoorCloseCylPressure", not self.DoorLeft and LeftRelease and self.DoorLinePressure or 0.0, 2.2, 10) + self.DoorLinePressure = self.DoorLinePressure-math.max(0,self.RightDoorOpenCylPressure_dPdT*0.005) + self.DoorLinePressure = self.DoorLinePressure-math.max(0,self.LeftDoorOpenCylPressure_dPdT*0.005) + self.DoorLinePressure = self.DoorLinePressure-math.max(0,self.RightDoorCloseCylPressure_dPdT*0.005) + self.DoorLinePressure = self.DoorLinePressure-math.max(0,self.LeftDoorCloseCylPressure_dPdT*0.005) + Train:SetPackedRatio("RightDoorCloseCylPressure_dPdT",not RightRelease and self.RightDoorCloseCylPressure_dPdT or 0) + Train:SetPackedRatio("LeftDoorCloseCylPressure_dPdT",not LeftRelease and self.LeftDoorCloseCylPressure_dPdT or 0) + if self.DoorReleaseRightPrevious ~= Train.DoorReleaseRight.Value then + self.DoorReleaseRightPrevious = Train.DoorReleaseRight.Value + ---[[ + if not self.DoorRight and self.DoorReleaseRightPrevious == 1 then + self:equalizePressure(dT,"RightDoorCloseCylPressure", 0, 3) --was DoorLinePressure + end--]] + end + if self.DoorReleaseLeftPrevious ~= Train.DoorReleaseLeft.Value then + self.DoorReleaseLeftPrevious = Train.DoorReleaseLeft.Value + ---[[ + if not self.DoorLeft and self.DoorReleaseLeftPrevious == 1 then + self:equalizePressure(dT,"LeftDoorCloseCylPressure", 0, 6) --was DoorLinePressure + end--]] + end + if self.VDOL ~= Train.VDOL.Value then + self.VDOL = Train.VDOL.Value + self:equalizePressure(dT,Train.DVRDisconnect.Value == 0 and "TrainLinePressure" or "DoorLinePressure", 0.0, 0.05) --was 0.3 + end + if self.VDOP ~= Train.VDOP.Value then + self.VDOP = Train.VDOP.Value + self:equalizePressure(dT,Train.DVRDisconnect.Value == 0 and "TrainLinePressure" or "DoorLinePressure", 0.0, 0.05) --was 0.3 + end + if self.VDZ ~= Train.VDZ.Value then + self.VDZ = Train.VDZ.Value + self:equalizePressure(dT,Train.DVRDisconnect.Value == 0 and "TrainLinePressure" or "DoorLinePressure", 0.0, 0.05) --was 0.3 + end + trainLineConsumption_dPdT = trainLineConsumption_dPdT + (Train.DVRDisconnect.Value == 0 and math.max(0,self.DoorLinePressure_dPdT*0.2) or 0) + if Train.CanStuckPassengerLeft then + for i in ipairs(self.LeftDoorStuck) do + self.LeftDoorStuck[i] = math.random() < (0.6+math.min(2,2-self.LeftDoorSpeed[i])*0.2)*Train.CanStuckPassengerLeft*0.6 and (math.random() > 0.7 and CurTime()+math.random()*15) + end + Train.CanStuckPassengerLeft = false + end + if Train.CanStuckPassengerRight then + for i in ipairs(self.RightDoorStuck) do + self.RightDoorStuck[i] = math.random() < (0.6+math.min(2,2-self.RightDoorSpeed[i])*0.2)*Train.CanStuckPassengerRight*0.6 and (math.random() > 0.7 and CurTime()+math.random()*15) + end + Train.CanStuckPassengerRight = false + end + + + Train.LeftDoorsOpen = false + Train.RightDoorsOpen = false + local openL = true + local openR = true + local llocked = false + local rlocked = false + local rmOpen = false --|Right and left doors + local rmClose = false --| + local lmOpen = false --| + local lmClose = false --|manual opening-closing + local v = "IDLK" + local m = "iod" + local n = "icd" + for i=1,4 do + rlocked = Train[v..i].Value > 0 + llocked = Train[v..tostring(9-i)].Value > 0 + rmOpen = Train[m..i].Value > 0 + lmOpen = Train[m..tostring(9-i)].Value > 0 + rmClose = Train[n..i].Value > 0 + lmClose = Train[n..tostring(9-i)].Value > 0 + self.LeftDoorState[i] = math.Clamp(self.LeftDoorState[i] + (not llocked and ((lmOpen and 1.5 or lmClose and -1.5 or 0) + (self.DoorLinePressure > 1.0 and (math.Round(self.LeftDoorOpenCylPressure - self.LeftDoorCloseCylPressure,1))*0.36*(not (lmOpen or lmClose) and self.LeftDoorSpeed[i] or 1) or 0))*dT or 0),self.LeftDoorStuck[i] and 0.3 or 0,1) + self.RightDoorState[i] = math.Clamp(self.RightDoorState[i] + (not rlocked and ((rmOpen and 1.5 or rmClose and -1.5 or 0) + (self.DoorLinePressure > 1.0 and (math.Round(self.RightDoorOpenCylPressure - self.RightDoorCloseCylPressure,1))*0.36*(not (rmOpen or rmClose) and self.RightDoorSpeed[i] or 1) or 0))*dT or 0),self.RightDoorStuck[i] and 0.3 or 0,1) + if not Train.LeftDoorsOpen and self.LeftDoorState[i] > 0.02 then --was 0.06 + Train.LeftDoorsOpen = true + end + if not Train.RightDoorsOpen and self.RightDoorState[i] > 0.02 then --was 0.06 + Train.RightDoorsOpen = true + end + Train:SetPackedRatio("DoorL"..i,self.LeftDoorState[i]) + Train:SetPackedRatio("DoorR"..i,self.RightDoorState[i]) + if self.LeftDoorStuck[i] and (self.DoorLeft or type(self.LeftDoorStuck[i]) == "number" and CurTime()-self.LeftDoorStuck[i] > 0) then + self.LeftDoorStuck[i] = false + end + if self.RightDoorStuck[i] and (self.DoorRight or type(self.RightDoorStuck[i]) == "number" and CurTime()-self.RightDoorStuck[i] > 0) then + self.RightDoorStuck[i] = false + end + Train:SetPackedBool("DoorLS"..i,self.LeftDoorStuck[i]) + Train:SetPackedBool("DoorRS"..i,self.RightDoorStuck[i]) + end + Train:SetPackedBool("DoorL",self.DoorLeft) + Train:SetPackedBool("DoorR",self.DoorRight) + Train.BD:TriggerInput("Set",not Train.RightDoorsOpen and not Train.LeftDoorsOpen) + Train.LeftDoorsOpening = self.DoorLeft + Train.RightDoorsOpening = self.DoorRight + ---------------------------------------------------------------------------- -- Simulate compressor operation and train line depletion self.Compressor = Train.KK.Value * (Train.Electric.Aux750V > 550 and 1 or 0) - self.TrainLinePressure = self.TrainLinePressure - Train.AirConsumeRatio*trainLineConsumption_dPdT*dT -- 0.190 --0.170 --0.07 - if self.Compressor == 1 then self:equalizePressure(dT,"TrainLinePressure", 10.0, Train.CompressorEfficiency) end -- 0.04 - self:equalizePressure(dT,"TrainLinePressure", 0,Train.AirLeakRatio) + self.TrainLinePressure = self.TrainLinePressure - (Train.AirConsumeRatio or 1)*trainLineConsumption_dPdT*dT -- 0.190 --0.170 --0.07 + if self.Compressor == 1 then self:equalizePressure(dT,"TrainLinePressure", 10.0, Train.CompressorEfficiency or 0.04) end -- 0.04 + self:equalizePressure(dT,"TrainLinePressure", 0,Train.AirLeakRatio or 0.003) -- Overpressure if self.TrainLinePressure > math.max(7.2, (9.2 - self.TrainLineOverpressureValve*0.2)) and self.TrainLineOverpressureValve%2 == 0 then self.TrainLineOverpressureValve = self.TrainLineOverpressureValve + 1 end if self.TrainLineOverpressureValve%2 == 1 then @@ -601,77 +850,6 @@ function TRAIN_SYSTEM:Think(dT) Train.BPT:TriggerInput("Set", (IsValid(Train.FrontBogey) and Train.FrontBogey.BrakeCylinderPressure+(not Train.FrontBogey.DisableParking and Train.FrontBogey.ParkingBrakePressure or 0) or self.BrakeCylinderPressure)>0.3) Train.DKPT:TriggerInput("Set", self.BrakeCylinderPressure > 0.3) -- 1.8 - 2.0 - ---------------------------------------------------------------------------- - -- Simulate doors opening, closing - if self.DoorLinePressure > 3.5 then - if (Train.VDOL.Value == 1.0) and (Train.VDOP.Value == 0.0) and not self.DoorLeft then - self.DoorLeft = true - if self.VDOLLoud then Train:PlayOnce("vdol_loud","cabin",0.8+math.random()*0.2,self.VDOLLoud) end - end - if (Train.VDOL.Value == 0.0) and (Train.VDOP.Value == 1.0) and not self.DoorRight then - self.DoorRight = true - if self.VDORLoud then Train:PlayOnce("vdop_loud","cabin",0.8+math.random()*0.2,self.VDORLoud) end - end - if (Train.VDZ.Value == 1.0 or Train.VDOL.Value == 1.0 and Train.VDOP.Value == 1.0 or self.RZDTimer) and (self.DoorLeft or self.DoorRight) then - if not self.OpenWaitL or CurTime()-self.OpenWaitL < 0.2 then - self.DoorLeft = false - end - if not self.OpenWaitR or CurTime()-self.OpenWaitR < 0.2 then - self.DoorRight = false - end - else - self.CloseValue = nil - end - if Train.VDOL.Value == 1.0 and Train.VDOP.Value == 1.0 then - self.RZDTimer = CurTime() - elseif self.RZDTimer and CurTime()-self.RZDTimer > 0.1 then - self.RZDTimer = nil - end - end - if self.VDOL ~= Train.VDOL.Value then - self.VDOL = Train.VDOL.Value - self:equalizePressure(dT,"TrainLinePressure", 0.0, 0.05) - end - if self.VDOP ~= Train.VDOP.Value then - self.VDOP = Train.VDOP.Value - self:equalizePressure(dT,"TrainLinePressure", 0.0, 0.05) - end - if self.VDZ ~= Train.VDZ.Value then - self.VDZ = Train.VDZ.Value - self:equalizePressure(dT,"TrainLinePressure", 0.0, 0.05) - end - - - Train.LeftDoorsOpen = false - Train.RightDoorsOpen = false - local openL = true - local openR = true - for i=1,4 do - self.LeftDoorDir[i] = math.Clamp(self.LeftDoorDir[i]+dT/(self.DoorLeft and self.LeftDoorSpeed[i] or -self.LeftDoorSpeed[i]),-1,1) - self.RightDoorDir[i] = math.Clamp(self.RightDoorDir[i]+dT/(self.DoorRight and self.RightDoorSpeed[i] or -self.RightDoorSpeed[i]),-1,1) - self.LeftDoorState[i] = math.Clamp(self.LeftDoorState[i] + ((self.LeftDoorDir[i]/self.LeftDoorSpeed[i])*dT),0,1) - if self.LeftDoorState[i] == 0 or self.LeftDoorState[i] == 1 then self.LeftDoorDir[i] = 0 end - self.RightDoorState[i] = math.Clamp(self.RightDoorState[i] + ((self.RightDoorDir[i]/self.RightDoorSpeed[i])*dT),0,1) - if self.RightDoorState[i] == 0 or self.RightDoorState[i] == 1 then self.RightDoorDir[i] = 0 end - if not Train.LeftDoorsOpen and self.LeftDoorState[i] > 0 then - Train.LeftDoorsOpen = true - end - if self.LeftDoorState[i] > self.LeftDoorSpeed[i]/20 then self.OpenWaitL = false end - if self.RightDoorState[i] > self.LeftDoorSpeed[i]/20 then self.OpenWaitR = false end - if self.LeftDoorState[i] > 0 then openL = false end - if self.RightDoorState[i] > 0 then openR = false end - if not Train.RightDoorsOpen and self.RightDoorState[i] > 0 then - Train.RightDoorsOpen = true - end - Train:SetPackedRatio("DoorL"..i,self.LeftDoorState[i]) - Train:SetPackedRatio("DoorR"..i,self.RightDoorState[i]) - end - if openL and not self.OpenWaitL then self.OpenWaitL = CurTime() end - if openR and not self.OpenWaitR then self.OpenWaitR = CurTime() end - Train:SetPackedBool("DoorL",self.DoorLeft) - Train:SetPackedBool("DoorR",self.DoorRight) - Train.BD:TriggerInput("Set",not Train.RightDoorsOpen and not Train.LeftDoorsOpen) - ---------------------------------------------------------------------------- -- FIXME Train:SetNW2Bool("FbI",Train.FrontBrakeLineIsolation.Value ~= 0) @@ -679,6 +857,8 @@ function TRAIN_SYSTEM:Think(dT) Train:SetNW2Bool("FtI",Train.FrontTrainLineIsolation.Value ~= 0) Train:SetNW2Bool("RtI",Train.RearTrainLineIsolation.Value ~= 0) Train:SetNW2Bool("AD",Train.AirDistributorDisconnect.Value == 0) + Train:SetNW2Bool("DoorReleaseRight",Train.DoorReleaseRight.Value ~= 0) + Train:SetNW2Bool("DoorReleaseLeft",Train.DoorReleaseLeft.Value ~= 0) local ValveType = self.ValveType > 1 self.Timer = self.Timer or CurTime() diff --git a/lua/metrostroi/systems/sys_81_717_pneumatic.lua b/lua/metrostroi/systems/sys_81_717_new_pneumatic.lua similarity index 74% rename from lua/metrostroi/systems/sys_81_717_pneumatic.lua rename to lua/metrostroi/systems/sys_81_717_new_pneumatic.lua index 0584e71..0300ebc 100644 --- a/lua/metrostroi/systems/sys_81_717_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_717_new_pneumatic.lua @@ -4,7 +4,7 @@ -- Copyright (C) 2013-2018 Metrostroi Team & FoxWorks Aerospace s.r.o. -- Contains proprietary code. See license.txt for additional information. -------------------------------------------------------------------------------- -Metrostroi.DefineSystem("81_717_Pneumatic") +Metrostroi.DefineSystem("81_717_NewPneumatic") TRAIN_SYSTEM.DontAccelerateSimulation = true function TRAIN_SYSTEM:Initialize(parameters) @@ -41,6 +41,14 @@ function TRAIN_SYSTEM:Initialize(parameters) self.OldBrakeLinePressure = 0.0 -- Pressure in the door line self.DoorLinePressure = 0.0 -- atm + self._1stRightDoorCloseCylPressure = 0.0 + self.LeftDoorCloseCylPressure = 0.0 + self.LeftDoorOpenCylPressure = 0.0 + self.RightDoorCloseCylPressure = 0.0 + self.RightDoorOpenCylPressure = 0.0 + self.LeftExhausted = false + self.RightExhausted = false + self.OldBrakeLinePressure = 0.0 self.BCPressure = 0 -- Air distrubutor part @@ -102,6 +110,45 @@ function TRAIN_SYSTEM:Initialize(parameters) self.Train:LoadSystem("RearTrainLineIsolation","Relay","Switch", { normally_closed = true, bass = true}) self.Train:LoadSystem("SQ3","Relay","") + ------------------------------------------------------------------------------------------------ + --Ручное управление дверьми + --Краны выключения дверей и разобщительный кран ДВР + self.Train:LoadSystem("DoorReleaseExtra","Relay","Switch") + self.Train:LoadSystem("DoorReleaseRight","Relay","Switch") + self.Train:LoadSystem("DoorReleaseLeft","Relay","Switch") + self.Train:LoadSystem("DVRDisconnect","Relay","Switch", { normally_closed = false, bass = true}) + --Механическая блокировка дверей + self.Train:LoadSystem("HDLK1","Relay","VB-11", {bass = true}) --1 правый + self.Train:LoadSystem("HDLK2","Relay","VB-11", {bass = true}) --2 правый + self.Train:LoadSystem("HDLK3","Relay","VB-11", {bass = true}) --3 правый + self.Train:LoadSystem("HDLK4","Relay","VB-11", {bass = true}) --4 правый + self.Train:LoadSystem("HDLK5","Relay","VB-11", {bass = true}) --4 левый + self.Train:LoadSystem("HDLK6","Relay","VB-11", {bass = true}) --3 левый + self.Train:LoadSystem("HDLK7","Relay","VB-11", {bass = true}) --2 левый + self.Train:LoadSystem("HDLK8","Relay","VB-11", {bass = true}) --1 левый + --раздвинуть/сдвинуть створки руками + self.Train:LoadSystem("outerhod1","Relay","Switch") --передние правые двери головного вагона (открытие снаружи состава) + self.Train:LoadSystem("hod1","Relay","Switch") + self.Train:LoadSystem("hod2","Relay","Switch") + self.Train:LoadSystem("hod3","Relay","Switch") + self.Train:LoadSystem("hod4","Relay","Switch") + self.Train:LoadSystem("hod5","Relay","Switch") + self.Train:LoadSystem("hod6","Relay","Switch") + self.Train:LoadSystem("hod7","Relay","Switch") + self.Train:LoadSystem("hod8","Relay","Switch") + self.Train:LoadSystem("hcd1","Relay","Switch") + self.Train:LoadSystem("hcd2","Relay","Switch") + self.Train:LoadSystem("hcd3","Relay","Switch") + self.Train:LoadSystem("hcd4","Relay","Switch") + self.Train:LoadSystem("hcd5","Relay","Switch") + self.Train:LoadSystem("hcd6","Relay","Switch") + self.Train:LoadSystem("hcd7","Relay","Switch") + self.Train:LoadSystem("hcd8","Relay","Switch") + + -- Door release valve status + self.DoorReleaseRightPrevious = 0 + self.DoorReleaseLeftPrevious = 0 + self.DoorReleaseExtraPrevious = 0 -- Brake cylinder atmospheric valve open self.BrakeCylinderValve = 0 @@ -117,13 +164,17 @@ function TRAIN_SYSTEM:Initialize(parameters) -- Doors state if not TURBOSTROI then - self.LeftDoorState = { 0,0,0,0 } - self.RightDoorState = { 0,0,0,0 } - self.LeftDoorDir = { 0,0,0,0 } - self.RightDoorDir = { 0,0,0,0 } - self.LeftDoorSpeed = {0,0,0,0} - self.RightDoorSpeed = {0,0,0,0} - local start = math.Rand(0.6,0.8) + self.LeftDoorState = self.LeftDoorState or { 0,0,0,0 } + self.RightDoorState = self.RightDoorState or { 0,0,0,0 } + --self.LeftDoorDir = { 0,0,0,0 } + --self.RightDoorDir = { 0,0,0,0 } + self.LeftDoorSpeed = {1,1,1,1} + self.RightDoorSpeed = {1,1,1,1} + self.DSprev = {{0,0},{0,0},{0,0},{0,0}} + self.LeftDoorStuck = {false, false, false, false} + self.RightDoorStuck = {false, false, false, false} + + local start = math.Rand(0.6,1.0) -- 0.6-1 self.DoorSpeedMain = -math.Rand(start,math.Rand(start+0.1,start+0.2)) for i=1,#self.LeftDoorSpeed do @@ -155,8 +206,8 @@ function TRAIN_SYSTEM:Inputs() end function TRAIN_SYSTEM:Outputs() - return { "BrakeLinePressure", "BrakeCylinderPressure", "DriverValvePosition", "WorkingChamberPressure", - "ReservoirPressure", "TrainLinePressure", "DoorLinePressure", "WeightLoadRatio" } + return { "BrakeLinePressure", "BrakeCylinderPressure", "DriverValvePosition", "WorkingChamberPressure", "LeftDoorCloseCylPressure", "LeftDoorOpenCylPressure", + "ReservoirPressure", "TrainLinePressure", "DoorLinePressure", "WeightLoadRatio", "RightDoorCloseCylPressure", "_1stRightDoorCloseCylPressure", "RightDoorOpenCylPressure" } end function TRAIN_SYSTEM:TriggerInput(name,value) @@ -325,6 +376,44 @@ function TRAIN_SYSTEM:Think(dT) self.WeightLoadRatio = retainer == 4 and math.max(0,math.min(1,(Train:GetNW2Float("PassengerCount")/200))) or (retainer-1)*0.5 Train.Panel.UAVACOpened = (1-Train.UAVAC.Value)*((CurTime()-CurTime()%0.5)%1) + --if not Train.DoorSpeedsDone then + -- local start + -- if #Train.WagonList == Train.CarCount and Train.d_speeds then start = math.Rand(unpack(Train.d_speeds[math.random(1,#Train.d_speeds)])) end + -- if start then + -- MsgC(Color(200,200,200),"Setting doors speed for car "..tostring(self.Train).."; start = "..tostring(start).."...") + -- self.DoorSpeedMain = start--math.Rand(start,math.Rand(start+0.1,start+0.2)) + -- for i=1,#self.LeftDoorSpeed do + -- if math.random() > 0.7 then + -- self.LeftDoorSpeed[i] = math.Rand(self.DoorSpeedMain-0.2,self.DoorSpeedMain+0.3) + -- self.RightDoorSpeed[i] = math.Rand(self.DoorSpeedMain-0.2,self.DoorSpeedMain+0.3) + -- else + -- self.LeftDoorSpeed[i] = math.Rand(self.DoorSpeedMain-0.1,self.DoorSpeedMain+0.1) + -- self.RightDoorSpeed[i] = math.Rand(self.DoorSpeedMain-0.1,self.DoorSpeedMain+0.1) + -- end + -- end + -- self.Train.DoorSpeedsDone = true + -- MsgC(Color(200,200,200),"done\n") + -- else + -- MsgC(Color(200,200,200),"failed!\n") + -- end + --end + if not Train.DoorSpeedsDone and Train.CarCount then + local set + if #Train.WagonList == Train.CarCount and Train.d_speeds then + set = math.random(1,#Train.d_speeds) + local a,b = unpack(Train.d_speeds[set]) + --MsgC(Color(200,200,200),"Setting doors speed for car "..tostring(self.Train).."; set = {"..a..", "..b.."} ...") + for i=1,#self.LeftDoorSpeed do + self.LeftDoorSpeed[i] = math.Rand(a,b) + self.RightDoorSpeed[i] = math.Rand(a,b) + end + Train.DoorSpeedsDone = true + --MsgC(Color(200,200,200),"done\n") + else + --MsgC(Color(200,200,200),"failed!\n") + end + end + ---------------------------------------------------------------------------- -- Accumulate derivatives self.TrainLinePressure_dPdT = 0.0 @@ -335,10 +424,18 @@ function TRAIN_SYSTEM:Think(dT) self.ParkingBrakePressure_dPdT = 0.0 self.WorkingChamberPressure_dPdT = 0.0 + -- Doors + self.LeftDoorCloseCylPressure_dPdT = 0.0 + self.RightDoorCloseCylPressure_dPdT = 0.0 + self._1stRightDoorCloseCylPressure_dPdT = 0.0 + self.LeftDoorOpenCylPressure_dPdT = 0.0 + self.RightDoorOpenCylPressure_dPdT = 0.0 + self.DoorLinePressure_dPdT = 0.0 + -- Reduce pressure for brake line self.TrainToBrakeReducedPressure = math.min(self.KM013offset,self.TrainLinePressure) -- * 0.725) -- Feed pressure to door line - self.DoorLinePressure = self.TrainToBrakeReducedPressure * 0.90 + self.DoorLinePressure = Train.DVRDisconnect.Value == 0 and math.min(3.6,self.TrainLinePressure) or self.DoorLinePressure local trainLineConsumption_dPdT = 0.0 local wagc = Train:GetBLConnectedWagonCount() local HaveEPK = not Train.SubwayTrain or not Train.SubwayTrain.ARS or not Train.SubwayTrain.ARS.NoEPK @@ -671,12 +768,185 @@ function TRAIN_SYSTEM:Think(dT) -- Simulate cross-feed between different wagons self:UpdatePressures(Train,dT) + ---------------------------------------------------------------------------- + -- Simulate doors opening, closing + local LeftRelease = Train.DoorReleaseLeft.Value == 0 + local RightRelease = Train.DoorReleaseRight.Value == 0 + local _1stRightRelease = Train.DoorReleaseExtra.Value == 0 + if self.DoorLinePressure >= 1.9 then --was > 2.6 + -- Simulate DVR engage lag + if Train.VDOL.Value == 1.0 and not Train.VDOLEnergized then + Train.VDOLEnergized = true + Train.VDOLTime = RealTime() + elseif Train.VDOL.Value == 0.0 then + Train.VDOLEnergized = false + end + if Train.VDOP.Value == 1.0 and not Train.VDOPEnergized then + Train.VDOPEnergized = true + Train.VDOPTime = RealTime() + elseif Train.VDOP.Value == 0.0 then + Train.VDOPEnergized = false + end + if (Train.VDOL.Value == 1.0) and (Train.VDOP.Value == 0.0) and not self.DoorLeft then + if Train.VDOLTime and RealTime() - Train.VDOLTime > (Train.DVRLag or 0) then self.DoorLeft = true end + if self.VDOLLoud then Train:PlayOnce("vdol_loud","cabin",0.8+math.random()*0.2,self.VDOLLoud) end + end + if (Train.VDOL.Value == 0.0) and (Train.VDOP.Value == 1.0) and not self.DoorRight then + if Train.VDOPTime and RealTime() - Train.VDOPTime > (Train.DVRLag or 0) then self.DoorRight = true end + if self.VDORLoud then Train:PlayOnce("vdop_loud","cabin",0.8+math.random()*0.2,self.VDORLoud) end + end + if Train.DVRHiss == 2 then + if Train.RD.Value == 1 and Train.VDOL.Value == 1 and not self.LeftExhausted then + Train:PlayOnce("dcyl_op_exh","bass",1,1) + self.LeftExhausted = true + end + if Train.RD.Value == 1 and Train.VDOP.Value == 1 and not self.RightExhausted then + Train:PlayOnce("dcyl_op_exh","bass",1,1) + self.RightExhausted = true + end + end + if (Train.VDZ.Value == 1.0 or Train.VDOL.Value == 1.0 and Train.VDOP.Value == 1.0 or self.RZDTimer) and (self.DoorLeft or self.DoorRight) then + self.DoorRight = false + self.DoorLeft = false + if Train.DVRHiss == 2 then + if Train.RD.Value == 0 and (self.LeftExhausted or self.RightExhausted) then + Train:PlayOnce("dcyl_cl_exh","bass",1,0.6) + self.LeftExhausted = false + self.RightExhausted = false + end + end + else + self.CloseValue = nil + end + if Train.VDOL.Value == 1.0 and Train.VDOP.Value == 1.0 then + self.RZDTimer = CurTime() + elseif self.RZDTimer and CurTime()-self.RZDTimer > 0.1 then + self.RZDTimer = nil + end + end + -- Тут было бы лучше сделать не 2 цилиндра на вагон, а 8, но тогда будет не 5 вызовов функции, а 17... + self:equalizePressure(dT,"RightDoorOpenCylPressure", self.DoorRight and self.DoorLinePressure or 0.0, 2.2, 10) + self:equalizePressure(dT,"RightDoorCloseCylPressure", not self.DoorRight and RightRelease and self.DoorLinePressure or 0.0, 2.2, 10) + self:equalizePressure(dT,"_1stRightDoorCloseCylPressure", not self.DoorRight and _1stRightRelease and RightRelease and self.DoorLinePressure or 0.0, 2.2, 10) + self:equalizePressure(dT,"LeftDoorOpenCylPressure", self.DoorLeft and self.DoorLinePressure or 0.0, 2.2, 10) + self:equalizePressure(dT,"LeftDoorCloseCylPressure", not self.DoorLeft and LeftRelease and self.DoorLinePressure or 0.0, 2.2, 10) + self.DoorLinePressure = self.DoorLinePressure-math.max(0,self.RightDoorOpenCylPressure_dPdT*0.005) + self.DoorLinePressure = self.DoorLinePressure-math.max(0,self.LeftDoorOpenCylPressure_dPdT*0.005) + self.DoorLinePressure = self.DoorLinePressure-math.max(0,self.RightDoorCloseCylPressure_dPdT*0.005) + self.DoorLinePressure = self.DoorLinePressure-math.max(0,self._1stRightDoorCloseCylPressure_dPdT*0.002) + self.DoorLinePressure = self.DoorLinePressure-math.max(0,self.LeftDoorCloseCylPressure_dPdT*0.005) + Train:SetPackedRatio("RightDoorCloseCylPressure_dPdT",not RightRelease and self.RightDoorCloseCylPressure_dPdT or 0) + Train:SetPackedRatio("LeftDoorCloseCylPressure_dPdT",not LeftRelease and self.LeftDoorCloseCylPressure_dPdT or 0) + Train:SetPackedRatio("_1stRightDoorCloseCylPressure_dPdT",not _1stRightRelease and self._1stRightDoorCloseCylPressure_dPdT or 0) + if self.DoorReleaseRightPrevious ~= Train.DoorReleaseRight.Value then + self.DoorReleaseRightPrevious = Train.DoorReleaseRight.Value + if not self.DoorRight and self.DoorReleaseRightPrevious == 1 then + self:equalizePressure(dT,"RightDoorCloseCylPressure", 0, 3) --was DoorLinePressure + end + end + if self.DoorReleaseExtraPrevious ~= Train.DoorReleaseExtra.Value then + self.DoorReleaseExtraPrevious = Train.DoorReleaseExtra.Value + if not self.DoorRight and self.DoorReleaseExtraPrevious == 1 then + self:equalizePressure(dT,"_1stRightDoorCloseCylPressure", 0, 6) + end + end + if self.DoorReleaseLeftPrevious ~= Train.DoorReleaseLeft.Value then + self.DoorReleaseLeftPrevious = Train.DoorReleaseLeft.Value + if not self.DoorLeft and self.DoorReleaseLeftPrevious == 1 then + self:equalizePressure(dT,"LeftDoorCloseCylPressure", 0, 6) --was DoorLinePressure + end + end + --[[ + ---------------debug--------------------- + self.dlreadtimer = self.dlreadtimer or CurTime() + if CurTime() - self.dlreadtimer > 1.0 then + self.dlreadtimer = CurTime() + if Train:GetDriver() then + PrintMessage(HUD_PRINTTALK, Format("Вагон %u; P д.м..: %.3f; КВД правый %u",Train:GetWagonNumber(),self.DoorLinePressure,Train.DoorReleaseRight.Value)) + end + end + ---------------debug---------------------]] + if self.VDOL ~= Train.VDOL.Value then + self.VDOL = Train.VDOL.Value + self:equalizePressure(dT,Train.DVRDisconnect.Value == 0 and "TrainLinePressure" or "DoorLinePressure", 0.0, 0.05) --was 0.3 + end + if self.VDOP ~= Train.VDOP.Value then + self.VDOP = Train.VDOP.Value + self:equalizePressure(dT,Train.DVRDisconnect.Value == 0 and "TrainLinePressure" or "DoorLinePressure", 0.0, 0.05) --was 0.3 + end + if self.VDZ ~= Train.VDZ.Value then + self.VDZ = Train.VDZ.Value + self:equalizePressure(dT,Train.DVRDisconnect.Value == 0 and "TrainLinePressure" or "DoorLinePressure", 0.0, 0.05) --was 0.3 + end + trainLineConsumption_dPdT = trainLineConsumption_dPdT + (Train.DVRDisconnect.Value == 0 and math.max(0,self.DoorLinePressure_dPdT*0.2) or 0) + if Train.CanStuckPassengerLeft then + for i in ipairs(self.LeftDoorStuck) do + self.LeftDoorStuck[i] = math.random() < (0.6+math.min(2,2-self.LeftDoorSpeed[i])*0.2)*Train.CanStuckPassengerLeft*0.6 and (math.random() > 0.7 and CurTime()+math.random()*15) + end + Train.CanStuckPassengerLeft = false + end + if Train.CanStuckPassengerRight then + for i in ipairs(self.RightDoorStuck) do + self.RightDoorStuck[i] = math.random() < (0.6+math.min(2,2-self.RightDoorSpeed[i])*0.2)*Train.CanStuckPassengerRight*0.6 and (math.random() > 0.7 and CurTime()+math.random()*15) + end + Train.CanStuckPassengerRight = false + end + + + Train.LeftDoorsOpen = false + Train.RightDoorsOpen = false + local openL = true + local openR = true + local llocked = false + local rlocked = false + local rmOpen = false --|Right and left doors + local rmClose = false --| + local lmOpen = false --| + local lmClose = false --|manual opening-closing + local v = "HDLK" + local m = "hod" + local n = "hcd" + for i=1,4 do + rlocked = Train[v..i].Value > 0 + llocked = Train[v..tostring(9-i)].Value > 0 + rmOpen = Train[m..i].Value > 0 or Train["outerhod"..i] and Train["outerhod"..i].Value > 0 + lmOpen = Train[m..tostring(9-i)].Value > 0 + rmClose = Train[n..i].Value > 0 + lmClose = Train[n..tostring(9-i)].Value > 0 + self.LeftDoorState[i] = math.Clamp(self.LeftDoorState[i] + (not llocked and ((lmOpen and 1.5 or lmClose and -1.5 or 0) + + (self.DoorLinePressure > 1.0 and (math.Round(self.LeftDoorOpenCylPressure - self.LeftDoorCloseCylPressure,1))*0.36*(not (lmOpen or lmClose) and self.LeftDoorSpeed[i] or 1) or 0))*dT or 0),self.LeftDoorStuck[i] and 0.3 or 0,1) + self.RightDoorState[i] = math.Clamp(self.RightDoorState[i] + (not rlocked and ((rmOpen and 1.5 or rmClose and -1.5 or 0) + + (self.DoorLinePressure > 1.0 and (math.Round(self.RightDoorOpenCylPressure - (i == 1 and self._1stRightDoorCloseCylPressure or self.RightDoorCloseCylPressure),1))*0.36*(not (rmOpen or rmClose) and self.RightDoorSpeed[i] or 1) or 0))*dT or 0),self.RightDoorStuck[i] and 0.3 or 0,1) + + if not Train.LeftDoorsOpen and self.LeftDoorState[i] > 0.02 then --was 0.06 + Train.LeftDoorsOpen = true + end + if not Train.RightDoorsOpen and self.RightDoorState[i] > 0.02 then --was 0.06 + Train.RightDoorsOpen = true + end + Train:SetPackedRatio("DoorL"..i,self.LeftDoorState[i]) + Train:SetPackedRatio("DoorR"..i,self.RightDoorState[i]) + if self.LeftDoorStuck[i] and (self.DoorLeft or type(self.LeftDoorStuck[i]) == "number" and CurTime()-self.LeftDoorStuck[i] > 0) then + self.LeftDoorStuck[i] = false + end + if self.RightDoorStuck[i] and (self.DoorRight or type(self.RightDoorStuck[i]) == "number" and CurTime()-self.RightDoorStuck[i] > 0) then + self.RightDoorStuck[i] = false + end + Train:SetPackedBool("DoorLS"..i,self.LeftDoorStuck[i]) + Train:SetPackedBool("DoorRS"..i,self.RightDoorStuck[i]) + end + Train:SetPackedBool("DoorL",self.DoorLeft) + Train:SetPackedBool("DoorR",self.DoorRight) + Train.BD:TriggerInput("Set",not Train.RightDoorsOpen and not Train.LeftDoorsOpen) + Train.LeftDoorsOpening = self.DoorLeft + Train.RightDoorsOpening = self.DoorRight + ---------------------------------------------------------------------------- -- Simulate compressor operation and train line depletion self.Compressor = Train.KK.Value * (Train.Electric.Aux750V > 550 and 1 or 0) - self.TrainLinePressure = self.TrainLinePressure - Train.AirConsumeRatio*trainLineConsumption_dPdT*dT -- 0.190 --0.170 --0.07 - if self.Compressor == 1 then self:equalizePressure(dT,"TrainLinePressure", 10.0, Train.CompressorEfficiency) end -- 0.04 - self:equalizePressure(dT,"TrainLinePressure", 0,Train.AirLeakRatio) + self.TrainLinePressure = self.TrainLinePressure - (Train.AirConsumeRatio or 1)*trainLineConsumption_dPdT*dT -- 0.190 --0.170 --0.07 + if self.Compressor == 1 then self:equalizePressure(dT,"TrainLinePressure", 10.0, Train.CompressorEfficiency or 0.04) end -- 0.04 + self:equalizePressure(dT,"TrainLinePressure", 0,Train.AirLeakRatio or 0.003) -- Overpressure if self.TrainLinePressure > math.max(7.2, (9.2 - self.TrainLineOverpressureValve*0.2)) and self.TrainLineOverpressureValve%2 == 0 then self.TrainLineOverpressureValve = self.TrainLineOverpressureValve + 1 end if self.TrainLineOverpressureValve%2 == 1 then @@ -699,77 +969,6 @@ function TRAIN_SYSTEM:Think(dT) Train.DKPT:TriggerInput("Set", self.BrakeCylinderPressure > 0.3) -- 1.8 - 2.0 Train.SQ3:TriggerInput("Set", Train.PassengerDoor and 0 or 1) - ---------------------------------------------------------------------------- - -- Simulate doors opening, closing - if self.DoorLinePressure > 3.5 then - if (Train.VDOL.Value == 1.0) and (Train.VDOP.Value == 0.0) and not self.DoorLeft then - self.DoorLeft = true - if self.VDOLLoud then Train:PlayOnce("vdol_loud","cabin",0.8+math.random()*0.2,self.VDOLLoud) end - end - if (Train.VDOL.Value == 0.0) and (Train.VDOP.Value == 1.0) and not self.DoorRight then - self.DoorRight = true - if self.VDORLoud then Train:PlayOnce("vdop_loud","cabin",0.8+math.random()*0.2,self.VDORLoud) end - end - if (Train.VDZ.Value == 1.0 or Train.VDOL.Value == 1.0 and Train.VDOP.Value == 1.0 or self.RZDTimer) and (self.DoorLeft or self.DoorRight) then - if not self.OpenWaitL or CurTime()-self.OpenWaitL < 0.2 then - self.DoorLeft = false - end - if not self.OpenWaitR or CurTime()-self.OpenWaitR < 0.2 then - self.DoorRight = false - end - else - self.CloseValue = nil - end - if Train.VDOL.Value == 1.0 and Train.VDOP.Value == 1.0 then - self.RZDTimer = CurTime() - elseif self.RZDTimer and CurTime()-self.RZDTimer > 0.1 then - self.RZDTimer = nil - end - end - if self.VDOL ~= Train.VDOL.Value then - self.VDOL = Train.VDOL.Value - self:equalizePressure(dT,"TrainLinePressure", 0.0, 0.05) - end - if self.VDOP ~= Train.VDOP.Value then - self.VDOP = Train.VDOP.Value - self:equalizePressure(dT,"TrainLinePressure", 0.0, 0.05) - end - if self.VDZ ~= Train.VDZ.Value then - self.VDZ = Train.VDZ.Value - self:equalizePressure(dT,"TrainLinePressure", 0.0, 0.05) - end - - - Train.LeftDoorsOpen = false - Train.RightDoorsOpen = false - local openL = true - local openR = true - for i=1,4 do - self.LeftDoorDir[i] = math.Clamp(self.LeftDoorDir[i]+dT/(self.DoorLeft and self.LeftDoorSpeed[i] or -self.LeftDoorSpeed[i]),-1,1) - self.RightDoorDir[i] = math.Clamp(self.RightDoorDir[i]+dT/(self.DoorRight and self.RightDoorSpeed[i] or -self.RightDoorSpeed[i]),-1,1) - self.LeftDoorState[i] = math.Clamp(self.LeftDoorState[i] + ((self.LeftDoorDir[i]/self.LeftDoorSpeed[i])*dT),0,1) - if self.LeftDoorState[i] == 0 or self.LeftDoorState[i] == 1 then self.LeftDoorDir[i] = 0 end - self.RightDoorState[i] = math.Clamp(self.RightDoorState[i] + ((self.RightDoorDir[i]/self.RightDoorSpeed[i])*dT),0,1) - if self.RightDoorState[i] == 0 or self.RightDoorState[i] == 1 then self.RightDoorDir[i] = 0 end - if not Train.LeftDoorsOpen and self.LeftDoorState[i] > 0 then - Train.LeftDoorsOpen = true - end - if self.LeftDoorState[i] > self.LeftDoorSpeed[i]/20 then self.OpenWaitL = false end - if self.RightDoorState[i] > self.LeftDoorSpeed[i]/20 then self.OpenWaitR = false end - if self.LeftDoorState[i] > 0 then openL = false end - if self.RightDoorState[i] > 0 then openR = false end - if not Train.RightDoorsOpen and self.RightDoorState[i] > 0 then - Train.RightDoorsOpen = true - end - Train:SetPackedRatio("DoorL"..i,self.LeftDoorState[i]) - Train:SetPackedRatio("DoorR"..i,self.RightDoorState[i]) - end - if openL and not self.OpenWaitL then self.OpenWaitL = CurTime() end - if openR and not self.OpenWaitR then self.OpenWaitR = CurTime() end - Train:SetPackedBool("DoorL",self.DoorLeft) - Train:SetPackedBool("DoorR",self.DoorRight) - Train.BD:TriggerInput("Set",not Train.RightDoorsOpen and not Train.LeftDoorsOpen) - ---------------------------------------------------------------------------- if self.DriverValveDisconnectPrevious ~= Train.DriverValveDisconnect.Value then self.DriverValveDisconnectPrevious = Train.DriverValveDisconnect.Value @@ -802,6 +1001,9 @@ function TRAIN_SYSTEM:Think(dT) Train:SetNW2Bool("FtI",Train.FrontTrainLineIsolation.Value ~= 0) Train:SetNW2Bool("RtI",Train.RearTrainLineIsolation.Value ~= 0) Train:SetNW2Bool("AD",Train.AirDistributorDisconnect.Value == 0) + Train:SetNW2Bool("DoorReleaseExtra",Train.DoorReleaseExtra.Value ~= 0) + Train:SetNW2Bool("DoorReleaseRight",Train.DoorReleaseRight.Value ~= 0) + Train:SetNW2Bool("DoorReleaseLeft",Train.DoorReleaseLeft.Value ~= 0) Train:SetNW2Bool("UAVAContacts",Train.UAVAC.Value ~= 0) local ValveType = self.ValveType > 1 diff --git a/lua/metrostroi/systems/sys_pr_14x_panels.lua b/lua/metrostroi/systems/sys_pr_14x_panels.lua index 9ed0e8e..c662442 100644 --- a/lua/metrostroi/systems/sys_pr_14x_panels.lua +++ b/lua/metrostroi/systems/sys_pr_14x_panels.lua @@ -31,7 +31,7 @@ function TRAIN_SYSTEM:Initialize() -- Реле-повторитель провода 8 (РП8) self.Train:LoadSystem("Rp8","Relay","REV-811T",{open_time = 0.2,bass = true }) -- Контактор дверей (КД) - self.Train:LoadSystem("KD","Relay","REV-811T",{ bass = true }) + self.Train:LoadSystem("KD","Relay","REV-811T",{ bass = true, close_time = 0.6 }) -- Реле остановки (РО) self.Train:LoadSystem("RO","Relay","KPD-110E",{ bass = true, close_time = 0--[[ , close_time = 0.1--]] }) end diff --git a/lua/metrostroi_data/languages/en_717.lua b/lua/metrostroi_data/languages/en_717.lua index 28a9b3e..cbcfbcb 100644 --- a/lua/metrostroi_data/languages/en_717.lua +++ b/lua/metrostroi_data/languages/en_717.lua @@ -204,6 +204,16 @@ Common.717.RetMedium = Medium load Common.717.RetFull = Full load Common.717.RetPassengers = Passengers load +Common.717.AUTOSTOP = Engage emergency stop valve + +Common.717.HOD = Manually open +Common.717.HCD = Manually close +Common.717.HDLK = Lock doors +Common.717.DoorReleaseExt = First door manual open valve +Common.717.DoorReleaseLeft = Emergency left doors manual open valve +Common.717.DoorReleaseRight = Emergency right doors manual open valve +Common.717.DVR87 = Door air distrubutor disconnect valve + #gmod_subway_81-717 Entities.gmod_subway_81-717_mvm.Buttons.Battery_C.1:UOSToggle = @[Common.ALL.UOS] Entities.gmod_subway_81-717_mvm.Buttons.Battery_R.2:UOSToggle = @[Common.ALL.UOS] @@ -566,6 +576,39 @@ Entities.gmod_subway_81-717_mvm.Buttons.EPKDisconnect.EPKToggle Entities.gmod_subway_81-717_mvm.Buttons.EPVDisconnect.EPKToggle = @[Common.ALL.EPV] Entities.gmod_subway_81-717_mvm.Buttons.ParkingBrake.ParkingBrakeToggle = @[Common.ALL.ParkingBrake] +Entities.gmod_subway_81-717_mvm.Buttons.AutostopValve.AutostopValveSet = @[Common.717.AUTOSTOP] + +#Doors manual controls +Entities.gmod_subway_81-717_mvm.Buttons.Doors7_8_right.hod4Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors5_6_right.hod3Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors3_4_right.hod2Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_right.hod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors7_8_right.hcd4Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors5_6_right.hcd3Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors3_4_right.hcd2Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_right.hcd1Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors7_8_left.hod5Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors5_6_left.hod6Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors3_4_left.hod7Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_left.hod8Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors7_8_left.hcd5Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors5_6_left.hcd6Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors3_4_left.hcd7Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_left.hcd8Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_right_outer.outerhod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.bldr7_8_rgh.HDLK4Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr5_6_rgh.HDLK3Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr3_4_rgh.HDLK2Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr1_2_rgh.HDLK1Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr7_8_lft.HDLK5Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr5_6_lft.HDLK6Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr3_4_lft.HDLK7Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr1_2_lft.HDLK8Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.DoorReleaseExtra.DoorReleaseExtraToggle = @[Common.717.DoorReleaseExt] +Entities.gmod_subway_81-717_mvm.Buttons.DoorReleaseLeft.DoorReleaseLeftToggle = @[Common.717.DoorReleaseLeft] +Entities.gmod_subway_81-717_mvm.Buttons.DoorReleaseRight.DoorReleaseRightToggle = @[Common.717.DoorReleaseRight] +Entities.gmod_subway_81-717_mvm.Buttons.DVR_87.DVRDisconnectToggle = @[Common.717.DVR87] + #gmod_subway_81-717_lvz #Buttons: @@ -985,6 +1028,39 @@ Entities.gmod_subway_81-717_lvz.Buttons.EPKDisconnect.EPKToggle Entities.gmod_subway_81-717_lvz.Buttons.EPVDisconnect.EPKToggle = @[Common.ALL.EPV] Entities.gmod_subway_81-717_lvz.Buttons.ParkingBrake.ParkingBrakeToggle = @[Common.ALL.ParkingBrake] +Entities.gmod_subway_81-717_lvz.Buttons.AutostopValve.AutostopValveSet = @[Common.717.AUTOSTOP] + +#Doors manual controls +Entities.gmod_subway_81-717_lvz.Buttons.Doors7_8_right.hod4Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors5_6_right.hod3Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors3_4_right.hod2Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_right.hod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors7_8_right.hcd4Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors5_6_right.hcd3Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors3_4_right.hcd2Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_right.hcd1Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors7_8_left.hod5Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors5_6_left.hod6Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors3_4_left.hod7Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_left.hod8Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors7_8_left.hcd5Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors5_6_left.hcd6Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors3_4_left.hcd7Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_left.hcd8Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_right_outer.outerhod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.bldr7_8_rgh.HDLK4Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr5_6_rgh.HDLK3Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr3_4_rgh.HDLK2Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr1_2_rgh.HDLK1Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr7_8_lft.HDLK5Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr5_6_lft.HDLK6Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr3_4_lft.HDLK7Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr1_2_lft.HDLK8Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.DoorReleaseExtra.DoorReleaseExtraToggle = @[Common.717.DoorReleaseExt] +Entities.gmod_subway_81-717_lvz.Buttons.DoorReleaseLeft.DoorReleaseLeftToggle = @[Common.717.DoorReleaseLeft] +Entities.gmod_subway_81-717_lvz.Buttons.DoorReleaseRight.DoorReleaseRightToggle = @[Common.717.DoorReleaseRight] +Entities.gmod_subway_81-717_lvz.Buttons.DVR_87.DVRDisconnectToggle = @[Common.717.DVR87] + #gmod_subway_81-714_mvm Entities.gmod_subway_81-714_mvm.Buttons.FrontPneumatic.FrontBrakeLineIsolationToggle = @[Common.ALL.FrontBrakeLineIsolationToggle] Entities.gmod_subway_81-714_mvm.Buttons.FrontPneumatic.FrontTrainLineIsolationToggle = @[Common.ALL.FrontTrainLineIsolationToggle] @@ -1069,6 +1145,37 @@ Entities.gmod_subway_81-714_mvm.Buttons.Voltages.!BatteryCurrent = @[Comm Entities.gmod_subway_81-714_mvm.Buttons.Pressures.!BCPressure = @[Common.ALL.BCPressure] Entities.gmod_subway_81-714_mvm.Buttons.Pressures.!BLTLPressure = @[Common.ALL.BLTLPressure] +#Doors manual controls +Entities.gmod_subway_81-714_mvm.Buttons.Doors7_8_right.iod8Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors5_6_right.iod7Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors3_4_right.iod6Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_right.iod5Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors7_8_right.icd8Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors5_6_right.icd7Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors3_4_right.icd6Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_right.icd5Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors7_8_left.iod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors5_6_left.iod2Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors3_4_left.iod3Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_left.iod4Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors7_8_left.icd1Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors5_6_left.icd2Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors3_4_left.icd3Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_left.icd4Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_right_outer.outerhod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.bldr7_8_rgh.IDLK8Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr5_6_rgh.IDLK7Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr3_4_rgh.IDLK6Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr1_2_rgh.IDLK5Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr7_8_lft.IDLK1Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr5_6_lft.IDLK2Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr3_4_lft.IDLK3Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr1_2_lft.IDLK4Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.DoorReleaseLeft.DoorReleaseLeftToggle = @[Common.717.DoorReleaseLeft] +Entities.gmod_subway_81-714_mvm.Buttons.DoorReleaseRight.DoorReleaseRightToggle = @[Common.717.DoorReleaseRight] +Entities.gmod_subway_81-714_mvm.Buttons.DVR_87.DVRDisconnectToggle = @[Common.717.DVR87] + + #gmod_subway_81-714_lvz Entities.gmod_subway_81-714_lvz.Buttons.FrontPneumatic.FrontBrakeLineIsolationToggle = @[Common.ALL.FrontBrakeLineIsolationToggle] Entities.gmod_subway_81-714_lvz.Buttons.FrontPneumatic.FrontTrainLineIsolationToggle = @[Common.ALL.FrontTrainLineIsolationToggle] @@ -1147,6 +1254,36 @@ Entities.gmod_subway_81-714_lvz.Buttons.Voltages.!BatteryCurrent = @[Comm Entities.gmod_subway_81-714_lvz.Buttons.Pressures.!BCPressure = @[Common.ALL.BCPressure] Entities.gmod_subway_81-714_lvz.Buttons.Pressures.!BLTLPressure = @[Common.ALL.BLTLPressure] +#Doors manual controls +Entities.gmod_subway_81-714_lvz.Buttons.Doors7_8_right.iod8Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors5_6_right.iod7Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors3_4_right.iod6Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_right.iod5Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors7_8_right.icd8Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors5_6_right.icd7Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors3_4_right.icd6Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_right.icd5Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors7_8_left.iod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors5_6_left.iod2Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors3_4_left.iod3Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_left.iod4Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors7_8_left.icd1Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors5_6_left.icd2Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors3_4_left.icd3Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_left.icd4Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_right_outer.outerhod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.bldr7_8_rgh.IDLK8Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr5_6_rgh.IDLK7Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr3_4_rgh.IDLK6Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr1_2_rgh.IDLK5Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr7_8_lft.IDLK1Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr5_6_lft.IDLK2Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr3_4_lft.IDLK3Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr1_2_lft.IDLK4Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.DoorReleaseLeft.DoorReleaseLeftToggle = @[Common.717.DoorReleaseLeft] +Entities.gmod_subway_81-714_lvz.Buttons.DoorReleaseRight.DoorReleaseRightToggle = @[Common.717.DoorReleaseRight] +Entities.gmod_subway_81-714_lvz.Buttons.DVR_87.DVRDisconnectToggle = @[Common.717.DVR87] + #Spawner: Entities.gmod_subway_81-717_mvm.Spawner.Announcer.Name = @[Common.Spawner.Announcer] Entities.gmod_subway_81-717_mvm.Spawner.Scheme.Name = @[Common.Spawner.Scheme] diff --git a/lua/metrostroi_data/languages/ru_717.lua b/lua/metrostroi_data/languages/ru_717.lua index b872d3a..1cc39ca 100644 --- a/lua/metrostroi_data/languages/ru_717.lua +++ b/lua/metrostroi_data/languages/ru_717.lua @@ -204,6 +204,17 @@ Common.717.RetMedium = Средняя загрузка Common.717.RetFull = Груженый Common.717.RetPassengers = Пассажиры +Common.717.AUTOSTOP = Сорвать срывной клапан + +Common.717.HOD = Раздвинуть двери +Common.717.HCD = Закрыть двери +Common.717.HDLK = Блокировка дверей +Common.717.DoorReleaseExt = Выключение первой правой двери +Common.717.DoorReleaseLeft = Выключение дверей левых +Common.717.DoorReleaseRight = Выключение дверей правых +Common.717.DVR87 = Разобщительный кран ДВР + + #gmod_subway_81-717 Entities.gmod_subway_81-717_mvm.Buttons.Battery_C.1:UOSToggle = @[Common.ALL.UOS] Entities.gmod_subway_81-717_mvm.Buttons.Battery_R.2:UOSToggle = @[Common.ALL.UOS] @@ -566,6 +577,38 @@ Entities.gmod_subway_81-717_mvm.Buttons.EPKDisconnect.EPKToggle Entities.gmod_subway_81-717_mvm.Buttons.EPVDisconnect.EPKToggle = @[Common.ALL.EPV] Entities.gmod_subway_81-717_mvm.Buttons.ParkingBrake.ParkingBrakeToggle = @[Common.ALL.ParkingBrake] +Entities.gmod_subway_81-717_mvm.Buttons.AutostopValve.AutostopValveSet = @[Common.717.AUTOSTOP] + +#Doors manual controls +Entities.gmod_subway_81-717_mvm.Buttons.Doors7_8_right.hod4Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors5_6_right.hod3Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors3_4_right.hod2Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_right.hod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors7_8_right.hcd4Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors5_6_right.hcd3Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors3_4_right.hcd2Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_right.hcd1Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors7_8_left.hod5Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors5_6_left.hod6Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors3_4_left.hod7Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_left.hod8Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors7_8_left.hcd5Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors5_6_left.hcd6Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors3_4_left.hcd7Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_left.hcd8Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_mvm.Buttons.Doors1_2_right_outer.outerhod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_mvm.Buttons.bldr7_8_rgh.HDLK4Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr5_6_rgh.HDLK3Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr3_4_rgh.HDLK2Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr1_2_rgh.HDLK1Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr7_8_lft.HDLK5Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr5_6_lft.HDLK6Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr3_4_lft.HDLK7Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.bldr1_2_lft.HDLK8Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_mvm.Buttons.DoorReleaseExtra.DoorReleaseExtraToggle = @[Common.717.DoorReleaseExt] +Entities.gmod_subway_81-717_mvm.Buttons.DoorReleaseLeft.DoorReleaseLeftToggle = @[Common.717.DoorReleaseLeft] +Entities.gmod_subway_81-717_mvm.Buttons.DoorReleaseRight.DoorReleaseRightToggle = @[Common.717.DoorReleaseRight] +Entities.gmod_subway_81-717_mvm.Buttons.DVR_87.DVRDisconnectToggle = @[Common.717.DVR87] #gmod_subway_81-717_lvz #Buttons: @@ -985,6 +1028,39 @@ Entities.gmod_subway_81-717_lvz.Buttons.EPKDisconnect.EPKToggle Entities.gmod_subway_81-717_lvz.Buttons.EPVDisconnect.EPKToggle = @[Common.ALL.EPV] Entities.gmod_subway_81-717_lvz.Buttons.ParkingBrake.ParkingBrakeToggle = @[Common.ALL.ParkingBrake] +Entities.gmod_subway_81-717_lvz.Buttons.AutostopValve.AutostopValveSet = @[Common.717.AUTOSTOP] + +#Doors manual controls +Entities.gmod_subway_81-717_lvz.Buttons.Doors7_8_right.hod4Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors5_6_right.hod3Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors3_4_right.hod2Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_right.hod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors7_8_right.hcd4Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors5_6_right.hcd3Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors3_4_right.hcd2Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_right.hcd1Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors7_8_left.hod5Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors5_6_left.hod6Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors3_4_left.hod7Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_left.hod8Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors7_8_left.hcd5Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors5_6_left.hcd6Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors3_4_left.hcd7Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_left.hcd8Set = @[Common.717.HCD] +Entities.gmod_subway_81-717_lvz.Buttons.Doors1_2_right_outer.outerhod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-717_lvz.Buttons.bldr7_8_rgh.HDLK4Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr5_6_rgh.HDLK3Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr3_4_rgh.HDLK2Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr1_2_rgh.HDLK1Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr7_8_lft.HDLK5Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr5_6_lft.HDLK6Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr3_4_lft.HDLK7Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.bldr1_2_lft.HDLK8Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-717_lvz.Buttons.DoorReleaseExtra.DoorReleaseExtraToggle = @[Common.717.DoorReleaseExt] +Entities.gmod_subway_81-717_lvz.Buttons.DoorReleaseLeft.DoorReleaseLeftToggle = @[Common.717.DoorReleaseLeft] +Entities.gmod_subway_81-717_lvz.Buttons.DoorReleaseRight.DoorReleaseRightToggle = @[Common.717.DoorReleaseRight] +Entities.gmod_subway_81-717_lvz.Buttons.DVR_87.DVRDisconnectToggle = @[Common.717.DVR87] + #gmod_subway_81-714_mvm Entities.gmod_subway_81-714_mvm.Buttons.FrontPneumatic.FrontBrakeLineIsolationToggle = @[Common.ALL.FrontBrakeLineIsolationToggle] Entities.gmod_subway_81-714_mvm.Buttons.FrontPneumatic.FrontTrainLineIsolationToggle = @[Common.ALL.FrontTrainLineIsolationToggle] @@ -1069,6 +1145,36 @@ Entities.gmod_subway_81-714_mvm.Buttons.Voltages.!BatteryCurrent = @[Common.ALL. Entities.gmod_subway_81-714_mvm.Buttons.Pressures.!BCPressure = @[Common.ALL.BCPressure] Entities.gmod_subway_81-714_mvm.Buttons.Pressures.!BLTLPressure = @[Common.ALL.BLTLPressure] +#Doors manual controls +Entities.gmod_subway_81-714_mvm.Buttons.Doors7_8_right.iod8Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors5_6_right.iod7Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors3_4_right.iod6Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_right.iod5Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors7_8_right.icd8Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors5_6_right.icd7Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors3_4_right.icd6Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_right.icd5Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors7_8_left.iod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors5_6_left.iod2Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors3_4_left.iod3Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_left.iod4Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors7_8_left.icd1Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors5_6_left.icd2Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors3_4_left.icd3Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_left.icd4Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_mvm.Buttons.Doors1_2_right_outer.outerhod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_mvm.Buttons.bldr7_8_rgh.IDLK8Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr5_6_rgh.IDLK7Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr3_4_rgh.IDLK6Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr1_2_rgh.IDLK5Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr7_8_lft.IDLK1Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr5_6_lft.IDLK2Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr3_4_lft.IDLK3Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.bldr1_2_lft.IDLK4Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_mvm.Buttons.DoorReleaseLeft.DoorReleaseLeftToggle = @[Common.717.DoorReleaseLeft] +Entities.gmod_subway_81-714_mvm.Buttons.DoorReleaseRight.DoorReleaseRightToggle = @[Common.717.DoorReleaseRight] +Entities.gmod_subway_81-714_mvm.Buttons.DVR_87.DVRDisconnectToggle = @[Common.717.DVR87] + #gmod_subway_81-714_lvz Entities.gmod_subway_81-714_lvz.Buttons.FrontPneumatic.FrontBrakeLineIsolationToggle = @[Common.ALL.FrontBrakeLineIsolationToggle] Entities.gmod_subway_81-714_lvz.Buttons.FrontPneumatic.FrontTrainLineIsolationToggle = @[Common.ALL.FrontTrainLineIsolationToggle] @@ -1147,6 +1253,36 @@ Entities.gmod_subway_81-714_lvz.Buttons.Voltages.!BatteryCurrent = @[Common.ALL. Entities.gmod_subway_81-714_lvz.Buttons.Pressures.!BCPressure = @[Common.ALL.BCPressure] #NEW Entities.gmod_subway_81-714_lvz.Buttons.Pressures.!BLTLPressure = @[Common.ALL.BLTLPressure] #NEW +#Doors manual controls +Entities.gmod_subway_81-714_lvz.Buttons.Doors7_8_right.iod8Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors5_6_right.iod7Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors3_4_right.iod6Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_right.iod5Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors7_8_right.icd8Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors5_6_right.icd7Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors3_4_right.icd6Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_right.icd5Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors7_8_left.iod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors5_6_left.iod2Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors3_4_left.iod3Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_left.iod4Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors7_8_left.icd1Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors5_6_left.icd2Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors3_4_left.icd3Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_left.icd4Set = @[Common.717.HCD] +Entities.gmod_subway_81-714_lvz.Buttons.Doors1_2_right_outer.outerhod1Set = @[Common.717.HOD] +Entities.gmod_subway_81-714_lvz.Buttons.bldr7_8_rgh.IDLK8Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr5_6_rgh.IDLK7Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr3_4_rgh.IDLK6Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr1_2_rgh.IDLK5Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr7_8_lft.IDLK1Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr5_6_lft.IDLK2Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr3_4_lft.IDLK3Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.bldr1_2_lft.IDLK4Toggle = @[Common.717.HDLK] +Entities.gmod_subway_81-714_lvz.Buttons.DoorReleaseLeft.DoorReleaseLeftToggle = @[Common.717.DoorReleaseLeft] +Entities.gmod_subway_81-714_lvz.Buttons.DoorReleaseRight.DoorReleaseRightToggle = @[Common.717.DoorReleaseRight] +Entities.gmod_subway_81-714_lvz.Buttons.DVR_87.DVRDisconnectToggle = @[Common.717.DVR87] + #Spawner: Entities.gmod_subway_81-717_mvm.Spawner.Announcer.Name = @[Common.Spawner.Announcer] Entities.gmod_subway_81-717_mvm.Spawner.Scheme.Name = @[Common.Spawner.Scheme] diff --git a/models/metrostroi_train/door_crans/cran_dooropen_head.dx80.vtx b/models/metrostroi_train/door_crans/cran_dooropen_head.dx80.vtx new file mode 100644 index 0000000..bb5c5ce --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_head.dx80.vtx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adebfc3ca6ee07aeb3057a79dd7ca70184a6f4e03fe3263a23fcb2fa2295b5f6 +size 9069 diff --git a/models/metrostroi_train/door_crans/cran_dooropen_head.dx90.vtx b/models/metrostroi_train/door_crans/cran_dooropen_head.dx90.vtx new file mode 100644 index 0000000..729e566 --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_head.dx90.vtx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47b3ce5108fc3abe0dcd27390eb5e89b943285c6c8d447cf6a8bb1d52fa9a7b6 +size 9069 diff --git a/models/metrostroi_train/door_crans/cran_dooropen_head.mdl b/models/metrostroi_train/door_crans/cran_dooropen_head.mdl new file mode 100644 index 0000000..cdc5f42 --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_head.mdl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb5054a0b3bbb39a3dc13fc84763b5e6bca836781599239206d2487dd266ab08 +size 1712 diff --git a/models/metrostroi_train/door_crans/cran_dooropen_head.sw.vtx b/models/metrostroi_train/door_crans/cran_dooropen_head.sw.vtx new file mode 100644 index 0000000..bfae3ff --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_head.sw.vtx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b047453d8b1d5390736eca0c978c62afd1c936718b34a2f131594edead81d35c +size 9069 diff --git a/models/metrostroi_train/door_crans/cran_dooropen_head.vvd b/models/metrostroi_train/door_crans/cran_dooropen_head.vvd new file mode 100644 index 0000000..4eb9f88 --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_head.vvd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d23b45c83fe0fbddb7a005c1df40f92c0a2313f71a1cba0aaa26c16d6b8eb62b +size 36160 diff --git a/models/metrostroi_train/door_crans/cran_dooropen_int.dx80.vtx b/models/metrostroi_train/door_crans/cran_dooropen_int.dx80.vtx new file mode 100644 index 0000000..7912f24 --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_int.dx80.vtx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f7d4cdabd60d7876cdbb40e7a03fdb5b1031ed5165620680fd4b9099d07b9b3 +size 6093 diff --git a/models/metrostroi_train/door_crans/cran_dooropen_int.dx90.vtx b/models/metrostroi_train/door_crans/cran_dooropen_int.dx90.vtx new file mode 100644 index 0000000..e0288f2 --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_int.dx90.vtx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9baf8a0054cf74991b2e4eee83bdbc3133c41b816b85482e5c985c7491805859 +size 6093 diff --git a/models/metrostroi_train/door_crans/cran_dooropen_int.mdl b/models/metrostroi_train/door_crans/cran_dooropen_int.mdl new file mode 100644 index 0000000..f1acf15 --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_int.mdl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c35783e5d87dc894c22f3ccc242137ca42a77f94316c5e71dfdb5ee8eb182e6f +size 1708 diff --git a/models/metrostroi_train/door_crans/cran_dooropen_int.sw.vtx b/models/metrostroi_train/door_crans/cran_dooropen_int.sw.vtx new file mode 100644 index 0000000..77f8865 --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_int.sw.vtx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6e12bfc13bdefd58948b7b784d419e14d0c982b28a6b38f3eebd9f0898cffa3 +size 6093 diff --git a/models/metrostroi_train/door_crans/cran_dooropen_int.vvd b/models/metrostroi_train/door_crans/cran_dooropen_int.vvd new file mode 100644 index 0000000..49edbf2 --- /dev/null +++ b/models/metrostroi_train/door_crans/cran_dooropen_int.vvd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9547efeb0cbd2b1b8044c9814fe9fea864138ec8ef397b4fbee0298dce8cdafa +size 24128 diff --git a/sound/subway_trains/717/door_cyl/vdo2_on.mp3 b/sound/subway_trains/717/door_cyl/vdo2_on.mp3 new file mode 100644 index 0000000..dc54761 --- /dev/null +++ b/sound/subway_trains/717/door_cyl/vdo2_on.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b81f4a9472d5d5bc60ddbd1eec4fd401b540bfef4b03d7df408437cb5df7db26 +size 28488 diff --git a/sound/subway_trains/717/door_cyl/vdo3_on.mp3 b/sound/subway_trains/717/door_cyl/vdo3_on.mp3 new file mode 100644 index 0000000..dc54761 --- /dev/null +++ b/sound/subway_trains/717/door_cyl/vdo3_on.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b81f4a9472d5d5bc60ddbd1eec4fd401b540bfef4b03d7df408437cb5df7db26 +size 28488 diff --git a/sound/subway_trains/717/door_cyl/vdo_on.mp3 b/sound/subway_trains/717/door_cyl/vdo_on.mp3 new file mode 100644 index 0000000..8fe5444 --- /dev/null +++ b/sound/subway_trains/717/door_cyl/vdo_on.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f2343ced6d07cc8506956b16b87051c8d15995c22eb1866c6a6be55fc08e8d2 +size 28201 diff --git a/sound/subway_trains/717/door_cyl/vdz2_on.mp3 b/sound/subway_trains/717/door_cyl/vdz2_on.mp3 new file mode 100644 index 0000000..5a24fed --- /dev/null +++ b/sound/subway_trains/717/door_cyl/vdz2_on.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85393c9975b7bb88121518ec44c2ba289d2f8d61da14025d1787e3735e88e3b6 +size 28412 diff --git a/sound/subway_trains/717/door_cyl/vdz3_on.mp3 b/sound/subway_trains/717/door_cyl/vdz3_on.mp3 new file mode 100644 index 0000000..5a24fed --- /dev/null +++ b/sound/subway_trains/717/door_cyl/vdz3_on.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85393c9975b7bb88121518ec44c2ba289d2f8d61da14025d1787e3735e88e3b6 +size 28412 diff --git a/sound/subway_trains/717/door_cyl/vdz_on.mp3 b/sound/subway_trains/717/door_cyl/vdz_on.mp3 new file mode 100644 index 0000000..5a24fed --- /dev/null +++ b/sound/subway_trains/717/door_cyl/vdz_on.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85393c9975b7bb88121518ec44c2ba289d2f8d61da14025d1787e3735e88e3b6 +size 28412