Page 1 of 1

Playing music on a map

Posted: March 23rd, 2012, 10:28 pm
by Davbo
Hi, this is my first time posting on this forum :D

I'm fairly new to map making. I want to add a song to a map, I have the map and song I want to play. I read nightmares sound tutorial but I don't want to start the song using a trigger, I just want to play it when the map starts. I don't really know much about scripting. I've looked across these forums trying to find the right thing to put in the .gsc file and the .csv file and I've tried loads of things but I can't seem to get it to work. Another thing I would like to know is the way in which the folders have to be ordered in the .pk3 file so that it works correctly.

Re: Playing music on a map

Posted: March 23rd, 2012, 10:59 pm
by ThaWalrus
http://modsonline.com/Tutorials-read-278.html

Very useful, also tells you how to convert it to the right format.

But, playing the music isnt very difficult... Just use ambientPlay("mymusic");, put the music in the right folder, and you are ready to go...!

Re: Playing music on a map

Posted: March 23rd, 2012, 11:27 pm
by Davbo
I already tried that stuff, but when I try to play the map it says there is a compiling error which means there is something wrong with the .gsc file.

Re: Playing music on a map

Posted: March 24th, 2012, 1:16 pm
by ThaWalrus
A compiling error usually means your bsp file is corrupt, can you give me a screenshot or more detailed information about the error?

Re: Playing music on a map

Posted: March 24th, 2012, 1:41 pm
by Davbo
I was working on it last night and I know for a fact that the .bsp is fine, I can play the map. I also have all the correct stuff typed into the .csv and the .gsc but whenever i play the map there is no music playing. This is what I've entered into the .csv file
"# If the text in the first column of a row starts with a # character, the row is ignored",,
,,"If the first column for a row is blank, then the row is ignored"
# The first non-comment line of a sound alias file specifies the key name for all values appearing in this column.,,
"# This means it is safe to swap entire columns around, though you should never swap partial columns.",,
"# You can invent new keys, but the game will ignore them if it doesn't know about them.",,
"# You can leave out keys, but the ""name"" and ""file"" keys must always be present.",,

,name,name of the alias that is used to play this sound (required)
,sequence,"used to uniquely identify alias entries when more than one sound goes to an alias, used only to catch unwanted duplicates (default = 0)"
,file,the name of the file that contains the sound data (required)
,vol_min,"0 is silent, 1 is full volume (default = 1)"
,vol_max,"0 is silent, 1 is full volume (default = same as vol_min)"
,pitch_min,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = 1)"
,pitch_max,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = same as pitch_min)"
,dist_min,"within this distance in inches, the sound is always full volume (default = 120)"
,dist_max,"outside this distance in inches, the sound is not started. If left blank or set to 0, the sound will play from any distance. This does not affect sound volume falloff."
,channel,"auto, menu, weapon, voice, item, body, local, music, announcer (default = auto)",,,,,,,,,,,,,
,type,streamed / loaded (default = loaded),,,,,,,,,,,,,
,probability,weight to use for the weighted probability of playing this sound instead of another sound (default = 1),,,,,,,,,,,,,
,loop,"whether this sound is ""looping"" or ""nonlooping"" (default = ""nonlooping"")",,,,,,,,,,,,,
,masterslave,"if ""master"", this is a master sound. If a number, then this sound won't exceed this volume whenever any master sound is playing. If blank, then neither master nor slave.",,,,,,,,,,,,,
,loadspec,"space-separated list of which maps should use this alias; eg, ""burnville dawnville"". If blank, the alias is used on all maps.",,,,,,,,,,,,,

name,sequence,file,vol_min,vol_max,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,masterslave,loadspec,subtitle

null,,null.wav,,,,,,,,,,,,,

Skybox,,ambient/amb_thetempest_ext.mp3,1,,,,,,local,streamed,,looping,,all_mp
and this is what is in the .gsc
main()
{

ambientPlay("ambient_thetempest_ext.mp3");

}
I have a "maps" folder in which has a folder called "mp" which stores the .gsc and the .bsp
I also have the "mp" folder for the arena file. The "sound" folder has a folder called "ambient" and in that folder is my sound. The "soundaliases" folder which has the .csv in it. my map is called "Skybox" and the song is called "amb_thetempest_ext".
Tell me if you need more info.

Re: Playing music on a map

Posted: March 24th, 2012, 3:42 pm
by ThaWalrus
Skybox,,ambient/amb_thetempest_ext.mp3,1,,,,,,local,streamed,,looping,,all_mp

So, the name is Skybox...? Try to use ambientPlay("Skybox");

Don't use the .mp3 extension anyways...

"all_mp", is for loadspec

Loadspec: "space-separated list of which maps should use this alias; eg, "burnville dawnville". If blank, the alias is used on all maps."

So, try to keep that blank.

Add me on xfire if you still have problems?

xfire = ThaWalrus

Re: Playing music on a map

Posted: March 24th, 2012, 8:03 pm
by Davbo
Haha :D Cheers mate that completely fixed it, the song now plays :D