diff --git a/lua/entities/gmod_subway_81-722/cl_init.lua b/lua/entities/gmod_subway_81-722/cl_init.lua index b502d30..cb42ea4 100644 --- a/lua/entities/gmod_subway_81-722/cl_init.lua +++ b/lua/entities/gmod_subway_81-722/cl_init.lua @@ -1155,12 +1155,12 @@ ENT.ButtonMap["Vityaz"] = { } } -ENT.ButtonMap["Sarmat"] = { - pos = Vector(470.85,41.65,-6.2), - ang = Angle(0.2,-64,67), - width = 1024, - height = 640, - scale = 0.02*0.567, +ENT.ButtonMap["BMCIK"] = { + pos = Vector(470.892,41.545,-6.23), + ang = Angle(0.2,-64.12,67), + width = 1280, + height = 800, + scale = 0.0089, sensor = true, system = "BMCIK", hideseat=0.2, @@ -1198,22 +1198,22 @@ ENT.ButtonMap["TNM"] = { hide=2, } -ENT.ButtonMap["LastStation"] = { - pos = Vector(473.8,-12.5,43.5), +ENT.ButtonMap["BMTS"] = { + pos = Vector(473.8,-12.8,44.7), ang = Angle(0,90,90), width = 512, - height = 64, - scale = 0.1, + height = 80, + scale = 0.1012, hide=2, } -ENT.ButtonMap["Tickers"] = { - pos = Vector(-455.4,-11.1,52.8), +ENT.ButtonMap["BIT"] = { + pos = Vector(-455.4,-10.85,52.62), ang = Angle(0,90,90), - width = 512, - height = 64, - scale = 0.094, - hideseat=1.5, + width = 1024, + height = 192, + scale = 0.0268, + hideseat = 1.5, } ENT.ButtonMap["SarmatButtons"] = { pos = Vector(476.2,30.2,-6.4), @@ -1223,14 +1223,14 @@ ENT.ButtonMap["SarmatButtons"] = { scale = 0.0625, buttons = { - {ID = "SarmatUpSet",x=6,y=2,w=14,h=13, tooltip="САРМАТ: Вверх"}, - {ID = "SarmatDownSet",x=6,y=2+13*1,w=14,h=13, tooltip="САРМАТ: Вниз"}, - {ID = "SarmatEnterSet",x=6,y=2+13*2,w=14,h=13, tooltip="САРМАТ: Enter"}, - {ID = "SarmatEscSet",x=6,y=2+13*3,w=14,h=13, tooltip="САРМАТ: Esc"}, - {ID = "SarmatF1Set",x=6,y=2+13*4,w=14,h=13, tooltip="САРМАТ: F1"}, - {ID = "SarmatF2Set",x=6,y=2+13*5,w=14,h=13, tooltip="САРМАТ: F2"}, - {ID = "SarmatF3Set",x=6,y=2+13*6,w=14,h=13, tooltip="САРМАТ: F3"}, - {ID = "SarmatF4Set",x=6,y=2+13*7,w=14,h=13, tooltip="САРМАТ: F4"}, + {ID = "SarmatUpSet",x=6,y=2,w=14,h=13, tooltip="БМЦИК: Вверх"}, + {ID = "SarmatDownSet",x=6,y=2+13*1,w=14,h=13, tooltip="БМЦИК: Вниз"}, + {ID = "SarmatEnterSet",x=6,y=2+13*2,w=14,h=13, tooltip="БМЦИК: Enter"}, + {ID = "SarmatEscSet",x=6,y=2+13*3,w=14,h=13, tooltip="БМЦИК: Esc"}, + {ID = "SarmatF1Set",x=6,y=2+13*4,w=14,h=13, tooltip="БМЦИК: F1"}, + {ID = "SarmatF2Set",x=6,y=2+13*5,w=14,h=13, tooltip="БМЦИК: F2"}, + {ID = "SarmatF3Set",x=6,y=2+13*6,w=14,h=13, tooltip="БМЦИК: F3"}, + {ID = "SarmatF4Set",x=6,y=2+13*7,w=14,h=13, tooltip="БМЦИК: F4"}, } } ENT.ButtonMap["BMP"] = { @@ -1241,10 +1241,21 @@ ENT.ButtonMap["BMP"] = { scale = 0.0625, buttons = { - {ID = "SarmatPathSet",x=6,y=4,w=13,h=14, tooltip="САРМАТ: Путь"}, - {ID = "SarmatLineSet",x=6,y=18,w=13,h=14, tooltip="САРМАТ: Линия"}, - {ID = "SarmatZeroSet",x=19,y=4,w=13,h=14, tooltip="САРМАТ: >0<"}, - {ID = "SarmatStartSet",x=19,y=18,w=13,h=14, tooltip="САРМАТ: Пуск"}, + {ID = "SarmatPathSet",x=6,y=4,w=13,h=14, tooltip="БМЦИК: Путь"}, + {ID = "SarmatLineSet",x=6,y=18,w=13,h=14, tooltip="БМЦИК: Линия"}, + {ID = "!SarmatLineLamp",x=7, y=19.5, radius=4, tooltip="БМЦИК: Светодиод Линия", model = { + lamp = { + speed=16, + model = "models/metrostroi_train/81-502/lamps/svetodiod_small_502.mdl", + var="BMCIK:LineEnabled", + z=-1.5, + color=Color(255,0,0), + scale = 0.5 + }, + sprite = {bright=0.2,size=0.15,scale=0.02,vscale=0.02,color=Color(255,0,0),z=0} + }}, + {ID = "SarmatZeroSet",x=19,y=4,w=13,h=14, tooltip="БМЦИК: >0<"}, + {ID = "SarmatStartSet",x=19,y=18,w=13,h=14, tooltip="БМЦИК: Пуск"}, } } ENT.Lights = { @@ -1281,12 +1292,11 @@ ENT.Lights = { } function ENT:Initialize() self.BaseClass.Initialize(self) - self.Vityaz = self:CreateRT("721Vityaz",1024,1024) - self.PAM = self:CreateRT("717PAM",1024,512) - self.Tickers = self:CreateRT("721Tickers",1024,128) - self.Sarmat = self:CreateRT("721Sarmat",1024,1024) + self.Vityaz = self:CreateRT("722MFDU",1024,1024) + self.BITScr = self:CreateRT("722BIT",1024,256) + self.BMCIKScr = self:CreateRT("722BMCIK",2048,1024) self.TNMScr = self:CreateRT("722TNM",256,128) - self.LastStation = self:CreateRT("721LastStation",512,64) + self.BMTSScr = self:CreateRT("722BMTS",512,128) self.ReleasedPdT = 0 self.CraneRamp = 0 self.CraneRRamp = 0 @@ -1301,8 +1311,6 @@ function ENT:Initialize() self.CompressorVol = 0 self.ParkingBrake = 0 self.BrakeCylinder = 0.5 - self.BPSNBuzzVolume = 0 - end function ENT:UpdateWagonNumber() local count = math.max(4,math.ceil(math.log10(self.WagonNumber+1))) @@ -1329,17 +1337,22 @@ local Cpos = { local conPos = { 0,0.22,0.41,0.6,0.8,1 } +local function getBitValue(value, offset, bitCount) + local mask = bit.lshift(bit.lshift(1,bitCount)-1,offset) + return bit.rshift(bit.band(value,mask),offset) +end function ENT:Think() self.BaseClass.Think(self) if not self.RenderClientEnts or self.CreatingCSEnts then return end + local sarmatInvert = self:GetNW2Bool("SarmatInvert") if not self.PassSchemesDone then local sarmat,sarmatr = self.ClientEnts.sarmat,self.ClientEnts.sarmatr local scheme = Metrostroi.Skins["722_schemes"] and Metrostroi.Skins["722_schemes"][self.Scheme] if IsValid(sarmat) and IsValid(sarmatr) and scheme then - if self:GetNW2Bool("SarmatInvert") then + if sarmatInvert then sarmat:SetSubMaterial(0,scheme[2]) sarmatr:SetSubMaterial(0,scheme[1]) else @@ -1354,41 +1367,53 @@ function ENT:Think() self.PassSchemesDone = false self.Scheme = self:GetNW2Int("Scheme",1) end - if self.InvertSchemes ~= self:GetNW2Bool("SarmatInvert",false) then + if self.InvertSchemes ~= sarmatInvert then self.PassSchemesDone=false - self.InvertSchemes = self:GetNW2Bool("SarmatInvert",false) + self.InvertSchemes = sarmatInvert end - local Headlight = self:GetPackedRatio("Headlight") - self:SetLightPower(1,Headlight>0,Headlight) - self:SetLightPower(31,Headlight>0,Headlight) - self:SetLightPower(32,Headlight>0,Headlight) - self:SetLightPower(2,self:GetPackedBool("RedLights")) - self:SetLightPower(33,self:GetPackedBool("RedLights")) - self:SetLightPower(34,self:GetPackedBool("RedLights")) + local headlight = self:GetPackedRatio("Headlight") + self:SetLightPower(1,headlight>0,headlight) + self:SetLightPower(31,headlight>0,headlight) + self:SetLightPower(32,headlight>0,headlight) if IsValid(self.GlowingLights[1]) then - if self:GetPackedRatio("Headlights") < 1 and self.GlowingLights[1]:GetFarZ() ~= 7000 then + if headlight < 1 and self.GlowingLights[1]:GetFarZ() ~= 7000 then self.GlowingLights[1]:SetFarZ(7000) end - if self:GetPackedRatio("Headlights") == 1 and self.GlowingLights[1]:GetFarZ() ~= 8192 then + if headlight== 1 and self.GlowingLights[1]:GetFarZ() ~= 8192 then self.GlowingLights[1]:SetFarZ(8192) end end + self:ShowHide("HeadLightsH",headlight==0.5) + self:ShowHide("HeadLights",headlight>0.5) + + local redlights = self:GetPackedBool("RedLights") + self:ShowHide("RedLights",redlights) + self:SetLightPower(2,redlights) + self:SetLightPower(33,redlights) + self:SetLightPower(34,redlights) + self:SetLightPower(3,self:GetPackedBool("SOSD")) + local cablight = self:GetPackedRatio("CabLights") + self:ShowHide("lamps_cab_e",cablight>0) + self:ShowHide("lamps_cab_f",cablight>0.3) self:SetLightPower(10,cablight>0,cablight) self:SetLightPower("lamps_cab_e",cablight>0,cablight) self:SetLightPower("lamps_cab_f",cablight>0.3,cablight) local passlight = self:GetPackedRatio("SalonLighting") + self:ShowHideSmooth("lamps_salon",passlight) self:SetLightPower(11,passlight>0,passlight) self:SetLightPower(12,passlight>0,passlight) self:SetLightPower(13,passlight>0,passlight) - self:SetLightPower(14,self:GetPackedBool("PanelLighting")) - self:SetLightPower(15,self:GetPackedBool("PanelLighting")) - self:SetLightPower(16,self:GetPackedBool("PanelLighting")) - self:SetLightPower(17,self:GetPackedBool("PanelLighting")) + local panelLightning = self:GetPackedBool("PanelLighting") + self:ShowHide("led",panelLightning) + self:SetLightPower(14,panelLightning) + self:SetLightPower(15,panelLightning) + self:SetLightPower(16,panelLightning) + self:SetLightPower(17,panelLightning) local BortLSD,BortPneumo,BortBV = self:GetPackedBool("BortLSD"),self:GetPackedBool("BortPneumo"),self:GetPackedBool("BortBV") self:ShowHide("bortlamp_lsd",BortLSD) @@ -1401,7 +1426,6 @@ function ENT:Think() self:SetLightPower(22,BortBV,1) self:SetLightPower(25,BortBV,1) - self:ShowHide("led",self:GetPackedBool("PanelLighting")) --ANIMS self:Animate("brake_line", self:GetPackedRatio("BLPressure"), 0.037, 0.795, 256,2) self:Animate("train_line", self:GetPackedRatio("TLPressure"), 0.037, 0.795, 4096,2) @@ -1423,52 +1447,56 @@ function ENT:Think() self:Animate("UAVA", self:GetPackedBool("UAVA") and 1 or 0, 0, 0.25, 6,false) self:Animate("EmergencyBrakeValve", self:GetPackedBool("EmergencyBrakeValve") and 1 or 0, 0, 0.3, 6,false) - self:ShowHide("HeadLights",self:GetPackedBool("Headlights2")) - self:ShowHide("HeadLightsH",self:GetPackedBool("Headlights1")) - self:ShowHide("RedLights",self:GetPackedBool("RedLights")) - - self:ShowHideSmooth("lamps_salon",self:GetPackedRatio("SalonLighting")) - - self:ShowHide("lamps_cab_e",cablight>0) - self:ShowHide("lamps_cab_f",cablight>0.3) - self:ShowHide("doorl_l",self:GetPackedBool("DoorAlarmL")) - self:ShowHide("doorl_r",self:GetPackedBool("DoorAlarmR")) + local doorAlarm = self:GetNW2Int("BNT:DoorAlarm") + self:SetSoundState("door_alarm",getBitValue(doorAlarm,0,1),1) + self:ShowHide("doorl_l",getBitValue(doorAlarm,1,1) > 0) + self:ShowHide("doorl_r",getBitValue(doorAlarm,2,1) > 0) + --Радио self:ShowHide("rvs",self:GetPackedBool("RadioRVS")) 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) - local led_back = self:GetPackedBool("PassSchemesLEDO",false) - if self:GetPackedBool("SarmatInvert",false) then led_back = not led_back end - local sleft,sright = self:GetPackedBool("SarmatLeft"),self:GetPackedBool("SarmatRight") - for i=1,4 do - self:ShowHide("led_l_f"..i,not led_back and sleft) - self:ShowHide("led_l_b"..i,led_back and sleft) - self:ShowHide("led_r_f"..i,not led_back and sright) - self:ShowHide("led_r_b"..i,led_back and sright) + local bntL = self:GetNW2Int("BNT:Left") + local bntR = self:GetNW2Int("BNT:Right") + local bntPowerL = getBitValue(bntL,0,1) + local bntPowerR = getBitValue(bntR,0,1) + local initL,initR = getBitValue(bntL,1,1) > 0, getBitValue(bntR,1,1) > 0 + local currL,currR = getBitValue(bntL,9,6),getBitValue(bntR,9,6) + + local invL,invR = getBitValue(bntL,2,1) > 0, getBitValue(bntR,2,1) > 0 + if sarmatInvert then + invL = not invL + invR = not invR end - local scurr = self:GetNW2Int("PassSchemesLED") - local snext = self:GetNW2Int("PassSchemesLEDN") - local led = scurr - if snext ~= 0 and CurTime()%2 > 1 then led = led + snext end - if scurr < 0 then led = math.floor(CurTime()%16.5*2) end - if led_back then - if sleft then - for i=1,4 do if IsValid(self.ClientEnts["led_l_b"..i]) then self.ClientEnts["led_l_b"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end + + if initL then + local nextL = getBitValue(bntL,3,6) + if nextL == 0 then nextL = -1 end + if CurTime()%2>1 then + currL = currL + nextL end - if sright then - for i=1,4 do if IsValid(self.ClientEnts["led_r_b"..i]) then self.ClientEnts["led_r_b"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end - end - else - if sleft then - for i=1,4 do if IsValid(self.ClientEnts["led_l_f"..i]) then self.ClientEnts["led_l_f"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end - end - if sright then - for i=1,4 do if IsValid(self.ClientEnts["led_r_f"..i]) then self.ClientEnts["led_r_f"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end + end + if initR then + local nextR = getBitValue(bntR,3,6) + if nextR == 0 then nextR = -1 end + if CurTime()%2>1 then + currR = currR + nextR end end + for i=1,4 do + self:ShowHide("led_l_f"..i,not invL) + self:ShowHide("led_l_b"..i,invL) + self:ShowHide("led_r_f"..i,not invR) + self:ShowHide("led_r_b"..i,invR) + + if IsValid(self.ClientEnts["led_l_f"..i]) then self.ClientEnts["led_l_f"..i]:SetSkin(math.Clamp(currL-((i-1)*8),0,8)) end + if IsValid(self.ClientEnts["led_l_b"..i]) then self.ClientEnts["led_l_b"..i]:SetSkin(math.Clamp(currL-((i-1)*8),0,8)) end + if IsValid(self.ClientEnts["led_r_f"..i]) then self.ClientEnts["led_r_f"..i]:SetSkin(math.Clamp(currR-((i-1)*8),0,8)) end + if IsValid(self.ClientEnts["led_r_b"..i]) then self.ClientEnts["led_r_b"..i]:SetSkin(math.Clamp(currR-((i-1)*8),0,8)) end + end local tnmState = self:GetNW2Int("TNM:State",0) if tnmState > 0 then @@ -1486,10 +1514,7 @@ function ENT:Think() self:ShowHide("route_number"..i,false) end end - --self:Animate("brake_cylinder", 0/6, 0.016, 0.78, 2,false) - --self:Animate("brake_line", 0/16, 0.037, 0.795, 2,false) - --self:Animate("train_line", 0/16, 0.037, 0.795, 2,false) - -- + local playL = false local playR = false local anim = 0--math.Round(CurTime()%5/5) @@ -1574,7 +1599,7 @@ function ENT:Think() self:SetSoundState("parking_brake",self.ParkingBrake,1.4) local dPdT = self:GetPackedRatio("BrakeCylinderPressure_dPdT") - self.ReleasedPdT = math.Clamp(self.ReleasedPdT + 2*(-self:GetPackedRatio("BrakeCylinderPressure_dPdT",0)-self.ReleasedPdT)*dT,0,1) + self.ReleasedPdT = math.Clamp(self.ReleasedPdT + 2*(-dPdT-self.ReleasedPdT)*dT,0,1) local release1 = math.Clamp(self.ReleasedPdT,0,1)^2 self:SetSoundState("release",release1,1) @@ -1606,7 +1631,6 @@ function ENT:Think() self.EmergencyBrakeValveRamp = math.Clamp(self.EmergencyBrakeValveRamp + (emergencyBrakeValve-self.EmergencyBrakeValveRamp)*dT*8,0,1) self:SetSoundState("valve_brake",self.EmergencyBrakeValveRamp,0.8+math.min(0.4,self.EmergencyBrakeValveRamp*0.8)) - local emergencyValve = self:GetPackedRatio("EmergencyValve_dPdT", 0)^0.4*1.2 self.EmergencyValveRamp = math.Clamp(self.EmergencyValveRamp + (emergencyValve-self.EmergencyValveRamp)*dT*16,0,1) self:SetSoundState("emer_brake",self.EmergencyValveRamp,1.0) @@ -1639,7 +1663,6 @@ function ENT:Think() self:SetSoundState("rolling_60",rollingi*rol60,1) self:SetSoundState("rolling_70",rollingi*rol70,1) - local rol10 = math.Clamp(speed/15,0,1)*(1-math.Clamp((speed-18)/35,0,1)) local rol10p = Lerp((speed-15)/14,0.6,0.78) local rol40 = math.Clamp((speed-18)/35,0,1)*(1-math.Clamp((speed-55)/40,0,1)) @@ -1670,41 +1693,55 @@ function ENT:Think() self:SetSoundState("chopper", tunstreet*self:GetPackedRatio("chopper"), 1) local work = self:GetPackedBool("AnnPlay") - local UPO = work and self:GetPackedBool("AnnPlayUPO") + local UPO = work and self.Announcer.AnnTable == "AnnouncementsUPO" + local noise = self:GetNW2Int("AnnouncerNoise") + + local volBMCIK = self:GetNW2Int("BMCIK:VolCab",0)/10 + local volBNT = self:GetNW2Int("BNT:Volumes",0) - local noise = self:GetNW2Int("AnnouncerNoise", -1) - local volume = self:GetNW2Float("UPOVolume",1) - local noisevolume = self:GetNW2Float("UPONoiseVolume",1) - local buzzvolume = volume - if self.Sounds["announcer1"] and IsValid(self.Sounds["announcer1"]) then buzzvolume = UPO and (1-(self.Sounds["announcer1"]:GetLevel())*math.Rand(0.9,3))*buzzvolume*2 or 0 end - if self.BPSNBuzzVolume > buzzvolume then - self.BPSNBuzzVolume = math.Clamp(self.BPSNBuzzVolume + 8*(buzzvolume-self.BPSNBuzzVolume)*dT,0.1,1) + local volSalon = 0 + local noisevolume = 0 + if UPO then + noisevolume = self:GetNW2Float("UPONoiseVolume",1) + volSalon = getBitValue(volBNT,4,4)/10*self:GetNW2Float("UPOVolume",1) else - self.BPSNBuzzVolume = math.Clamp(self.BPSNBuzzVolume + 0.4*(buzzvolume-self.BPSNBuzzVolume)*dT,0.1,1) + volSalon = getBitValue(volBNT,0,4)/10 end for k,v in ipairs(self.AnnouncerPositions) do - self:SetSoundState("announcer_noiseW"..k,UPO and noisevolume*volume*0.7 or 0,1) - for i=1,3 do - self:SetSoundState(Format("announcer_noise%d_%d",i,k),(UPO and i==noise) and volume*self.BPSNBuzzVolume*self:GetNW2Float("UPOBuzzVolume",1)*0.7 or 0,1) + local targetVol = 0 + if work then + if v[4] == 0x4C then -- [L]eft side + targetVol = v[3]*volSalon*bntPowerL + elseif v[4] == 0x52 then -- [R]ight side + targetVol = v[3]*volSalon*bntPowerR + elseif v[4] == 0x43 then -- [C]abin + targetVol = v[3]*volBMCIK + end end - if IsValid(self.Sounds["announcer"..k]) then self.Sounds["announcer"..k]:SetVolume(work and v[3]*(UPO and volume or 1) or 0) end + self:SetSoundState("announcer_noiseW"..k,targetVol*noisevolume,1) + for i=1,3 do + self:SetSoundState(Format("announcer_noise%d_%d",i,k),(UPO and i==noise) and targetVol*noisevolume or 0,1) + end + + if IsValid(self.Sounds["announcer"..k]) then self.Sounds["announcer"..k]:SetVolume(targetVol) end end end -function ENT:OnAnnouncer(volume) - local work = self:GetPackedBool("AnnPlay") - local UPO = work and self:GetPackedBool("AnnPlayUPO") +-- TODO: Вспомнить Глебу, зачем вообще эта функция реализована +-- В обновлении 2018 года её нет +-- function ENT:OnAnnouncer(volume) +-- local work = self:GetPackedBool("AnnPlay") +-- local UPO = work and self:GetPackedBool("AnnPlayUPO") - return work and volume*(UPO and self:GetNW2Float("UPOVolume",1) or 1) or 0 -end +-- return work and volume*(UPO and self:GetNW2Float("UPOVolume",1) or 1) or 0 +-- end function ENT:Draw() self.BaseClass.Draw(self) end -local CamRTM = Material( "pp/rt" ) function ENT:DrawPost() self.RTMaterial:SetTexture("$basetexture", self.Vityaz) self:DrawOnPanel("Vityaz",function(...) @@ -1712,36 +1749,23 @@ function ENT:DrawPost() surface.SetDrawColor(255,255,255) surface.DrawTexturedRectRotated(512,512,1024,1024,0) end) - --[[ self.RTMaterial:SetTexture("$basetexture", self.PAM) - self:DrawOnPanel("PAMScreen",function(...) + self.RTMaterial:SetTexture("$basetexture", self.BMCIKScr) + self:DrawOnPanel("BMCIK",function(...) surface.SetMaterial(self.RTMaterial) - surface.SetDrawColor(255,255,255) - surface.DrawTexturedRectRotated(512,256,1024,512,0) - end)--]] - self.RTMaterial:SetTexture("$basetexture", self.Sarmat) - self:DrawOnPanel("Sarmat",function(...) - surface.SetMaterial(self.RTMaterial) - surface.SetDrawColor(255,255,255) - surface.DrawTexturedRectRotated(512,512,1024,1024,0) - - --surface.SetMaterial(self.RTMaterial2) - --surface.SetDrawColor(255,255,255) - --self.RTMaterial2:SetTexture("$basetexture", self.SarmatUPO.Cam1) - --surface.DrawTexturedRectRotated(384,128,256,256,0) - --self.RTMaterial2:SetTexture("$basetexture", self.SarmatUPO.Cam2) - --surface.DrawTexturedRectRotated(128,128,256,256,0) + surface.SetDrawColor(255,255,255,255) + surface.DrawTexturedRectRotated(1024,512,2048,1024,0) end) - self.RTMaterial:SetTexture("$basetexture", self.LastStation) - self:DrawOnPanel("LastStation",function(...) - surface.SetMaterial(self.RTMaterial) + self.RTMaterial:SetTexture("$basetexture", self.BMTSScr) + self:DrawOnPanel("BMTS",function(...) surface.SetDrawColor(255,255,255) - surface.DrawTexturedRectRotated(256,32,512,64,0) + surface.SetMaterial(self.RTMaterial) + surface.DrawTexturedRectRotated(256,64,512,128,0) end) - self.RTMaterial:SetTexture("$basetexture", self.Tickers) - self:DrawOnPanel("Tickers",function(...) + self.RTMaterial:SetTexture("$basetexture", self.BITScr) + self:DrawOnPanel("BIT",function(...) surface.SetMaterial(self.RTMaterial) - surface.SetDrawColor(255,255,255) - surface.DrawTexturedRectRotated(256,32,512,64,0) + surface.SetDrawColor(255,255,255,200) + surface.DrawTexturedRectRotated(512,128,1024,256,0) end) self.RTMaterial:SetTexture("$basetexture", self.TNMScr) self:DrawOnPanel("TNM",function(...) @@ -1787,4 +1811,4 @@ for id,panel in pairs(ENT.ButtonMap) do end end end -Metrostroi.GenerateClientProps() +Metrostroi.GenerateClientProps() \ No newline at end of file diff --git a/lua/entities/gmod_subway_81-722/init.lua b/lua/entities/gmod_subway_81-722/init.lua index 7a35761..b28ec1d 100644 --- a/lua/entities/gmod_subway_81-722/init.lua +++ b/lua/entities/gmod_subway_81-722/init.lua @@ -102,6 +102,8 @@ function ENT:Initialize() [KEY_7] = "PanelKV7", [KEY_8] = "EmergencyDriveSet", + [KEY_EQUAL] = "SarmatStartSet", + [KEY_0] = "KRO+", [KEY_9] = "KRO-", [KEY_V] = "DoorCloseA", @@ -109,20 +111,19 @@ function ENT:Initialize() [KEY_D] = "DoorRight", [KEY_SPACE] = "PBSet", [KEY_BACKSPACE] = {"EmergencyBrakeToggle",helper="EmergencyBrakeValveToggle"}, - [KEY_PAD_ENTER] = "KVWrenchKV", [KEY_LSHIFT] = { [KEY_2] = "RingSet", [KEY_S] = "PanelKV7", [KEY_V] = "DoorCloseM", [KEY_SPACE] = "VigilanceSet", - - [KEY_PAD_ENTER] = "KVWrenchNone", }, [KEY_LALT] = { [KEY_UP] = "SarmatUpSet", [KEY_DOWN] = "SarmatDownSet", [KEY_RIGHT] = "SarmatEnterSet", [KEY_LEFT] = "SarmatEscSet", + [KEY_PAD_ENTER] = "SarmatEnterSet", + [KEY_PAD_DECIMAL] = "SarmatEscSet", [KEY_PAD_1] = "SarmatF1Set", [KEY_PAD_2] = "SarmatF2Set", [KEY_PAD_3] = "SarmatF3Set", @@ -189,8 +190,8 @@ function ENT:Initialize() self.CabinDoorRight = false self.RearDoor = false - self:SetNW2Float("UPONoiseVolume",math.Rand(0,0.3)) - self:SetNW2Float("UPOVolume",math.Rand(0.8,1)) + self.UPONoiseVolume = math.Rand(0,0.3) + self.UPOVolume = math.Rand(0.8,1) self.Scheme = 1 end @@ -304,8 +305,6 @@ function ENT:Think() self:SetPackedRatio("CabLights",self.Panel.CabLights==0.5 and 0.3 or self.Panel.CabLights) self:SetPackedBool("PanelLighting",self.Panel.PanelLights>0) - self:SetPackedBool("Headlights1",self.Panel.Headlights1 > 0) - self:SetPackedBool("Headlights2",self.Panel.Headlights2 > 0) self:SetPackedRatio("Headlight",self.Panel.Headlights2 > 0 and 1 or self.Panel.Headlights1 > 0 and 0.5 or 0) self:SetPackedBool("RedLights",self.Panel.RedLights>0) @@ -337,15 +336,6 @@ function ENT:Think() self:SetPackedBool("RingEnabled",self.BUKP.Ring) self:SetPackedBool("RingEnabledBARS",self.BARS.Ring>0) - self:SetPackedBool("DoorAlarmL",self.BUKV.CloseRing) - self:SetPackedBool("DoorAlarmR",self.BUKV.CloseRing) - - self:SetNW2Int("PassSchemesLED",self.BNT.PassSchemeCurr) - self:SetNW2Int("PassSchemesLEDN",self.BNT.PassSchemeNext) - self:SetPackedBool("PassSchemesLEDO",self.BNT.PassSchemePath) - self:SetPackedBool("SarmatLeft",self.Panel.PassSchemePowerL) - self:SetPackedBool("SarmatRight",self.Panel.PassSchemePowerR) - self:SetPackedBool("PassengerDoor",self.PassengerDoor) self:SetPackedBool("CabinDoorLeft",self.CabinDoorLeft) self:SetPackedBool("CabinDoorRight",self.CabinDoorRight) @@ -354,8 +344,6 @@ function ENT:Think() self:SetNW2Bool("VityazLamp", self.MFDU.State~=0) self:SetPackedBool("AnnPlay",self.Panel.AnnouncerPlaying > 0) - self:SetPackedBool("AnnPlayUPO",self.Announcer.AnnTable=="AnnouncementsUPO") - --print(self.Panel.AnnouncerPlaying,self.UPO.LineOut) self:SetPackedRatio("Speed", self.Speed) self.AsyncInverter:TriggerInput("Speed",self.Speed) @@ -458,4 +446,4 @@ function ENT:OnButtonRelease(button,ply) self.RouteNumber1:TriggerInput("Set",0) self.RouteNumber3:TriggerInput("Set",0) end -end +end \ No newline at end of file diff --git a/lua/entities/gmod_subway_81-722/shared.lua b/lua/entities/gmod_subway_81-722/shared.lua index 6df0256..5cc3c73 100644 --- a/lua/entities/gmod_subway_81-722/shared.lua +++ b/lua/entities/gmod_subway_81-722/shared.lua @@ -39,11 +39,11 @@ ENT.MirrorCams = { } ENT.AnnouncerPositions = { - {Vector(408,18.5,16),50,0.4} + {Vector(406,18.7,16),50,0.4,0x43} --[C]abin speaker } for i=1,4 do - table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230+37.5,47 ,44),100,0.3}) - table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230,-47,44),100,0.3}) + table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230+37.5,47,44),100,1,0x4C}) --[L]eft side speakers + table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230,-47,44),100,1,0x52}) --[R]ight side speakers end ENT.Cameras = { @@ -204,9 +204,6 @@ function ENT:InitializeSounds() self.SoundNames["door_cab_open"] = "subway_trains/common/door/cab/door_open.mp3" self.SoundNames["door_cab_close"] = "subway_trains/common/door/cab/door_close.mp3" - self.SoundNames["door_alarm"] = "subway_trains/722/door_alarm.mp3" - self.SoundPositions["door_alarm"] = {485,1e9,Vector(0,0,0),0.2} - self.SoundNames["doors"] = "subway_trains/722/door_start.mp3" self.SoundNames["doorl"] = {loop=true,"subway_trains/722/door_loop.wav"} self.SoundPositions["doors"] = {300,1e9,Vector(0,0,0),0.2} @@ -217,8 +214,8 @@ function ENT:InitializeSounds() self.SoundPositions["door"..i.."x"..k.."c"] = {485,1e9,GetDoorPosition(i,k),0.2} end end - self.SoundNames["door_alarm"] = {"subway_trains/722/door_alarm.mp3"} - self.SoundPositions["door_alarm"] = {485,1e9,Vector(0,0,0),0.25} + self.SoundNames["door_alarm"] = {loop=1.1,"subway_trains/722/door_alarm_start.mp3","subway_trains/722/door_alarm_loop.wav","subway_trains/722/door_alarm_end.mp3"} + self.SoundPositions["door_alarm"] = {485,1e9,Vector(0,0,0),0.35} self.SoundNames["epk_brake"] = {loop=true,"subway_trains/common/pneumatic/epv_loop.wav"} @@ -248,13 +245,15 @@ function ENT:InitializeSounds() end for k,v in ipairs(self.AnnouncerPositions) do self.SoundNames["announcer_noise1_"..k] = {loop=true,"subway_announcers/upo/noiseS1.wav"} - self.SoundPositions["announcer_noise1_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noise1_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} self.SoundNames["announcer_noise2_"..k] = {loop=true,"subway_announcers/upo/noiseS2.wav"} - self.SoundPositions["announcer_noise2_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noise2_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} self.SoundNames["announcer_noise3_"..k] = {loop=true,"subway_announcers/upo/noiseS3.wav"} - self.SoundPositions["announcer_noise3_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noise3_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} self.SoundNames["announcer_noiseW"..k] = {loop=true,"subway_announcers/upo/noiseW.wav"} - self.SoundPositions["announcer_noiseW"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noiseW"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} + self.SoundNames["announcer_sarmat_start"..k] = {"subway_announcers/sarmat_upo/sarmat_start.mp3"} + self.SoundPositions["announcer_sarmat_start"..k] = {v[2] or 300,1e9,v[1],v[3]} end end function ENT:InitializeSystems() @@ -378,6 +377,10 @@ ENT.Spawner = { ent.CabinDoorRight = val==4 and first ent.PassengerDoor = val==4 ent.RearDoor = val==4 + + ent.BMCIK.Announcer.Line = 1 + ent.BMCIK.Announcer.Path = not first + ent.BMCIK.Announcer.PathSel = not first else ent.FrontDoor = val==4 ent.RearDoor = val==4 diff --git a/lua/entities/gmod_subway_81-723/cl_init.lua b/lua/entities/gmod_subway_81-723/cl_init.lua index 060255e..9754df3 100644 --- a/lua/entities/gmod_subway_81-723/cl_init.lua +++ b/lua/entities/gmod_subway_81-723/cl_init.lua @@ -440,42 +440,42 @@ ENT.Lights = { [20] = { "light",Vector(-46.4,-66,28.1)+Vector(0,-0.8,-4.1), Angle(0,0,0), Color(40,240,122), brightness = 0.3, scale = 0.1, texture = "sprites/light_glow02.vmt" }, } -ENT.ButtonMap["Tickers1"] = { - pos = Vector(-455.4,-11.1,52.8), +ENT.ButtonMap["BIT1"] = { + pos = Vector(-455.4,-10.85,52.62), ang = Angle(0,90,90), - width = 300, - height = 64, - scale = 0.094, + width = 1024, + height = 192, + scale = 0.0268, hideseat=1.5, } -ENT.ButtonMap["Tickers2"] = { - pos = Vector(2,-11.3,52.5), - ang = Angle(0,90,90+10), - width = 300, - height = 64, - scale = 0.099, +ENT.ButtonMap["BIT2"] = { + pos = Vector(1.8,-11,52.35), + ang = Angle(0,90,90+9), + width = 1024, + height = 192, + scale = 0.02684+0.0003, hideseat=1.5, } -ENT.ButtonMap["Tickers3"] = { - pos = Vector(-5,11.3,52.7), - ang = Angle(0,-90,90+10), - width = 300, - height = 64, - scale = 0.1, +ENT.ButtonMap["BIT3"] = { + pos = Vector(-5,11,52.35), + ang = Angle(0,-90,90+9), + width = 1024, + height = 192, + scale = 0.02684+0.0003, hideseat=1.5, } -ENT.ButtonMap["Tickers4"] = { - pos = Vector(449.3,11.1,52.8), +ENT.ButtonMap["BIT4"] = { + pos = Vector(449.3,10.85,52.62), ang = Angle(0,-90,90), - width = 300, - height = 64, - scale = 0.094, + width = 1024, + height = 192, + scale = 0.0268, hideseat=1.5, } function ENT:Initialize() self.BaseClass.Initialize(self) - self.Tickers = self:CreateRT("721Tickers",1024,128) + self.BITScr = self:CreateRT("722BIT",1024,256) self.FrontLeak = 0 self.RearLeak = 0 @@ -484,7 +484,6 @@ function ENT:Initialize() self.PreviousCompressorState = false self.CompressorVol = 0 self.ParkingBrake = 0 - self.BPSNBuzzVolume = 0 end function ENT:UpdateWagonNumber() local count = math.max(4,math.ceil(math.log10(self.WagonNumber+1))) @@ -505,17 +504,22 @@ function ENT:UpdateWagonNumber() --end end end +local function getBitValue(value, offset, bitCount) + local mask = bit.lshift(bit.lshift(1,bitCount)-1,offset) + return bit.rshift(bit.band(value,mask),offset) +end function ENT:Think() self.BaseClass.Think(self) if not self.RenderClientEnts or self.CreatingCSEnts then return end + local sarmatInvert = self:GetNW2Bool("SarmatInvert") if not self.PassSchemesDone then local sarmat,sarmatr = self.ClientEnts.sarmat,self.ClientEnts.sarmatr local scheme = Metrostroi.Skins["722_schemes"] and Metrostroi.Skins["722_schemes"][self.Scheme] if IsValid(sarmat) and IsValid(sarmatr) and scheme then - if self:GetNW2Bool("SarmatInvert") then + if sarmatInvert then sarmat:SetSubMaterial(0,scheme[2]) sarmatr:SetSubMaterial(0,scheme[1]) else @@ -530,12 +534,13 @@ function ENT:Think() self.PassSchemesDone = false self.Scheme = self:GetNW2Int("Scheme",1) end - if self.InvertSchemes ~= self:GetNW2Bool("SarmatInvert",false) then + if self.InvertSchemes ~= sarmatInvert then self.PassSchemesDone=false - self.InvertSchemes = self:GetNW2Bool("SarmatInvert",false) + self.InvertSchemes = sarmatInvert end local passlight = self:GetPackedRatio("SalonLighting") + self:ShowHideSmooth("lamps_salon",passlight) self:SetLightPower(11,passlight > 0, passlight) self:SetLightPower(12,passlight > 0, passlight) self:SetLightPower(13,passlight > 0, passlight) @@ -551,44 +556,54 @@ function ENT:Think() self:SetLightPower(17,BortBV,1) self:SetLightPower(20,BortBV,1) - self:ShowHideSmooth("lamps_salon",self:GetPackedRatio("SalonLighting")) - self:ShowHide("doorl_l",self:GetPackedBool("DoorAlarmL")) - self:ShowHide("doorl_r",self:GetPackedBool("DoorAlarmR")) + local doorAlarm = self:GetNW2Int("BNT:DoorAlarm") + self:SetSoundState("door_alarm",getBitValue(doorAlarm,0,1),1) + self:ShowHide("doorl_l",getBitValue(doorAlarm,1,1) > 0) + self:ShowHide("doorl_r",getBitValue(doorAlarm,2,1) > 0) 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) - local led_back = self:GetPackedBool("PassSchemesLEDO",false) - if self:GetPackedBool("SarmatInvert",false) then led_back = not led_back end - local sleft,sright = self:GetPackedBool("SarmatLeft"),self:GetPackedBool("SarmatRight") - for i=1,4 do - self:ShowHide("led_l_f"..i,not led_back and sleft) - self:ShowHide("led_l_b"..i,led_back and sleft) - self:ShowHide("led_r_f"..i,not led_back and sright) - self:ShowHide("led_r_b"..i,led_back and sright) + local bntL = self:GetNW2Int("BNT:Left") + local bntR = self:GetNW2Int("BNT:Right") + local bntPowerL = getBitValue(bntL,0,1) + local bntPowerR = getBitValue(bntR,0,1) + local initL,initR = getBitValue(bntL,1,1) > 0, getBitValue(bntR,1,1) > 0 + local currL,currR = getBitValue(bntL,9,6),getBitValue(bntR,9,6) + + local invL,invR = getBitValue(bntL,2,1) > 0, getBitValue(bntR,2,1) > 0 + if sarmatInvert then + invL = not invL + invR = not invR end - local scurr = self:GetNW2Int("PassSchemesLED") - local snext = self:GetNW2Int("PassSchemesLEDN") - local led = scurr - if snext ~= 0 and CurTime()%2 > 1 then led = led + snext end - if scurr < 0 then led = math.floor(CurTime()%16.5*2) end - if led_back then - if sleft then - for i=1,4 do if IsValid(self.ClientEnts["led_l_b"..i]) then self.ClientEnts["led_l_b"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end + + if initL then + local nextL = getBitValue(bntL,3,6) + if nextL == 0 then nextL = -1 end + if CurTime()%2>1 then + currL = currL + nextL end - if sright then - for i=1,4 do if IsValid(self.ClientEnts["led_r_b"..i]) then self.ClientEnts["led_r_b"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end - end - else - if sleft then - for i=1,4 do if IsValid(self.ClientEnts["led_l_f"..i]) then self.ClientEnts["led_l_f"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end - end - if sright then - for i=1,4 do if IsValid(self.ClientEnts["led_r_f"..i]) then self.ClientEnts["led_r_f"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end + end + if initR then + local nextR = getBitValue(bntR,3,6) + if nextR == 0 then nextR = -1 end + if CurTime()%2>1 then + currR = currR + nextR end end + for i=1,4 do + self:ShowHide("led_l_f"..i,not invL) + self:ShowHide("led_l_b"..i,invL) + self:ShowHide("led_r_f"..i,not invR) + self:ShowHide("led_r_b"..i,invR) + + if IsValid(self.ClientEnts["led_l_f"..i]) then self.ClientEnts["led_l_f"..i]:SetSkin(math.Clamp(currL-((i-1)*8),0,8)) end + if IsValid(self.ClientEnts["led_l_b"..i]) then self.ClientEnts["led_l_b"..i]:SetSkin(math.Clamp(currL-((i-1)*8),0,8)) end + if IsValid(self.ClientEnts["led_r_f"..i]) then self.ClientEnts["led_r_f"..i]:SetSkin(math.Clamp(currR-((i-1)*8),0,8)) end + if IsValid(self.ClientEnts["led_r_b"..i]) then self.ClientEnts["led_r_b"..i]:SetSkin(math.Clamp(currR-((i-1)*8),0,8)) end + end local playL = false local playR = false @@ -633,7 +648,6 @@ function ENT:Think() --print(self.DoorSoundState) self:SetSoundState("doorl",self.DoorSoundState or 0,1) - local door_f = self:GetPackedBool("FrontDoor") local door_b = self:GetPackedBool("RearDoor") local door_cab_f = self:Animate("door_cab_f",door_f and 1 or -0.05,1,0.75, 8, 0.05) @@ -699,7 +713,6 @@ function ENT:Think() self:SetSoundState("rolling_60",rollingi*rol60,1) self:SetSoundState("rolling_70",rollingi*rol70,1) - local rol10 = math.Clamp(speed/15,0,1)*(1-math.Clamp((speed-18)/35,0,1)) local rol10p = Lerp((speed-15)/14,0.6,0.78) local rol40 = math.Clamp((speed-18)/35,0,1)*(1-math.Clamp((speed-55)/40,0,1)) @@ -728,51 +741,60 @@ function ENT:Think() self:SetSoundState("chopper", tunstreet*self:GetPackedRatio("chopper"), 1) local work = self:GetPackedBool("AnnPlay") - local UPO = work and self:GetPackedBool("AnnPlayUPO") + local UPO = work and self.Announcer.AnnTable == "AnnouncementsUPO" + local noise = self:GetNW2Int("AnnouncerNoise") + + local volBMCIK = self:GetNW2Int("BMCIK:VolCab",0)/10 + local volBNT = self:GetNW2Int("BNT:Volumes",0) - local noise = self:GetNW2Int("AnnouncerNoise", -1) - local volume = self:GetNW2Float("UPOVolume",1) - local noisevolume = self:GetNW2Float("UPONoiseVolume",1) - local buzzvolume = volume - if self.Sounds["announcer1"] and IsValid(self.Sounds["announcer1"]) then buzzvolume = UPO and (1-(self.Sounds["announcer1"]:GetLevel())*math.Rand(0.9,3))*buzzvolume*2 or 0 end - if self.BPSNBuzzVolume > buzzvolume then - self.BPSNBuzzVolume = math.Clamp(self.BPSNBuzzVolume + 8*(buzzvolume-self.BPSNBuzzVolume)*dT,0.1,1) + local volSalon = 0 + local noisevolume = 0 + if UPO then + noisevolume = self:GetNW2Float("UPONoiseVolume",1) + volSalon = getBitValue(volBNT,4,4)/10*self:GetNW2Float("UPOVolume",1) else - self.BPSNBuzzVolume = math.Clamp(self.BPSNBuzzVolume + 0.4*(buzzvolume-self.BPSNBuzzVolume)*dT,0.1,1) + volSalon = getBitValue(volBNT,0,4)/10 end for k,v in ipairs(self.AnnouncerPositions) do - self:SetSoundState("announcer_noiseW"..k,UPO and noisevolume*volume*0.7 or 0,1) - for i=1,3 do - self:SetSoundState(Format("announcer_noise%d_%d",i,k),(UPO and i==noise) and volume*self.BPSNBuzzVolume*self:GetNW2Float("UPOBuzzVolume",1)*0.7 or 0,1) + local targetVol = 0 + if work then + if v[4] == 0x4C then -- [L]eft side + targetVol = v[3]*volSalon*bntPowerL + elseif v[4] == 0x52 then -- [R]ight side + targetVol = v[3]*volSalon*bntPowerR + elseif v[4] == 0x43 then -- [C]abin + targetVol = v[3]*volBMCIK + end end - if IsValid(self.Sounds["announcer"..k]) then self.Sounds["announcer"..k]:SetVolume(work and v[3]*(UPO and volume or 1) or 0) end + self:SetSoundState("announcer_noiseW"..k,targetVol*noisevolume,1) + for i=1,3 do + self:SetSoundState(Format("announcer_noise%d_%d",i,k),(UPO and i==noise) and targetVol*noisevolume or 0,1) + end + + if IsValid(self.Sounds["announcer"..k]) then self.Sounds["announcer"..k]:SetVolume(targetVol) end end end -function ENT:OnAnnouncer(volume) - local work = self:GetPackedBool("AnnPlay") - local UPO = work and self:GetPackedBool("AnnPlayUPO") +-- function ENT:OnAnnouncer(volume) +-- local work = self:GetPackedBool("AnnPlay") +-- local UPO = work and self:GetPackedBool("AnnPlayUPO") - return work and volume*(UPO and self:GetNW2Float("UPOVolume",1) or 1) or 0 -end +-- return work and volume*(UPO and self:GetNW2Float("UPOVolume",1) or 1) or 0 +-- end function ENT:Draw() self.BaseClass.Draw(self) end function ENT:DrawPost() - self.RTMaterial:SetTexture("$basetexture", self.Tickers) + self.RTMaterial:SetTexture("$basetexture", self.BITScr) surface.SetMaterial(self.RTMaterial) surface.SetDrawColor(255,255,255) for i=1,4 do - self:DrawOnPanel("Tickers"..i,function(...) - if (i==2 or i==3) then - surface.DrawTexturedRectRotated(245,32,490,64,0) - else - surface.DrawTexturedRectRotated(256,32,512,64,0) - end + self:DrawOnPanel("BIT"..i,function(...) + surface.DrawTexturedRectRotated(512,128,1024,256,0) end) end end diff --git a/lua/entities/gmod_subway_81-723/init.lua b/lua/entities/gmod_subway_81-723/init.lua index e274a34..e216f41 100644 --- a/lua/entities/gmod_subway_81-723/init.lua +++ b/lua/entities/gmod_subway_81-723/init.lua @@ -90,9 +90,6 @@ function ENT:Initialize() self.FrontDoor = false self.RearDoor = false - - self:SetNW2Float("UPONoiseVolume",math.Rand(0,0.3)) - self:SetNW2Float("UPOVolume",math.Rand(0.8,1)) end -------------------------------------------------------------------------------- @@ -129,17 +126,7 @@ function ENT:Think() self:SetPackedBool("BortLSD",self.Panel.DoorsW>0) self:SetPackedBool("BortBV",self.Panel.GRP>0) - self:SetPackedBool("DoorAlarmL",self.BUKV.CloseRing) - self:SetPackedBool("DoorAlarmR",self.BUKV.CloseRing) - - self:SetNW2Int("PassSchemesLED",self.BNT.PassSchemeCurr) - self:SetNW2Int("PassSchemesLEDN",self.BNT.PassSchemeNext) - self:SetPackedBool("PassSchemesLEDO",self.BNT.PassSchemePath) - self:SetPackedBool("SarmatLeft",self.Panel.PassSchemePowerL) - self:SetPackedBool("SarmatRight",self.Panel.PassSchemePowerR) - self:SetPackedBool("AnnPlay",self.Panel.AnnouncerPlaying > 0) - self:SetPackedBool("AnnPlayUPO",self.Announcer.AnnTable=="AnnouncementsUPO") self.AsyncInverter:TriggerInput("Speed",self.Speed) if IsValid(self.FrontBogey) and IsValid(self.RearBogey) and not self.IgnoreEngine then diff --git a/lua/entities/gmod_subway_81-723/shared.lua b/lua/entities/gmod_subway_81-723/shared.lua index 70d6077..90e57ae 100644 --- a/lua/entities/gmod_subway_81-723/shared.lua +++ b/lua/entities/gmod_subway_81-723/shared.lua @@ -33,6 +33,12 @@ for i=0,3 do table.insert(ENT.RightDoorPositions,GetDoorPosition(i,0)) end +ENT.AnnouncerPositions = {} +for i=1,4 do + table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230+37.5,47,44),100,1,0x4C}) --[L]eft side speakers + table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230,-47,44),100,1,0x52}) --[R]ight side speakers +end + function ENT:InitializeSounds() self.BaseClass.InitializeSounds(self) self.SoundNames["test_async1"] = {"subway_trains/722/engines/inverter_1000.wav",loop = true} @@ -105,8 +111,8 @@ function ENT:InitializeSounds() self.SoundNames["sf_on"] = "subway_trains/722/switches/sf_on.mp3" self.SoundNames["sf_off"] = "subway_trains/722/switches/sf_off.mp3" - self.SoundNames["door_alarm"] = "subway_trains/722/door_alarm.mp3" - self.SoundPositions["door_alarm"] = {800,1e9,Vector(0,0,0),0.5} + self.SoundNames["door_alarm"] = {loop=1.1,"subway_trains/722/door_alarm_start.mp3","subway_trains/722/door_alarm_loop.wav","subway_trains/722/door_alarm_end.mp3"} + self.SoundPositions["door_alarm"] = {485,1e9,Vector(0,0,0),0.35} self.SoundNames["door_cab_open"] = "subway_trains/common/door/cab/door_open.mp3" self.SoundNames["door_cab_close"] = "subway_trains/common/door/cab/door_close.mp3" @@ -121,8 +127,6 @@ function ENT:InitializeSounds() self.SoundPositions["door"..i.."x"..k.."c"] = {800,1e9,GetDoorPosition(i,k),0.2} end end - self.SoundNames["door_alarm"] = {"subway_trains/722/door_alarm.mp3"} - self.SoundPositions["door_alarm"] = {800,1e9,Vector(0,0,0),0.5} for i = 1,10 do local id1 = Format("b1tunnel_%d",i) local id2 = Format("b2tunnel_%d",i) @@ -133,13 +137,15 @@ function ENT:InitializeSounds() end for k,v in ipairs(self.AnnouncerPositions) do self.SoundNames["announcer_noise1_"..k] = {loop=true,"subway_announcers/upo/noiseS1.wav"} - self.SoundPositions["announcer_noise1_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noise1_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} self.SoundNames["announcer_noise2_"..k] = {loop=true,"subway_announcers/upo/noiseS2.wav"} - self.SoundPositions["announcer_noise2_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noise2_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} self.SoundNames["announcer_noise3_"..k] = {loop=true,"subway_announcers/upo/noiseS3.wav"} - self.SoundPositions["announcer_noise3_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noise3_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} self.SoundNames["announcer_noiseW"..k] = {loop=true,"subway_announcers/upo/noiseW.wav"} - self.SoundPositions["announcer_noiseW"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noiseW"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} + self.SoundNames["announcer_sarmat_start"..k] = {"subway_announcers/sarmat_upo/sarmat_start.mp3"} + self.SoundPositions["announcer_sarmat_start"..k] = {v[2] or 300,1e9,v[1],v[3]} end end @@ -166,13 +172,6 @@ end function ENT:PostInitializeSystems() self.Electric:TriggerInput("Type",self.Electric.T723) end - -ENT.AnnouncerPositions = { -} -for i=1,4 do - table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230+37.5,47 ,44),100,0.1}) - table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230,-47,44),100,0.1}) -end --------------------------------------------------- -- Defined train information -- Types of wagon(for wagon limit system): diff --git a/lua/entities/gmod_subway_81-724/cl_init.lua b/lua/entities/gmod_subway_81-724/cl_init.lua index 1a800ac..cf94302 100644 --- a/lua/entities/gmod_subway_81-724/cl_init.lua +++ b/lua/entities/gmod_subway_81-724/cl_init.lua @@ -436,49 +436,48 @@ ENT.Lights = { [18] = { "light",Vector(-46.4,-66,28.1)+Vector(0,-0,4.1), Angle(0,0,0), Color(254,254,254), brightness = 0.4, scale = 0.1, texture = "sprites/light_glow02.vmt" }, [19] = { "light",Vector(-46.4,-66,28.1)+Vector(0,-0.4,-0), Angle(0,0,0), Color(254,210,18), brightness = 0.3, scale = 0.1, texture = "sprites/light_glow02.vmt" }, } -ENT.ButtonMap["Tickers1"] = { - pos = Vector(-455.4,-11.1,52.8), +ENT.ButtonMap["BIT1"] = { + pos = Vector(-455.4,-10.85,52.62), ang = Angle(0,90,90), - width = 300, - height = 64, - scale = 0.094, + width = 1024, + height = 192, + scale = 0.0268, hideseat=1.5, } -ENT.ButtonMap["Tickers2"] = { - pos = Vector(2,-11.3,52.5), - ang = Angle(0,90,90+10), - width = 300, - height = 64, - scale = 0.099, +ENT.ButtonMap["BIT2"] = { + pos = Vector(1.8,-11,52.35), + ang = Angle(0,90,90+9), + width = 1024, + height = 192, + scale = 0.02684+0.0003, hideseat=1.5, } -ENT.ButtonMap["Tickers3"] = { - pos = Vector(-5,11.3,52.7), - ang = Angle(0,-90,90+10), - width = 300, - height = 64, - scale = 0.1, +ENT.ButtonMap["BIT3"] = { + pos = Vector(-5,11,52.35), + ang = Angle(0,-90,90+9), + width = 1024, + height = 192, + scale = 0.02684+0.0003, hideseat=1.5, } -ENT.ButtonMap["Tickers4"] = { - pos = Vector(449.3,11.1,52.8), +ENT.ButtonMap["BIT4"] = { + pos = Vector(449.3,10.85,52.62), ang = Angle(0,-90,90), - width = 300, - height = 64, - scale = 0.094, + width = 1024, + height = 192, + scale = 0.0268, hideseat=1.5, } function ENT:Initialize() self.BaseClass.Initialize(self) - self.Tickers = self:CreateRT("721Tickers",1024,128) + self.BITScr = self:CreateRT("722BIT",1024,256) self.ReleasedPdT = 0 self.FrontLeak = 0 self.RearLeak = 0 self.ParkingBrake = 0 - self.BPSNBuzzVolume = 0 end function ENT:UpdateWagonNumber() local count = math.max(4,math.ceil(math.log10(self.WagonNumber+1))) @@ -499,17 +498,22 @@ function ENT:UpdateWagonNumber() --end end end +local function getBitValue(value, offset, bitCount) + local mask = bit.lshift(bit.lshift(1,bitCount)-1,offset) + return bit.rshift(bit.band(value,mask),offset) +end function ENT:Think() self.BaseClass.Think(self) if not self.RenderClientEnts or self.CreatingCSEnts then return end + local sarmatInvert = self:GetNW2Bool("SarmatInvert") if not self.PassSchemesDone then local sarmat,sarmatr = self.ClientEnts.sarmat,self.ClientEnts.sarmatr local scheme = Metrostroi.Skins["722_schemes"] and Metrostroi.Skins["722_schemes"][self.Scheme] if IsValid(sarmat) and IsValid(sarmatr) and scheme then - if self:GetNW2Bool("SarmatInvert") then + if sarmatInvert then sarmat:SetSubMaterial(0,scheme[2]) sarmatr:SetSubMaterial(0,scheme[1]) else @@ -524,12 +528,13 @@ function ENT:Think() self.PassSchemesDone = false self.Scheme = self:GetNW2Int("Scheme",1) end - if self.InvertSchemes ~= self:GetNW2Bool("SarmatInvert",false) then + if self.InvertSchemes ~= sarmatInvert then self.PassSchemesDone=false - self.InvertSchemes = self:GetNW2Bool("SarmatInvert",false) + self.InvertSchemes = sarmatInvert end local passlight = self:GetPackedRatio("SalonLighting") + self:ShowHideSmooth("lamps_salon",passlight) self:SetLightPower(11,passlight > 0, passlight) self:SetLightPower(12,passlight > 0, passlight) self:SetLightPower(13,passlight > 0, passlight) @@ -545,44 +550,54 @@ function ENT:Think() self:ShowHide("bortlamp_pneumo",self:GetPackedBool("BortPneumo")) self:ShowHide("bortlamp_lsd",self:GetPackedBool("BortLSD")) - self:ShowHideSmooth("lamps_salon",self:GetPackedRatio("SalonLighting")) - self:ShowHide("doorl_l",self:GetPackedBool("DoorAlarmL")) - self:ShowHide("doorl_r",self:GetPackedBool("DoorAlarmR")) + local doorAlarm = self:GetNW2Int("BNT:DoorAlarm") + self:SetSoundState("door_alarm",getBitValue(doorAlarm,0,1),1) + self:ShowHide("doorl_l",getBitValue(doorAlarm,1,1) > 0) + self:ShowHide("doorl_r",getBitValue(doorAlarm,2,1) > 0) 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) - local led_back = self:GetPackedBool("PassSchemesLEDO",false) - if self:GetPackedBool("SarmatInvert",false) then led_back = not led_back end - local sleft,sright = self:GetPackedBool("SarmatLeft"),self:GetPackedBool("SarmatRight") - for i=1,4 do - self:ShowHide("led_l_f"..i,not led_back and sleft) - self:ShowHide("led_l_b"..i,led_back and sleft) - self:ShowHide("led_r_f"..i,not led_back and sright) - self:ShowHide("led_r_b"..i,led_back and sright) + local bntL = self:GetNW2Int("BNT:Left") + local bntR = self:GetNW2Int("BNT:Right") + local bntPowerL = getBitValue(bntL,0,1) + local bntPowerR = getBitValue(bntR,0,1) + local initL,initR = getBitValue(bntL,1,1) > 0, getBitValue(bntR,1,1) > 0 + local currL,currR = getBitValue(bntL,9,6),getBitValue(bntR,9,6) + + local invL,invR = getBitValue(bntL,2,1) > 0, getBitValue(bntR,2,1) > 0 + if sarmatInvert then + invL = not invL + invR = not invR end - local scurr = self:GetNW2Int("PassSchemesLED") - local snext = self:GetNW2Int("PassSchemesLEDN") - local led = scurr - if snext ~= 0 and CurTime()%2 > 1 then led = led + snext end - if scurr < 0 then led = math.floor(CurTime()%16.5*2) end - if led_back then - if sleft then - for i=1,4 do if IsValid(self.ClientEnts["led_l_b"..i]) then self.ClientEnts["led_l_b"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end + + if initL then + local nextL = getBitValue(bntL,3,6) + if nextL == 0 then nextL = -1 end + if CurTime()%2>1 then + currL = currL + nextL end - if sright then - for i=1,4 do if IsValid(self.ClientEnts["led_r_b"..i]) then self.ClientEnts["led_r_b"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end - end - else - if sleft then - for i=1,4 do if IsValid(self.ClientEnts["led_l_f"..i]) then self.ClientEnts["led_l_f"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end - end - if sright then - for i=1,4 do if IsValid(self.ClientEnts["led_r_f"..i]) then self.ClientEnts["led_r_f"..i]:SetSkin(math.Clamp(led-((i-1)*8),0,8)) end end + end + if initR then + local nextR = getBitValue(bntR,3,6) + if nextR == 0 then nextR = -1 end + if CurTime()%2>1 then + currR = currR + nextR end end + for i=1,4 do + self:ShowHide("led_l_f"..i,not invL) + self:ShowHide("led_l_b"..i,invL) + self:ShowHide("led_r_f"..i,not invR) + self:ShowHide("led_r_b"..i,invR) + + if IsValid(self.ClientEnts["led_l_f"..i]) then self.ClientEnts["led_l_f"..i]:SetSkin(math.Clamp(currL-((i-1)*8),0,8)) end + if IsValid(self.ClientEnts["led_l_b"..i]) then self.ClientEnts["led_l_b"..i]:SetSkin(math.Clamp(currL-((i-1)*8),0,8)) end + if IsValid(self.ClientEnts["led_r_f"..i]) then self.ClientEnts["led_r_f"..i]:SetSkin(math.Clamp(currR-((i-1)*8),0,8)) end + if IsValid(self.ClientEnts["led_r_b"..i]) then self.ClientEnts["led_r_b"..i]:SetSkin(math.Clamp(currR-((i-1)*8),0,8)) end + end local playL = false local playR = false @@ -689,51 +704,60 @@ function ENT:Think() self:SetSoundState("battery_off_loop", self:GetPackedBool("BattPressed") and 1 or 0,1) local work = self:GetPackedBool("AnnPlay") - local UPO = work and self:GetPackedBool("AnnPlayUPO") + local UPO = work and self.Announcer.AnnTable == "AnnouncementsUPO" + local noise = self:GetNW2Int("AnnouncerNoise") + + local volBMCIK = self:GetNW2Int("BMCIK:VolCab",0)/10 + local volBNT = self:GetNW2Int("BNT:Volumes",0) - local noise = self:GetNW2Int("AnnouncerNoise", -1) - local volume = self:GetNW2Float("UPOVolume",1) - local noisevolume = self:GetNW2Float("UPONoiseVolume",1) - local buzzvolume = volume - if self.Sounds["announcer1"] and IsValid(self.Sounds["announcer1"]) then buzzvolume = UPO and (1-(self.Sounds["announcer1"]:GetLevel())*math.Rand(0.9,3))*buzzvolume*2 or 0 end - if self.BPSNBuzzVolume > buzzvolume then - self.BPSNBuzzVolume = math.Clamp(self.BPSNBuzzVolume + 8*(buzzvolume-self.BPSNBuzzVolume)*dT,0.1,1) + local volSalon = 0 + local noisevolume = 0 + if UPO then + noisevolume = self:GetNW2Float("UPONoiseVolume",1) + volSalon = getBitValue(volBNT,4,4)/10*self:GetNW2Float("UPOVolume",1) else - self.BPSNBuzzVolume = math.Clamp(self.BPSNBuzzVolume + 0.4*(buzzvolume-self.BPSNBuzzVolume)*dT,0.1,1) + volSalon = getBitValue(volBNT,0,4)/10 end for k,v in ipairs(self.AnnouncerPositions) do - self:SetSoundState("announcer_noiseW"..k,UPO and noisevolume*volume*0.7 or 0,1) - for i=1,3 do - self:SetSoundState(Format("announcer_noise%d_%d",i,k),(UPO and i==noise) and volume*self.BPSNBuzzVolume*self:GetNW2Float("UPOBuzzVolume",1)*0.7 or 0,1) + local targetVol = 0 + if work then + if v[4] == 0x4C then -- [L]eft side + targetVol = v[3]*volSalon*bntPowerL + elseif v[4] == 0x52 then -- [R]ight side + targetVol = v[3]*volSalon*bntPowerR + elseif v[4] == 0x43 then -- [C]abin + targetVol = v[3]*volBMCIK + end end - if IsValid(self.Sounds["announcer"..k]) then self.Sounds["announcer"..k]:SetVolume(work and v[3]*(UPO and volume or 1) or 0) end + self:SetSoundState("announcer_noiseW"..k,targetVol*noisevolume,1) + for i=1,3 do + self:SetSoundState(Format("announcer_noise%d_%d",i,k),(UPO and i==noise) and targetVol*noisevolume or 0,1) + end + + if IsValid(self.Sounds["announcer"..k]) then self.Sounds["announcer"..k]:SetVolume(targetVol) end end end -function ENT:OnAnnouncer(volume) - local work = self:GetPackedBool("AnnPlay") - local UPO = work and self:GetPackedBool("AnnPlayUPO") +-- function ENT:OnAnnouncer(volume) +-- local work = self:GetPackedBool("AnnPlay") +-- local UPO = work and self:GetPackedBool("AnnPlayUPO") - return work and volume*(UPO and self:GetNW2Float("UPOVolume",1) or 1) or 0 -end +-- return work and volume*(UPO and self:GetNW2Float("UPOVolume",1) or 1) or 0 +-- end function ENT:Draw() self.BaseClass.Draw(self) end function ENT:DrawPost() - self.RTMaterial:SetTexture("$basetexture", self.Tickers) + self.RTMaterial:SetTexture("$basetexture", self.BITScr) surface.SetMaterial(self.RTMaterial) surface.SetDrawColor(255,255,255) for i=1,4 do - self:DrawOnPanel("Tickers"..i,function(...) - if (i==2 or i==3) then - surface.DrawTexturedRectRotated(245,32,490,64,0) - else - surface.DrawTexturedRectRotated(256,32,512,64,0) - end + self:DrawOnPanel("BIT"..i,function(...) + surface.DrawTexturedRectRotated(512,128,1024,256,0) end) end end diff --git a/lua/entities/gmod_subway_81-724/init.lua b/lua/entities/gmod_subway_81-724/init.lua index c0e05bf..b071b4a 100644 --- a/lua/entities/gmod_subway_81-724/init.lua +++ b/lua/entities/gmod_subway_81-724/init.lua @@ -90,9 +90,6 @@ function ENT:Initialize() self.FrontDoor = false self.RearDoor = false - - self:SetNW2Float("UPONoiseVolume",math.Rand(0,0.3)) - self:SetNW2Float("UPOVolume",math.Rand(0.8,1)) end -------------------------------------------------------------------------------- @@ -104,12 +101,6 @@ function ENT:Think() self:SetPackedBool("BattPressed",self.BUKV.BatteryPressed) - self:SetNW2Int("PassSchemesLED",self.BNT.PassSchemeCurr) - self:SetNW2Int("PassSchemesLEDN",self.BNT.PassSchemeNext) - self:SetPackedBool("PassSchemesLEDO",self.BNT.PassSchemePath) - self:SetPackedBool("SarmatLeft",self.Panel.PassSchemePowerL) - self:SetPackedBool("SarmatRight",self.Panel.PassSchemePowerR) - --self:SetPackedRatio("Cran", self.Pneumatic.DriverValvePosition) --self:SetPackedRatio("BL", self.Pneumatic.BrakeLinePressure/16.0) --self:SetPackedRatio("TL", self.Pneumatic.TrainLinePressure/16.0) @@ -121,11 +112,7 @@ function ENT:Think() self:SetPackedBool("BortPneumo",self.Panel.BrW>0) self:SetPackedBool("BortLSD",self.Panel.DoorsW>0) - self:SetPackedBool("DoorAlarmL",self.BUKV.CloseRing) - self:SetPackedBool("DoorAlarmR",self.BUKV.CloseRing) - self:SetPackedBool("AnnPlay",self.Panel.AnnouncerPlaying > 0) - self:SetPackedBool("AnnPlayUPO",self.Announcer.AnnTable=="AnnouncementsUPO") if IsValid(self.FrontBogey) and IsValid(self.RearBogey) and not self.IgnoreEngine then --local A = 2*self.Engines.BogeyMoment diff --git a/lua/entities/gmod_subway_81-724/shared.lua b/lua/entities/gmod_subway_81-724/shared.lua index a612107..a40edd1 100644 --- a/lua/entities/gmod_subway_81-724/shared.lua +++ b/lua/entities/gmod_subway_81-724/shared.lua @@ -33,6 +33,12 @@ for i=0,3 do table.insert(ENT.RightDoorPositions,GetDoorPosition(i,0)) end +ENT.AnnouncerPositions = {} +for i=1,4 do + table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230+37.5,47,44),100,1,0x4C}) --[L]eft side speakers + table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230,-47,44),100,1,0x52}) --[R]ight side speakers +end + function ENT:InitializeSounds() self.BaseClass.InitializeSounds(self) self.SoundNames["release"] = {loop=true,"subway_trains/722/pneumo_release2.wav"} @@ -79,9 +85,6 @@ function ENT:InitializeSounds() self.SoundNames["battery_off_loop"] = {loop=true,"subway_trains/722/battery/battery_off_loop.wav"} self.SoundPositions["battery_off_loop"] = {100,1e9,Vector(182,50,-75),0.02} - self.SoundNames["door_alarm"] = "subway_trains/722/door_alarm.mp3" - self.SoundPositions["door_alarm"] = {800,1e9,Vector(0,0,0),0.5} - self.SoundNames["door_cab_open"] = "subway_trains/common/door/cab/door_open.mp3" self.SoundNames["door_cab_close"] = "subway_trains/common/door/cab/door_close.mp3" @@ -95,8 +98,8 @@ function ENT:InitializeSounds() self.SoundPositions["door"..i.."x"..k.."c"] = {800,1e9,GetDoorPosition(i,k),0.2} end end - self.SoundNames["door_alarm"] = {"subway_trains/722/door_alarm.mp3"} - self.SoundPositions["door_alarm"] = {800,1e9,Vector(0,0,0),0.5} + self.SoundNames["door_alarm"] = {loop=1.1,"subway_trains/722/door_alarm_start.mp3","subway_trains/722/door_alarm_loop.wav","subway_trains/722/door_alarm_end.mp3"} + self.SoundPositions["door_alarm"] = {485,1e9,Vector(0,0,0),0.35} for i = 1,10 do local id1 = Format("b1tunnel_%d",i) local id2 = Format("b2tunnel_%d",i) @@ -107,13 +110,15 @@ function ENT:InitializeSounds() end for k,v in ipairs(self.AnnouncerPositions) do self.SoundNames["announcer_noise1_"..k] = {loop=true,"subway_announcers/upo/noiseS1.wav"} - self.SoundPositions["announcer_noise1_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noise1_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} self.SoundNames["announcer_noise2_"..k] = {loop=true,"subway_announcers/upo/noiseS2.wav"} - self.SoundPositions["announcer_noise2_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noise2_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} self.SoundNames["announcer_noise3_"..k] = {loop=true,"subway_announcers/upo/noiseS3.wav"} - self.SoundPositions["announcer_noise3_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noise3_"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} self.SoundNames["announcer_noiseW"..k] = {loop=true,"subway_announcers/upo/noiseW.wav"} - self.SoundPositions["announcer_noiseW"..k] = {v[2] or 300,1e9,v[1],v[3]*0.2} + self.SoundPositions["announcer_noiseW"..k] = {v[2] or 300,1e9,v[1],v[3]*0.1} + self.SoundNames["announcer_sarmat_start"..k] = {"subway_announcers/sarmat_upo/sarmat_start.mp3"} + self.SoundPositions["announcer_sarmat_start"..k] = {v[2] or 300,1e9,v[1],v[3]} end end @@ -140,13 +145,6 @@ end function ENT:PostInitializeSystems() self.Electric:TriggerInput("Type",self.Electric.T724) end - -ENT.AnnouncerPositions = { -} -for i=1,4 do - table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230+37.5,47 ,44),100,0.1}) - table.insert(ENT.AnnouncerPositions,{Vector(323-(i-1)*230,-47,44),100,0.1}) -end --------------------------------------------------- -- Defined train information -- Types(for wagon limit system):