From 5e9e8f3f99f1a8cf1da702edf6c2c4b3e35c756f Mon Sep 17 00:00:00 2001 From: LT3 <83487515+lessthnthree@users.noreply.github.com> Date: Mon, 22 Jun 2026 19:33:45 -0700 Subject: [PATCH] Fixes tram duplicate/unlabelled tram announcements, reduces range (#96606) --- code/controllers/subsystem/transport.dm | 2 + .../modules/transport/tram/tram_controller.dm | 65 +++++++++++------- code/modules/transport/tram/tram_controls.dm | 27 ++++---- code/modules/transport/tram/tram_doors.dm | 4 +- .../modules/transport/transport_navigation.dm | 16 ++--- sound/machines/tram/door_chime.ogg | Bin 0 -> 39325 bytes sound/machines/tram/info_chime.ogg | Bin 0 -> 45324 bytes 7 files changed, 66 insertions(+), 48 deletions(-) create mode 100644 sound/machines/tram/door_chime.ogg create mode 100644 sound/machines/tram/info_chime.ogg diff --git a/code/controllers/subsystem/transport.dm b/code/controllers/subsystem/transport.dm index 928b6a03d58..f64e32953e2 100644 --- a/code/controllers/subsystem/transport.dm +++ b/code/controllers/subsystem/transport.dm @@ -183,6 +183,8 @@ PROCESSING_SUBSYSTEM_DEF(transport) transport_controller.dispatch_transport() return else + playsound(transport_controller.nav_beacon, 'sound/machines/tram/door_chime.ogg', 45, vary = FALSE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE) + stoplag(1.4 SECONDS) transport_controller.set_status_code(DOORS_READY, FALSE) transport_controller.cycle_doors(CYCLE_CLOSED) diff --git a/code/modules/transport/tram/tram_controller.dm b/code/modules/transport/tram/tram_controller.dm index e9a264b5190..97add0f943d 100644 --- a/code/modules/transport/tram/tram_controller.dm +++ b/code/modules/transport/tram/tram_controller.dm @@ -65,6 +65,9 @@ ///previous trams that have been destroyed var/list/tram_history + ///cooldown on tram announcement system + COOLDOWN_DECLARE(announce_cooldown) + /datum/tram_mfg_info ///serial number of this tram (what round ID it first appeared in) var/serial_number @@ -349,11 +352,23 @@ else recovery_activate_count = max(recovery_activate_count - 1, 0) + if(travel_remaining < 39 && (COOLDOWN_FINISHED(src, announce_cooldown))) + make_announcement("The next station is: [destination_platform].") + COOLDOWN_START(src, announce_cooldown, 4 SECONDS) + scheduled_move = world.time + internal_movement_delay /datum/transport_controller/linear/tram/proc/set_tram_speed(new_speed) internal_movement_delay = round(clamp(50 / new_speed, 0.5, 5), 0.1) +/datum/transport_controller/linear/tram/proc/make_announcement(broadcast) + if(SStts.tts_enabled) + nav_beacon.voice = SStts.tram_voice + else + playsound(nav_beacon, 'sound/machines/tram/info_chime.ogg', 100, vary = FALSE, extrarange = SILENCED_SOUND_EXTRARANGE, falloff_exponent = 1.4) + + nav_beacon.say(broadcast) + /** * Tram stops normally, performs post-trip actions and updates the tram registration. */ @@ -362,35 +377,13 @@ log_transport("TC: [specific_transport_id] trip completed. Info: nav_pos ([nav_beacon.x], [nav_beacon.y], [nav_beacon.z]) idle_pos ([destination_platform.x], [destination_platform.y], [destination_platform.z]).") nav_beacon.tram_loop.stop() addtimer(CALLBACK(src, PROC_REF(unlock_controls)), 2 SECONDS) + addtimer(CALLBACK(src, PROC_REF(platform_arrival_jingle)), 2.5 SECONDS) if((controller_status & SYSTEM_FAULT) && (nav_beacon.loc == destination_platform.loc)) //position matches between controller and tram, we're back on track set_status_code(SYSTEM_FAULT, FALSE) playsound(paired_cabinet, 'sound/machines/synth/synth_yes.ogg', 40, vary = FALSE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) paired_cabinet.say("Controller reset.") log_transport("TC: [specific_transport_id] position data successfully reset.") idle_platform = destination_platform - var/our_channel = SSsounds.random_available_channel() - var/sound/jingle = sound( - idle_platform.arrival_sound, - FALSE, - 0, - our_channel, - 60 - ) - var/list/hearers = playsound(idle_platform, jingle, 50, FALSE, 0, extrarange= 10, ignore_walls = TRUE) - new /datum/threed_sound( - new_parent = idle_platform, - new_sound = jingle, - current_listeners = hearers, - can_add_new_listeners = FALSE, - volume = 60, - sound_range = SOUND_RANGE + 7, - sound_length = 12 SECONDS, - channel = our_channel, - preference_volume = null, - preference_signal = null, - falloff_exponent = SOUND_FALLOFF_EXPONENT, - falloff_distance = 5 - ) tram_registration.distance_travelled += (travel_trip_length - travel_remaining) travel_trip_length = 0 @@ -738,6 +731,32 @@ return FALSE +/// Plays the arrival jingle associated with the platform +/datum/transport_controller/linear/tram/proc/platform_arrival_jingle() + var/our_channel = SSsounds.random_available_channel() + var/sound/jingle = sound( + idle_platform.arrival_sound, + FALSE, + 0, + our_channel, + 60 + ) + var/list/hearers = playsound(idle_platform, jingle, 60, FALSE, 0, extrarange = 7) + new /datum/threed_sound( + new_parent = idle_platform, + new_sound = jingle, + current_listeners = hearers, + can_add_new_listeners = FALSE, + volume = 60, + sound_range = SOUND_RANGE - 3, + sound_length = 3 SECONDS, + channel = our_channel, + preference_volume = /datum/preference/numeric/volume/sound_instruments, + preference_signal = null, + falloff_exponent = SOUND_FALLOFF_EXPONENT, + falloff_distance = 5 + ) + /** * Moves the tram when hit by an immovable rod * diff --git a/code/modules/transport/tram/tram_controls.dm b/code/modules/transport/tram/tram_controls.dm index 1780b48944c..a1d0f846107 100644 --- a/code/modules/transport/tram/tram_controls.dm +++ b/code/modules/transport/tram/tram_controls.dm @@ -237,22 +237,19 @@ if(tram) if(SStts.tts_enabled) tram.nav_beacon.voice = SStts.tram_voice - switch(response_code) - if(REQUEST_SUCCESS) - tram.nav_beacon.say("The next stop is: [response_info]") - if(REQUEST_FAIL) - if(!LAZYFIND(relevant, src)) + if(response_code == REQUEST_FAIL) + if(!LAZYFIND(relevant, src)) + return + + switch(response_info) + if(NOT_IN_SERVICE) + tram.nav_beacon.say("The tram is not in service. Please contact the nearest engineer.") + if(INVALID_PLATFORM) + tram.nav_beacon.say("Configuration error. Please contact the nearest engineer.") + if(INTERNAL_ERROR) + tram.nav_beacon.say("Tram controller error. Please contact the nearest engineer or crew member with telecommunications access to reset the controller.") + else return - switch(response_info) - if(NOT_IN_SERVICE) - tram.nav_beacon.say("The tram is not in service. Please contact the nearest engineer.") - if(INVALID_PLATFORM) - tram.nav_beacon.say("Configuration error. Please contact the nearest engineer.") - if(INTERNAL_ERROR) - tram.nav_beacon.say("Tram controller error. Please contact the nearest engineer or crew member with telecommunications access to reset the controller.") - else - return - MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/tram_controls, 32) diff --git a/code/modules/transport/tram/tram_doors.dm b/code/modules/transport/tram/tram_doors.dm index f888ecd8ba5..686c87f6704 100644 --- a/code/modules/transport/tram/tram_doors.dm +++ b/code/modules/transport/tram/tram_doors.dm @@ -65,8 +65,8 @@ try_to_close(forced = BYPASS_DOOR_CHECKS) return - if(retry_counter == 1) - playsound(src, 'sound/machines/chime.ogg', 40, vary = FALSE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) + if(retry_counter > 1) + playsound(src, 'sound/machines/tram/door_chime.ogg', 40, vary = FALSE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) addtimer(CALLBACK(src, PROC_REF(verify_status)), (2.7 SECONDS)) try_to_close() diff --git a/code/modules/transport/transport_navigation.dm b/code/modules/transport/transport_navigation.dm index 6695772cb2f..0f1e4b03c19 100644 --- a/code/modules/transport/transport_navigation.dm +++ b/code/modules/transport/transport_navigation.dm @@ -46,24 +46,24 @@ specific_transport_id = TRAMSTATION_LINE_1 /obj/effect/landmark/transport/nav_beacon/tram/nav/tramstation/main - name = TRAMSTATION_LINE_1 + name = "tram announcement system" specific_transport_id = TRAM_NAV_BEACONS dir = WEST /obj/effect/landmark/transport/nav_beacon/tram/platform/tramstation/west - name = "Arrivals Station" + name = "Arrivals" platform_code = TRAMSTATION_WEST tgui_icons = list("Arrivals" = "plane-arrival", "Command" = "bullhorn", "Security" = "gavel") arrival_sound = 'sound/machines/tram/arrivals_line_processed.ogg' /obj/effect/landmark/transport/nav_beacon/tram/platform/tramstation/central - name = "Medical Station" + name = "Medical" platform_code = TRAMSTATION_CENTRAL tgui_icons = list("Service" = "cocktail", "Medical" = "plus", "Engineering" = "wrench") arrival_sound = 'sound/machines/tram/medical_line_processed.ogg' /obj/effect/landmark/transport/nav_beacon/tram/platform/tramstation/east - name = "Escape Station" + name = "Escape" platform_code = TRAMSTATION_EAST tgui_icons = list("Departures" = "plane-departure", "Cargo" = "box", "Science" = "flask") arrival_sound = 'sound/machines/tram/escape_line_processed.ogg' @@ -87,28 +87,28 @@ dir = WEST /obj/effect/landmark/transport/nav_beacon/tram/platform/birdshot/sec_wing - name = "Security Station" + name = "Security" specific_transport_id = BIRDSHOT_LINE_1 platform_code = BIRDSHOT_SECURITY_WING tgui_icons = list("Security" = "gavel") arrival_sound = 'sound/machines/tram/medical_line_processed.ogg' /obj/effect/landmark/transport/nav_beacon/tram/platform/birdshot/prison_wing - name = "Prison Station" + name = "Prison" specific_transport_id = BIRDSHOT_LINE_1 platform_code = BIRDSHOT_PRISON_WING tgui_icons = list("Prison" = "box") arrival_sound = 'sound/machines/tram/other_line_processed.ogg' /obj/effect/landmark/transport/nav_beacon/tram/platform/birdshot/maint_left - name = "Escape Station" + name = "Escape" specific_transport_id = BIRDSHOT_LINE_2 platform_code = BIRDSHOT_MAINTENANCE_LEFT tgui_icons = list("Port Platform" = "plane-departure") arrival_sound = 'sound/machines/tram/escape_line_processed.ogg' /obj/effect/landmark/transport/nav_beacon/tram/platform/birdshot/maint_right - name = "Arrivals Station" + name = "Arrivals" specific_transport_id = BIRDSHOT_LINE_2 platform_code = BRIDSHOT_MAINTENANCE_RIGHT tgui_icons = list("Starboard Platform" = "plane-arrival") diff --git a/sound/machines/tram/door_chime.ogg b/sound/machines/tram/door_chime.ogg new file mode 100644 index 0000000000000000000000000000000000000000..26c58bca35a0f3f31de995db8920e91e86b64fbc GIT binary patch literal 39325 zcmeFZc{o+=+dq7+J+RH&n1nWwA!H6oi;y{EA<9@Ng=iiYsU%54l3`~i6+(0EN{9wU zXx6Mj^K^Gt-gD9YeZJ50KF9BQkK;Ms|9
J(d0-3u#r+gI;m}u^QOPT
z($uyp;@39igbuZ;!UR#>YJQ5SaR+a+oAJx?JswsstIIO2UTHUV+llEn-E?s?x-~ca
z@E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info_chime.ogg
new file mode 100644
index 0000000000000000000000000000000000000000..e1a1e0eb83b51b2bbf71d521f6a7f06233255d6a
GIT binary patch
literal 45324
zcmafb2RxPE|M
0H_7B%`}j??9~D=vPVzmtL(0KIIa0&g=jcM|H>C){sfRk#lo9_
z7IH%X{cksw#X>+{qNO4)QFAMZuv7h21?*5Lp60rlsEhJmh3Y9c&J3=nB-6k^Rxt$%
z4^)d#$-R(U5-YWWY7zQusd@3477`**@G7Mz7&PESU)cJ!PUQPS(*%W48nS6sQ+$Sj
zVKv+~-D_H#Ru@CGWJ=S-n;?eL5+t`~8~I%|3Gx}_q{zX?>o*Jyq`RT7+q!roatN9*
z-;~ycH$g+H>(6cBh|@tskJqOWi(wn|4QcZIanniPZ?G)rJG{A8A&`+=
4Om7Xac0%FfhdhIjZ+g`923$@|!`
zkP
*Gf~xm&
zrEqMes@Q(ORH`}t)|fXnpYuF~l#IL9d}1k)0?f9&T-?3`cNOIRpCw&2EU<1T-t>z%
zvRcSSN_sp6;*NV;72s^zNCT9pOEFA_u-22Z#;%qJd(!O?3I$GInf=rX(L9@c(w)&{gE-&ww*SiY6VOO
zYImjPanSGp!Z$`#a{c_@aiiIUnK~PO&OJS7T+sB~JmwLjO*OZok3Q2C)f`%qAkRg~
zN^0Uo%pCpZ9U|oteJKj1iQ2LU1!VqQI+RfsLkienl!WRojy{SFfaw=?Gw~|sFJCxE
zZ3x|=Pae*Tj-qR|IaHf|w?wn{dbW3j$Kzj#Xu|5