From cdf387cd6baa0c911f8b33fcf59e7bce971b8404 Mon Sep 17 00:00:00 2001 From: hislittlecuzin Date: Sun, 5 Nov 2023 23:33:45 -0500 Subject: [PATCH 1/6] Added Ability for Looping Sounds to be heard from further away. --- code/datums/looping_sounds/_looping_sound.dm | 37 +++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm index c6fc23c68eba..b1aa195600b1 100644 --- a/code/datums/looping_sounds/_looping_sound.dm +++ b/code/datums/looping_sounds/_looping_sound.dm @@ -37,6 +37,12 @@ /// Has the looping started yet? var/loop_started = FALSE + //Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away.______qdel_list_wrapper(list/L) + //Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv + //with a longer "falloff distance." Fixes the extra_range stuff + var/is_sound_projecting = FALSE + var/falloff_distance = 50 + /* // as of yet unused varen \\ /// How much the sound will be affected by falloff per tile. @@ -130,19 +136,24 @@ sound_to_play.channel = get_free_channel() sound_to_play.volume = volume_override || volume //Use volume as fallback if theres no override SEND_SOUND(parent, sound_to_play) - else - playsound( - parent, - sound_to_play, - volume, - vary, - extra_range//, - // falloff_exponent = falloff_exponent, - // pressure_affected = pressure_affected, - // ignore_walls = ignore_walls, - // falloff_distance = falloff_distance, - // use_reverb = use_reverb - ) + return + if (is_sound_projecting) + playsound(parent, sound_to_play, volume, vary, extra_range, VOLUME_SFX, 0, 0, falloff_distance) + //playsound(loc, '.ogg', 100, 0, 100, VOLUME_SFX, 0, 0, 50, 50) + return + + playsound( + parent, + sound_to_play, + volume, + vary, + extra_range//, + // falloff_exponent = falloff_exponent, + // pressure_affected = pressure_affected, + // ignore_walls = ignore_walls, + // falloff_distance = falloff_distance, + // use_reverb = use_reverb + ) /// Returns the sound we should now be playing. /datum/looping_sound/proc/get_sound(_mid_sounds) From dc259c96ef679025ffa593ac94805a52c9c0f6aa Mon Sep 17 00:00:00 2001 From: hislittlecuzin Date: Mon, 6 Nov 2023 13:19:51 -0500 Subject: [PATCH 2/6] Removed moot comments. Changed necessary doc comments. --- code/datums/looping_sounds/_looping_sound.dm | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm index b1aa195600b1..a0b0d77ce165 100644 --- a/code/datums/looping_sounds/_looping_sound.dm +++ b/code/datums/looping_sounds/_looping_sound.dm @@ -37,9 +37,9 @@ /// Has the looping started yet? var/loop_started = FALSE - //Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away.______qdel_list_wrapper(list/L) - //Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv - //with a longer "falloff distance." Fixes the extra_range stuff + ///Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away. + ///Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv + ///with a longer "falloff distance." Fixes the extra_range stuff var/is_sound_projecting = FALSE var/falloff_distance = 50 @@ -139,7 +139,6 @@ return if (is_sound_projecting) playsound(parent, sound_to_play, volume, vary, extra_range, VOLUME_SFX, 0, 0, falloff_distance) - //playsound(loc, '.ogg', 100, 0, 100, VOLUME_SFX, 0, 0, 50, 50) return playsound( @@ -147,12 +146,7 @@ sound_to_play, volume, vary, - extra_range//, - // falloff_exponent = falloff_exponent, - // pressure_affected = pressure_affected, - // ignore_walls = ignore_walls, - // falloff_distance = falloff_distance, - // use_reverb = use_reverb + extra_range ) /// Returns the sound we should now be playing. From d649a31725eda11fac5ba0b207deb430238c1df2 Mon Sep 17 00:00:00 2001 From: hislittlecuzin Date: Tue, 7 Nov 2023 00:02:34 -0500 Subject: [PATCH 3/6] Fixed doc comment. --- code/datums/looping_sounds/_looping_sound.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm index a0b0d77ce165..2c4469a2d623 100644 --- a/code/datums/looping_sounds/_looping_sound.dm +++ b/code/datums/looping_sounds/_looping_sound.dm @@ -37,9 +37,7 @@ /// Has the looping started yet? var/loop_started = FALSE - ///Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away. - ///Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv - ///with a longer "falloff distance." Fixes the extra_range stuff + ///Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away. /n Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv /n with a longer "falloff distance." Fixes the extra_range stuff var/is_sound_projecting = FALSE var/falloff_distance = 50 From 5caf12ff37b53121799e0df97560038696a1e153 Mon Sep 17 00:00:00 2001 From: hislittlecuzin Date: Tue, 7 Nov 2023 11:24:34 -0500 Subject: [PATCH 4/6] Adjusted multi line auto doc --- code/datums/looping_sounds/_looping_sound.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm index 2c4469a2d623..8aefb1a5019e 100644 --- a/code/datums/looping_sounds/_looping_sound.dm +++ b/code/datums/looping_sounds/_looping_sound.dm @@ -37,7 +37,11 @@ /// Has the looping started yet? var/loop_started = FALSE - ///Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away. /n Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv /n with a longer "falloff distance." Fixes the extra_range stuff + /* + * Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away. + * Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv + * with a longer "falloff distance." Fixes the extra_range stuff + */ var/is_sound_projecting = FALSE var/falloff_distance = 50 From eabb46320b20057ef54ff546828359764a61cb5d Mon Sep 17 00:00:00 2001 From: hislittlecuzin Date: Tue, 7 Nov 2023 21:51:39 -0500 Subject: [PATCH 5/6] Two stars for auto documentation. --- code/datums/looping_sounds/_looping_sound.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm index 8aefb1a5019e..ddff3630f37f 100644 --- a/code/datums/looping_sounds/_looping_sound.dm +++ b/code/datums/looping_sounds/_looping_sound.dm @@ -37,7 +37,7 @@ /// Has the looping started yet? var/loop_started = FALSE - /* + /** * Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away. * Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv * with a longer "falloff distance." Fixes the extra_range stuff From 0a2e53c054cb1e0bbb4642d898c54d70877086f8 Mon Sep 17 00:00:00 2001 From: hislittlecuzingames <142365554+hislittlecuzingames@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:45:27 -0500 Subject: [PATCH 6/6] Update code/datums/looping_sounds/_looping_sound.dm Thanks to Drulikar for the suggested Documentation. Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/datums/looping_sounds/_looping_sound.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm index ddff3630f37f..11ba15146430 100644 --- a/code/datums/looping_sounds/_looping_sound.dm +++ b/code/datums/looping_sounds/_looping_sound.dm @@ -43,6 +43,7 @@ * with a longer "falloff distance." Fixes the extra_range stuff */ var/is_sound_projecting = FALSE + ///only applicable to is_sound_projecting: max range till sound volume starts dropping as distance increases var/falloff_distance = 50 /* // as of yet unused varen \\