Sound mp3. Yours, background music in mp3 format, on your map.

  • I'm just shocked, on a website, there are no lessons about sounds.
    We need to fix this.


    Sound mp3 with the use of ambientPlay (music plays continuously until the very end with a repeat, there is no default music).
    The music file must be in mp3 format


    In the folder raw/soundaliases we create the file mp_tutorial.csv. In it we insert this:


    Code
    1. name,sequence,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage
    2. #Ambiance
    3. ambient_mp_tutorial,,ambient/amb_tutorial.mp3,0.99,,,,,,,local,streamed,,looping,,mp_tutorial


    The sound should be put in the folder raw/sound/ambient/


    Now go to mp_tutorial.gsc file and change in the line ambientPlay value in parentheses to "ambient_mp_tutorial" Should look like this:


    Code
    1. ambientPlay("ambient_mp_tutorial");


    Now open the zone file in the compiler
    And we add:


    Code
    1. sound,mp_tutorial,,all_mp
    2. sound,common,mp_tutorial,!all_mp
    3. sound,generic,mp_tutorial,!all_mp
    4. sound,voiceovers,mp_tutorial,!all_mp
    5. sound,multiplayer,mp_tutorial,!all_mp
    6. sound,mp_tutorial,mp_tutorial,!all_mp


    Instead of mp_tutorial - the name of the map, respectively


    The penultimate step is to go to usermaps / mp_tutorial and create the sound / ambient folders, copy the song there and archive this folder as a zip archive named mp_tutorial.iwd


    The last step is to remove the default music:
    It's best to create a separate .GSC file, well, call it eg: _killmusic.
    We paste in it what is written below:


    Code
    1. main()
    2. {
    3. wait 1;
    4. if(isDefined(game) && isDefined(game["music"]) && isDefined(game["music"]["suspense"]))
    5. for(i = 0;i < game["music"]["suspense"].size;i++)
    6. game["music"]["suspense"][i] = "null";
    7. }


    Naturally do not forget, the new .GSC files of your scripts should be:
    if multiplayer, then in the directory: raw / maps / mp / _killmusic.gsc.
    if a single-user mode, then in the directory: raw / maps / _killmusic.gsc.


    Now in the main mp_tutorial.gsc file, you need to add this line:


    Code
    1. maps\mp\_killmusic::main();


    It should look something like this:



    Now open the zone file again in the compiler
    And we add:


    Code
    1. rawfile,maps/mp/_killmusic.gsc


    Now we can compile the fast game file and add them to usermaps / mp_tutorial.
    And accordingly we add this whole thing to some MOD, and through the mod we launch the map, and we enjoy our music.


    :thumbup:

  • Stock soundalias files (at least on cod2) have much more valuable information in them as well: