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:
- 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
- #Ambiance
- 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:
Now open the zone file in the compiler
And we add:
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:
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:
It should look something like this:
- main()
- {
- maps\mp\_killmusic::main();
- maps\mp\_load::main();
- ambientPlay("ambient_mp_tutorial");
- game["allies"] = "sas";
- game["axis"] = "opfor";
- game["attackers"] = "axis";
- game["defenders"] = "allies";
- game["allies_soldiertype"] = "woodland";
- game["axis_soldiertype"] = "woodland";
- setdvar("r_specularcolorscale", "1");
- setdvar("compassmaxrange", "2700");
- }
Now open the zone file again in the compiler
And we add:
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.