UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: Tomzen on October 09, 2016, 05:49:42 am

Title: How to add custom sounds?
Post by: Tomzen on October 09, 2016, 05:49:42 am
Hi, I want to be able to add custom sounds, but I don't really understand the "user_aliases.csv" file, how can I make it so a file located in my usermaps/zm_mapname/sound directory plays once, and once only at 100% volume.

Double Post Merge: October 09, 2016, 06:27:01 am
I already have:

Code Snippet
Plaintext
maxammosnd,,,usermaps/zm_bestbox/sound/maxammo.wav,,,UIN_MOD,,,,,BUS_MUSIC,,,,,,100,100,,,,,,,,2,oldest,,,1,1,,,,,,2d,,,NONLOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

And it's being activated with:
Code Snippet
Plaintext
players = GetPlayers( player.team );

for (i = 0; i < players.size; i++)
{
primaryWeapons = players[i] GetWeaponsList();

for( x = 0; x < primaryWeapons.size; x++ )
{
players[i] PlayLocalSound( "maxammosnd" );
players[i] notify( "zmb_max_ammo" );
players[i] GiveMaxAmmo( primaryWeapons[x] );
}
}

However when I go into my map and purchase it, the sound dosen't play.

I've also tried:
Code Snippet
Plaintext
playsound( "maxammosnd" );
Title: Re: How to add custom sounds?
Post by: wumbi on October 10, 2016, 12:01:18 am
You have the sound file in the wrong location. It should be in root/sound_assets/[any folder name you want]/
In your user_aliases.csv file, paste the following on a new line:
Code Snippet
Plaintext
[ANY_SOUND_ALIAS_YOU_WANT],,,[folder_name][file_name_with_extension},,,UIN_MOD,,,,,BUS_MUSIC,,,,,,100,100,,,,,,,,2,oldest,,,1,1,,,,,,2d,,,NONLOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

In the playsound code, use the sound alias you made.
Title: Re: How to add custom sounds?
Post by: wumbi on October 10, 2016, 12:01:47 am
Also, get rid of the brackets in the example.
Title: Re: How to add custom sounds?
Post by: CovertGunman on October 10, 2016, 04:57:37 am
You could try this:
Code Snippet
Plaintext
PlaySoundAtPosition("maxammosnd", (0, 0, 0));

instead of
Code Snippet
Plaintext
players[i] PlayLocalSound( "maxammosnd" );

I also found too that if you encounter an error pop up in relation to your alias file when compiling the map then it doesn't allow the alias file to work at all. SO double check that.
Title: Re: How to add custom sounds?
Post by: Tomzen on October 11, 2016, 09:19:05 am
You have the sound file in the wrong location. It should be in root/sound_assets/[any folder name you want]/
In your user_aliases.csv file, paste the following on a new line:
Code Snippet
Plaintext
[ANY_SOUND_ALIAS_YOU_WANT],,,[folder_name][file_name_with_extension},,,UIN_MOD,,,,,BUS_MUSIC,,,,,,100,100,,,,,,,,2,oldest,,,1,1,,,,,,2d,,,NONLOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

In the playsound code, use the sound alias you made.

Hey how do I add a second sound? I copied the exact same thing and pasted it on the second line but changed the file location and alias, but it dosen't work:

Code Snippet
Plaintext
maxammosnd,,,bestbox/maxammo.wav,,,UIN_MOD,,,,,BUS_MUSIC,,,,,,100,100,,,,,,,,2,oldest,,,1,1,,,,,,2d,,,NONLOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
papcamosnd,,,bestbox/papcamo.wav,,,UIN_MOD,,,,,BUS_MUSIC,,,,,,100,100,,,,,,,,2,oldest,,,1,1,,,,,,2d,,,NONLOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,