From 410c2e41e1ab8ebd6a8089e0bc3074708b1ad781 Mon Sep 17 00:00:00 2001 From: Hellss Date: Sun, 19 Dec 2021 13:22:48 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=92=D0=9A=D0=A1=D0=A2=20=D0=B8=20=D0=98?= =?UTF-8?q?=D0=A1=D0=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gmod_subway_81-717_mvm/cl_init.lua | 21 ++++++++++++++++++- lua/entities/gmod_subway_81-717_mvm/init.lua | 4 +++- .../gmod_subway_81-717_mvm/shared.lua | 3 +++ .../systems/sys_81_717_electric.lua | 5 ++++- lua/metrostroi/systems/sys_81_717_panel.lua | 8 ++++++- lua/metrostroi_data/languages/en_717.lua | 4 ++++ lua/metrostroi_data/languages/ru_717.lua | 4 ++++ 7 files changed, 45 insertions(+), 4 deletions(-) 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 ed390f8..1f6f796 100644 --- a/lua/entities/gmod_subway_81-717_mvm/cl_init.lua +++ b/lua/entities/gmod_subway_81-717_mvm/cl_init.lua @@ -766,6 +766,16 @@ ENT.ButtonMap["Block7"] = { var="KRP",speed=16,vmin=1,vmax=0, sndvol = 0.07,snd = function(val) return val and "button1_on" or "button1_off" end,sndmin = 60,sndmax = 1e3/3,sndang = Angle(-90,0,0), }}, + {ID = "VKSTToggle",x=28,y=58,radius=20,tooltip="",model = { + model = "models/metrostroi_train/81-710/ezh3_tumbler_pp250.mdl",ang = 180,z=-2, + var="VKST",speed=16, + sndvol = 1,snd = function(val) return val and "switch_on" or "switch_off" end, + sndmin = 90,sndmax = 1e3,sndang = Angle(-90,0,0), + }}, + {ID = "!IST", x=43, y=58, radius=8, tooltip="", model = { + lamp = {model = "models/metrostroi_train/81-502/lamps/svetodiod_small_502.mdl",z = -2,color = Color(255,50,45), var="ISTLamp"}, + sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,50,45),z=-1.4,} + }}, {ID = "KAHSet",x=43,y=88,radius=20,tooltip="",model = { model = "models/metrostroi_train/81-710/ezh3_button_black.mdl",z = -2, var="KAH",speed=16,vmin=1,vmax=0, @@ -775,7 +785,7 @@ ENT.ButtonMap["Block7"] = { {ID = "KAHKToggle",x=23,y=98,w=40,h=20,tooltip="",model = { model = "models/metrostroi_train/81/krishka.mdl",ang = 0,z = -1, var="KAHK",speed=8,min=0.43,max=0.685,disable="KAHSet", - plomb = {model = "models/metrostroi_train/81/plomb.mdl",ang=135,x=-17,y=-45,z=-0,var="KAHPl",ID="KAHPl",}, + plomb = {model = "models/metrostroi_train/81/plomb.mdl",ang=80,x=15,y=-49,z=-0,var="KAHPl",ID="KAHPl",}, sndvol = 1,snd = function(val) return val and "kr_close" or "kr_open" end, sndmin = 90,sndmax = 1e3,sndang = Angle(-90,0,0), noTooltip = true, @@ -809,6 +819,12 @@ ENT.ButtonMap["Block7"] = { }}, } } +ENT.ClientProps["VKSTIST"] = { + model = "", + pos = Vector(0,0,0), + ang = Angle(0,0,0), + hideseat = 0.5, +} ENT.ButtonMap["Block1"] = { pos = Vector(450.4,28.2,1.3+5.35), @@ -3305,6 +3321,9 @@ function ENT:Think() self:SetSoundState("vent"..i,self.VentG2,1) end end + + self:SetSoundState("IST", self:GetPackedBool("IST") and 1 or 0, 0.95) + if self.RingType ~= self:GetNW2Int("RingType",1) then self.RingType = self:GetNW2Int("RingType",1) self:SetSoundState(self.RingName,0,0) diff --git a/lua/entities/gmod_subway_81-717_mvm/init.lua b/lua/entities/gmod_subway_81-717_mvm/init.lua index 09fc955..09ed1ec 100644 --- a/lua/entities/gmod_subway_81-717_mvm/init.lua +++ b/lua/entities/gmod_subway_81-717_mvm/init.lua @@ -11,7 +11,7 @@ ENT.SyncTable = { "VZ1","VUD1","KDL","KDLR","KDLK","KDP","KDLRK","DoorSelect", "KRZD","R_VPR","VozvratRP","AVU","KVP","ConverterProtection","RZP",--"SP","GreenRP", "KSN","ARS","ARSR","ALS","OtklAVU","OtklBV","OtklBVK","OVT","L_1","L_2","L_3","VP","DIPoff", - "VMK","BPSNon","RezMK","ARS13","L_4","VUS","VAH","VAD","KRP", + "VMK","BPSNon","RezMK","ARS13","L_4","VUS","VAH","VAD","KRP","VKST", "KAH","KAHK","KDPK", "A53","A56","A54","A17","A44","A39","A70","A14","A74","A26","AR63","AS1","A13","A21","A31","A32","A16","A12","A24","A49","A27","A72","A50","A29","A46","A47","A71","A7","A9","A84","A8","A52","A19","A48","A10","A22","A30","A1","A2","A3","A4","A5","A6","A18","A73","A20","A25","A11","A37","A45","A38","A51","A65","A66","A42","A43","A41","A40","A75","A76","A60","A58","A57","A59","A28", "AV2","AV3","AV4","AV5","AV6","AV1", @@ -649,6 +649,8 @@ function ENT:Think() self:SetPackedBool("M1_3",Panel.M1_3 > 0) self:SetPackedBool("M4_7",Panel.M4_7 > 0) self:SetPackedRatio("M8",Panel.M8) + self:SetPackedBool("IST",Panel.IST > 0) + self:SetPackedBool("ISTLamp",Panel.IST > 0 and CurTime() % 0.333 > 0.166) self:SetNW2Int("WrenchMode",self.KVWrenchMode) self:SetPackedBool("ReverserPresent",self.KVWrenchMode and self.KVWrenchMode>0) self:SetPackedRatio("CranePosition", Pneumatic.RealDriverValvePosition) diff --git a/lua/entities/gmod_subway_81-717_mvm/shared.lua b/lua/entities/gmod_subway_81-717_mvm/shared.lua index a9320e2..9970422 100644 --- a/lua/entities/gmod_subway_81-717_mvm/shared.lua +++ b/lua/entities/gmod_subway_81-717_mvm/shared.lua @@ -572,6 +572,9 @@ function ENT:InitializeSounds() self.SoundNames["ring_old"] = {loop=0.15,"subway_trains/717/ring/ringo_start.wav","subway_trains/717/ring/ringo_loop.wav","subway_trains/717/ring/ringo_end.mp3"} self.SoundPositions["ring_old"] = {60,1e9,Vector(459,6,10),0.35} + self.SoundNames["IST"] = {loop=true,"subway_trains/717/ring/son17.wav"} + self.SoundPositions["IST"] = {60,1e9,Vector(443.8,0,-3.2),0.15} + self.SoundNames["vpr"] = {loop=0.8,"subway_trains/common/other/radio/vpr_start.wav","subway_trains/common/other/radio/vpr_loop.wav","subway_trains/common/other/radio/vpr_off.wav"} self.SoundPositions["vpr"] = {60,1e9,Vector(420,-49 ,61),0.05} diff --git a/lua/metrostroi/systems/sys_81_717_electric.lua b/lua/metrostroi/systems/sys_81_717_electric.lua index 7f0eafb..eaca862 100644 --- a/lua/metrostroi/systems/sys_81_717_electric.lua +++ b/lua/metrostroi/systems/sys_81_717_electric.lua @@ -451,7 +451,10 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) Panel.L1 = T[57] end Panel.M8 = S["V2"]*Train.PVK.Value - + + Train.C1:TriggerInput("Set", T[1]) + Panel.IST = Train.C1.Value*Train.VKST.Value*T[64] + local ASNP_VV = Train.ASNP_VV ASNP_VV.Power = BO*Train.AS1.Value*Train.R_ASNPOn.Value ASNP_VV.AmplifierPower = ASNP_VV.Power*Train.ASNP.LineOut*Train.R_UNch.Value*Train.A26.Value diff --git a/lua/metrostroi/systems/sys_81_717_panel.lua b/lua/metrostroi/systems/sys_81_717_panel.lua index 736e55d..660f559 100644 --- a/lua/metrostroi/systems/sys_81_717_panel.lua +++ b/lua/metrostroi/systems/sys_81_717_panel.lua @@ -177,6 +177,9 @@ function TRAIN_SYSTEM:Initialize() self.Train:LoadSystem("KV3","Relay","Switch",{bass=true}) self.Train:LoadSystem("R1","Relay","Switch",{bass=true,close_time=2.3}) + self.Train:LoadSystem("C1","Relay","Switch",{bass=true,close_time=5.0}) + self.Train:LoadSystem("VKST","Relay","Switch",{bass=true,normally_closed=true}) + self.V1 = 0 self.LUDS = 0 self.RedLight2 = 0 @@ -234,6 +237,8 @@ function TRAIN_SYSTEM:Initialize() self.CBKIPower = 0 self.PCBKPower = 0 + + self.IST = 0 end @@ -241,7 +246,8 @@ function TRAIN_SYSTEM:Outputs() return { "V1","LUDS","RedLight2","RedLight1","Headlights1","Headlights2","EqLights","CabLights","EqLights","PanelLights","CabinLight","EmergencyLights","MainLights","DoorsLeft","DoorsRight","DoorsW","GreenRP","BrW","AVU","LKVP","RZP","KUP","BrT","LSN","Ring","SD","LST","LVD","LhRK","KVC","SD","TW18", "KT","LEKK", "LKVD","LN","RS","OneFreq","AR04","AR0","AR40","AR60","AR70","AR80","L1","M1_3","M4_7","M8", "AnnouncerPlaying","AnnouncerBuzz","VPR", - "CBKIPower","PCBKPower"} + "CBKIPower","PCBKPower", + "IST"} end TRAIN_SYSTEM.AVMap = { "A11","A17","A44","A26","AR63","A61", diff --git a/lua/metrostroi_data/languages/en_717.lua b/lua/metrostroi_data/languages/en_717.lua index 2afe629..3813e62 100644 --- a/lua/metrostroi_data/languages/en_717.lua +++ b/lua/metrostroi_data/languages/en_717.lua @@ -63,6 +63,8 @@ Common.717.RZPL = RZP: Power supply protection relay Common.717.VPAOn = VPA: Enable train unit Common.717.VPAOff = VPA: Disable train unit Common.717.VZD = VZD: Door control toggle (close doors) +Common.717.VKST = VKST: Brake status control toggle +Common.717.IST = IST: Brake status indicator Common.717.A53 = A53: Auxiliary circuits contactor Common.717.A56 = A56: Battery @@ -333,6 +335,8 @@ Entities.gmod_subway_81-717_mvm.Buttons.Block7.VAHToggle = @[Comm Entities.gmod_subway_81-717_mvm.Buttons.Block7.KRPSet = @[Common.ALL.KRP] Entities.gmod_subway_81-717_mvm.Buttons.Block7.KAHSet = @[Common.ALL.KAH] Entities.gmod_subway_81-717_mvm.Buttons.Block7.KAHKToggle = @[Common.ALL.KAHK] +Entities.gmod_subway_81-717_mvm.Buttons.Block7.VKSTToggle = @[Common.717.VKST] +Entities.gmod_subway_81-717_mvm.Buttons.Block7.!IST = @[Common.717.IST] Entities.gmod_subway_81-717_mvm.Buttons.Block7.!PNT = @[Common.ALL.BrT] Entities.gmod_subway_81-717_mvm.Buttons.Block7.KDPSet = @[Common.ALL.KDP] Entities.gmod_subway_81-717_mvm.Buttons.Block7.KDPKToggle = @[Common.ALL.KDPK] diff --git a/lua/metrostroi_data/languages/ru_717.lua b/lua/metrostroi_data/languages/ru_717.lua index 0fcf850..08fd5c7 100644 --- a/lua/metrostroi_data/languages/ru_717.lua +++ b/lua/metrostroi_data/languages/ru_717.lua @@ -63,6 +63,8 @@ Common.717.RZPL = РЗП: Сработка реле защиты Common.717.VPAOn = ВПА: Включение поездной аппаратуры Common.717.VPAOff = ВПА: Отключение поездной аппаратуры Common.717.VZD = ВЗД: Выключатель закрытия дверей +Common.717.VKST = ВКСТ: Выключатель контроля состояния тормозов +Common.717.IST = ИСТ: Индикатор состояния тормозов Common.717.A53 = А53: Контактор вспомогательных цепей Common.717.A56 = А56: Аккумуляторная батарея @@ -333,6 +335,8 @@ Entities.gmod_subway_81-717_mvm.Buttons.Block7.VAHToggle = @[Comm Entities.gmod_subway_81-717_mvm.Buttons.Block7.KRPSet = @[Common.ALL.KRP] Entities.gmod_subway_81-717_mvm.Buttons.Block7.KAHSet = @[Common.ALL.KAH] Entities.gmod_subway_81-717_mvm.Buttons.Block7.KAHKToggle = @[Common.ALL.KAHK] +Entities.gmod_subway_81-717_mvm.Buttons.Block7.VKSTToggle = @[Common.717.VKST] +Entities.gmod_subway_81-717_mvm.Buttons.Block7.!IST = @[Common.717.IST] Entities.gmod_subway_81-717_mvm.Buttons.Block7.!PNT = @[Common.ALL.BrT] Entities.gmod_subway_81-717_mvm.Buttons.Block7.KDPSet = @[Common.ALL.KDP] Entities.gmod_subway_81-717_mvm.Buttons.Block7.KDPKToggle = @[Common.ALL.KDPK] From 7125866a33c62888ff0541a157f5b5039b4b93c4 Mon Sep 17 00:00:00 2001 From: Hellss Date: Tue, 28 Dec 2021 20:00:38 +0300 Subject: [PATCH 2/2] add +-0.5 random --- lua/metrostroi/systems/sys_81_717_panel.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/metrostroi/systems/sys_81_717_panel.lua b/lua/metrostroi/systems/sys_81_717_panel.lua index 660f559..669aeb7 100644 --- a/lua/metrostroi/systems/sys_81_717_panel.lua +++ b/lua/metrostroi/systems/sys_81_717_panel.lua @@ -177,7 +177,7 @@ function TRAIN_SYSTEM:Initialize() self.Train:LoadSystem("KV3","Relay","Switch",{bass=true}) self.Train:LoadSystem("R1","Relay","Switch",{bass=true,close_time=2.3}) - self.Train:LoadSystem("C1","Relay","Switch",{bass=true,close_time=5.0}) + self.Train:LoadSystem("C1","Relay","Switch",{bass=true,close_time=4.5+math.random()}) self.Train:LoadSystem("VKST","Relay","Switch",{bass=true,normally_closed=true}) self.V1 = 0