Custom BackGround Music

Post your scripting questions / solutions here

Moderator: Moderators

BiG_HeaD
Brigadier General
Posts: 531
Joined: Thu Jul 03, 2003 7:28 pm

Custom BackGround Music

Post by BiG_HeaD »

What Kind of Music should the file type be? Does moh play mp3. or wav?

I dont get any of the tutorials.

Anybody help me?
User avatar
CorporalPunishment
Sergeant
Posts: 62
Joined: Mon May 19, 2003 5:25 am

Post by CorporalPunishment »

Wav files are quite large so you will probably want to use MP3

You need to make a .mus file

In your main map script add this before "level waittill spawn"

exec global/ambient.scr YourMapName

Make a "YourMapName.mus" in the music folder.
Have a look in the music folder in you pak files for examples

Lastly a MP3 needs to be in a folder not in a Pak. So to distribute
your map you need to have the folder seperate.
BiG_HeaD
Brigadier General
Posts: 531
Joined: Thu Jul 03, 2003 7:28 pm

Post by BiG_HeaD »

Okay, instead of finding a mp3, i found a Good Ambient one inside the AMbient folder. So, How do i take that file and turn it into a .mus

?
User avatar
CorporalPunishment
Sergeant
Posts: 62
Joined: Mon May 19, 2003 5:25 am

Post by CorporalPunishment »

Have a look in the music folder (Pak0.pk3) and find a .mus file that uses the mp3 you want.

then copy it and rename it as youmapname.mus

go into your map script and add:

exec global/ambient.scr YourMapName
level waittill spawn
BiG_HeaD
Brigadier General
Posts: 531
Joined: Thu Jul 03, 2003 7:28 pm

Post by BiG_HeaD »

u win

ty
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post by Jack Ruby »

Ok, I will post here seeing as its on the same topic.

I am adapting the Berlin TOW script for my own nefarious purposes, to get the level ending music I have to refer to level.music = Berlin ( something like that, the ambient background to this Berlin is planes flying over, bombs, general war sounds, then it switches tracks when either team wins for the cinematic ending.

Soo I want the ambience to be obj_team2 ( V2 ), I can remove the berlin line in the script and play the V2 ambience but then I lose the music for the endings, I cant find what that level.music thing refers to, anyone know how to get the ambience I want and the level end music ?

Cheers.
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
BiG_HeaD
Brigadier General
Posts: 531
Joined: Thu Jul 03, 2003 7:28 pm

Post by BiG_HeaD »

okay, i found the .mus file i want. I added the required .scr to the original. Now, when i put together the .pk3, where should the .mus file go?
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

SPEARHEAD
Mainta/ Music/ my_map.mus

Allied Assault
Main/ my_map.pk3/ Music/ my_music.mus

Naturally you are calling this .MUS file from your map script.

i.e.

Code: Select all

exec global/ambient.scr my_map.mus
That's it! ROCK on.
BiG_HeaD
Brigadier General
Posts: 531
Joined: Thu Jul 03, 2003 7:28 pm

Post by BiG_HeaD »

hum?



//PrisonCamp1
//ARCHITECTURE: BiG_HeaD
//SCRIPTING: BiG_HeaD

main:

//set scoreboard messages
setcvar "g_obj_Alliedtext1" "DIE"
setcvar "g_obj_Alliedtext2" ""
setcvar "g_obj_Alliedtext3" ""
setcvar "g_obj_Axistext1" ""
setcvar "g_obj_Axistext2" ""
setcvar "g_obj_Axistext3" ""

setcvar "g_scoreboardpic" "none"

exec global/ambient.scr prisoncamp1.mus

level waitTill prespawn

//***precache Dm stuff
exec global/DMprecache.scr

level.script=maps/dm/prisoncamp1.scr

level waittil spawn

end



I made the .pk3 with one folder with maps-dm-bsp-lin-min-scr
other folder: music-prisoncamp1.mus

??!?!
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

exec global/ambient.scr prisoncamp1.mus

should be

exec global/ambient.scr prisoncamp1

(only works when your .mus file is in the main/music folder!)
Image
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

First off you need to fix that script.

1.
level waitTill prespawn
Should be:

Code: Select all

level waittill prespawn
2.
level waittil spawn
Should be:

Code: Select all

level waittill spawn
3.
level.script=maps/dm/prisoncamp1.scr
Should be:

Code: Select all

level.script = maps/dm/prisoncamp1.scr
4.
exec global/ambient.scr prisoncamp1.mus
Should be:

Code: Select all

exec global/ambient.scr prisoncamp1
The rest seems OK.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

All true, except the third point (which is a useless line anyway, you could just omit it all together :))
Image
BiG_HeaD
Brigadier General
Posts: 531
Joined: Thu Jul 03, 2003 7:28 pm

Post by BiG_HeaD »

works. thanx.
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

Really. I read someplace that you have to set level script from within the map script file.

It puzzled me as to why. But who am I to complain? :lol:

Taken from Spearhead:
level.script = maps/dm/MP_Malta_DM.scr
I just came up with an answer that that satisfied my curiousity and stuck with it.

Basically you set level.script so that while ingame, you can use the editscript command and it knows what script file to open. Makes sense?
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

BUZZZZ! I WAS WRONG!

I tried switching the level script to the drukk map script. Then went to game and tried EDITSCRIPT command and it opened the Malta script still.

Hmmm. Can this really be usless? I even saw it in the Basic Scripts.doc.
Post Reply