UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

How to add custom sounds?

broken avatar :(
Created 8 years ago
by Tomzen
0 Members and 1 Guest are viewing this topic.
2,814 views
broken avatar :(
×
broken avatar :(
Location: au
Date Registered: 27 December 2014
Last active: 4 years ago
Posts
13
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Tomzen's Groups
Tomzen's Contact & Social Links
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" );
Last Edit: October 09, 2016, 06:27:01 am by Tomzen
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 August 2016
Last active: 6 years ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
wumbi's Groups
wumbi's Contact & Social Links
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.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 August 2016
Last active: 6 years ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
wumbi's Groups
wumbi's Contact & Social Links
Also, get rid of the brackets in the example.
broken avatar :(
×
broken avatar :(
Location: usIdaho
Date Registered: 10 November 2014
Last active: 5 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature


Want cheap games? This is where I get mine: http://bit.ly/1zQisf2
×
CovertGunman's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
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.
broken avatar :(
×
broken avatar :(
Location: au
Date Registered: 27 December 2014
Last active: 4 years ago
Posts
13
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Tomzen's Groups
Tomzen's Contact & Social Links
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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

 
Loading ...