Skip to content

Commit

Permalink
Allows easy hosting of server side lobby music (#31352)
Browse files Browse the repository at this point in the history
* Allows easy hosting of server side lobby music

* No images here!!!

* Undelete /tg/ sounds... REEE

* Add back the old system and use it if this doesn't find any music

* Documentation++

* Update round_start_sounds.txt

* Allow for rare map specific title music

Also don't attempt to play non-valid sounds/non-sounds

* Fix bad sound filter, fix common sounds

* Update README.txt

* Update ticker.dm

* Update ticker.dm
  • Loading branch information
JamieH authored and CitadelStationBot committed Oct 8, 2017
1 parent c91d54c commit 2f41af5
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 1 deletion.
49 changes: 48 additions & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,57 @@ SUBSYSTEM_DEF(ticker)

/datum/controller/subsystem/ticker/Initialize(timeofday)
load_mode()
var/list/music = world.file2list(ROUND_START_MUSIC_LIST, "\n")

var/list/byond_sound_formats = list(
"mid" = TRUE,
"midi" = TRUE,
"mod" = TRUE,
"it" = TRUE,
"s3m" = TRUE,
"xm" = TRUE,
"oxm" = TRUE,
"wav" = TRUE,
"ogg" = TRUE,
"raw" = TRUE,
"wma" = TRUE,
"aiff" = TRUE
)

var/list/provisional_title_music = flist("config/title_music/sounds/")
var/list/music = list()
var/use_rare_music = prob(1)

for(var/S in provisional_title_music)
var/lower = lowertext(S)
var/list/L = splittext(lower,"+")
switch(L.len)
if(3) //rare+MAP+sound.ogg or MAP+rare.sound.ogg -- Rare Map-specific sounds
if(use_rare_music)
if(L[1] == "rare" && L[2] == SSmapping.config.map_name)
music += S
else if(L[2] == "rare" && L[1] == SSmapping.config.map_name)
music += S
if(2) //rare+sound.ogg or MAP+sound.ogg -- Rare sounds or Map-specific sounds
if((use_rare_music && L[1] == "rare") || (L[1] == SSmapping.config.map_name))
music += S
if(1) //sound.ogg -- common sound
music += S

var/old_login_music = trim(file2text("data/last_round_lobby_music.txt"))
if(music.len > 1)
music -= old_login_music

for(var/S in music)
var/list/L = splittext(S,".")
if(L.len >= 2)
var/ext = lowertext(L[L.len]) //pick the real extension, no 'honk.ogg.exe' nonsense here
if(byond_sound_formats[ext])
continue
music -= S

if(isemptylist(music))
music = world.file2list(ROUND_START_MUSIC_LIST, "\n")

login_music = pick(music)

if(!GLOB.syndicate_code_phrase)
Expand Down
34 changes: 34 additions & 0 deletions config/title_music/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---LICENSE NOTICE---

The server operator(s) is responsible for the copyright status of all sounds placed within the /config/title_music/sounds folder unless otherwise noted.

If a sound requires attribution and/or a specific license it is up to the operator(s) to make this information publicly available on either
a website associated with their server or on the server itself.

If operators(s) allow these configuration files to be public this file can serve that purpose by keeping it properly updated.

If in the future new sounds are published to these folders (i.e. in an online code repository) they must explicitly state their
license if said license is not the same as the default licensing found in README.md in the root directory of the project.

Do not remove this notice.

---END NOTICE---




---EXAMPLES (NOT PART OF ANY LICENSE)---

These are examples of properly attrubuted and licensed sounds.
They are not an actual part of any license under any circumstance.

title5.ogg was created by Mya Quinn on Feburary 28, 2557. It is licensed under a Combative Clowning 3.0 HO-NK license (http://example.com/license/url/).

Unless otherwise noted all sounds were created by Cuban Pete on July 26, 2555. They are licensed under the RUMBABEAT Public License.(http://example.com/license/url/).

---END EXAMPLES (NOT PART OF ANY LICENSE)---




---ADD LICENSING INFORMATION BELOW---
39 changes: 39 additions & 0 deletions config/title_music/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
The enclosed sounds folder holds the sound files used as the title music for the game. OGG and WAV are supported.

Using unnecessarily huge sounds can cause client side lag and should be avoided.

You may add as many title sounds as you like, if there is more than one a random screen is chosen (see name conventions for specifics).

---

Naming Conventions:

Every title sound you add must have a unique name. It is allowed to name two things the same if they have different file types, but this should be discouraged.
Avoid using the plus sign "+" and the period "." in names, as these are used internally to classify sounds.


Common Title Sounds:

Common sounds are in the rotation to be displayed all the time. Any name that does not include the character "+" is considered a common sound.

An example of a common sound name is "clown".


Map Title Sounds:

Map sounds are tied to a specific in game map. To make a map title you format the name like this "(name of a map)+(name of your sound)"

The spelling of the map name is important. It must match exactly the define MAP_NAME found in the relevant .DM file in the /_maps folder in
the root directory. It can also be seen in game in the status menu. Note that there are no spaces between the two names.

It is absolutely fine to have more than one sound tied to the same map. It's also fine to have a rare map sound.

An example of a map sound name is "Omegastation+splash".


Rare Title Sounds:

Rare title sounds are a just for fun feature where they will only have a 1% chance of appear in in the title sound pool of a given round.
Add the phrase "rare+" to the beginning of the name. Again note there are no spaces.

An example of a rare sound name is "rare+explosion"

0 comments on commit 2f41af5

Please sign in to comment.