UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: M0ul3_G4m3r on October 17, 2016, 03:47:14 pm

Title: Sound easter egg !
Post by: M0ul3_G4m3r on October 17, 2016, 03:47:14 pm
Hello community !  :D
I want a script to when we shoot 2 or 3 trigger it's play sound !
Thanks !  :alone:
Title: Re: Sound easter egg !
Post by: shinged on October 18, 2016, 06:31:56 am
Paste this at the bottom of your mapname gsc.
Code Snippet
Plaintext
/*
SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~
SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~
*/
function soundEasterEggInit()
{
level.soundEasterEgg = 0;
level.playEasterEgg = 3;
level.playSoundLocation = GetEnt("easter_egg_sound_location", "targetname"); // Create a script origin and set it to server, not client, then give it this targetname

thread shoot1();
thread shoot2();
thread shoot3();
}

function shoot1()
{
shoot_trig1 = GetEnt("egg_shoot1", "targetname");
shoot_trig1 waittill("trigger", player);
shoot_model1 = GetEnt("shoot_model1", "targetname");
shoot_model1 delete();
level.soundEasterEgg++;
thread finishedEasterEgg();
shoot_trig1 delete();
}

function shoot2()
{
shoot_trig2 = GetEnt("egg_shoot2", "targetname");
shoot_trig2 waittill("trigger", player);
shoot_model2 = GetEnt("shoot_model2", "targetname");
shoot_model2 delete();
level.soundEasterEgg++;
thread finishedEasterEgg();
shoot_trig2 delete();
}

function shoot3()
{
shoot_trig3 = GetEnt("egg_shoot3", "targetname");
shoot_trig3 waittill("trigger", player);
shoot_model3 = GetEnt("shoot_model3", "targetname");
shoot_model3 delete();
level.soundEasterEgg++;
thread finishedEasterEgg();
shoot_trig3 delete();
}

function finishedEasterEgg()
{
if(level.soundEasterEgg >= level.playEasterEgg)
{
IPrintLnBold("You have found all the triggers");
level.playSoundLocation PlaySound("sephiroth"); // Change "sephiroth" to the name of your soundalias.
}
}

Paste this in the main function of your mapname gsc
Code Snippet
Plaintext
thread soundEasterEggInit();

Now in radiant make 3 damage triggers, and put 3 script models in them (Models are optional).
Give the damage triggers the targetname "egg_shoot1" going from 1 to 3.
Give the models the targetname "shoot_model1" going from 1 to 3.

Now make a script origin and set it to server. Give it this kvp ("easter_egg_sound_location", "targetname").
Title: Re: Sound easter egg !
Post by: M0ul3_G4m3r on October 18, 2016, 03:47:40 pm
Wow thanks !  ;)

Edit: The trigger goes out and the text appears but no music  :'(
Title: Re: Sound easter egg !
Post by: M0ul3_G4m3r on October 19, 2016, 04:44:29 pm
Problem fixed  and solves !  :troll:
Title: Re: Sound easter egg !
Post by: InebriatedGaming on October 20, 2016, 12:43:44 am
What kind of file should it be? Mp3? Also what folder does it need to be located in?
Title: Re: Sound easter egg !
Post by: Megadeth9811 on October 20, 2016, 03:39:26 am
 :-[
What kind of file should it be? Mp3? Also what folder does it need to be located in?

Black Ops 3 uses compressed 48000 .wav 16-Bit PCM.
Title: Re: Sound easter egg !
Post by: InebriatedGaming on October 20, 2016, 05:07:43 am
Do i have to use a seperate program to convert a song to that , and if so would you recommend one? Will it pull that file from my desktop or whatever as long as its included in that one line at the end of the script? Or do i have to put the file in one of the folders thats being called upon at the top of the script?  Sorry i have no idea how any of this works.
Title: Re: Sound easter egg !
Post by: M0ul3_G4m3r on October 20, 2016, 02:28:19 pm
UGX custom sound tutorial here : https://confluence.ugx-mods.com/display/UGXMODS/BO3+%7C+Adding+custom+sounds (https://confluence.ugx-mods.com/display/UGXMODS/BO3+%7C+Adding+custom+sounds)
 ::)
Title: Re: Sound easter egg !
Post by: WoahDude on October 21, 2016, 05:30:14 am
I did everything and it won't play the sound for some reason.
Code Snippet
Plaintext
/*
SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~
SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~ SOUND EASTER EGG ~
*/
function soundEasterEggInit()
{
level.soundEasterEgg = 0;
level.playEasterEgg = 3;
level.playSoundLocation = GetEnt("easter_egg_sound_location", "heyman"); // Create a script origin and set it to server, not client, then give it this targetname

thread shoot1();
thread shoot2();
thread shoot3();
}

function shoot1()
{
shoot_trig1 = GetEnt("egg_shoot1", "targetname");
shoot_trig1 waittill("trigger", player);
shoot_model1 = GetEnt("shoot_model1", "targetname");
shoot_model1 delete();
level.soundEasterEgg++;
thread finishedEasterEgg();
shoot_trig1 delete();
}

function shoot2()
{
shoot_trig2 = GetEnt("egg_shoot2", "targetname");
shoot_trig2 waittill("trigger", player);
shoot_model2 = GetEnt("shoot_model2", "targetname");
shoot_model2 delete();
level.soundEasterEgg++;
thread finishedEasterEgg();
shoot_trig2 delete();
}

function shoot3()
{
shoot_trig3 = GetEnt("egg_shoot3", "targetname");
shoot_trig3 waittill("trigger", player);
shoot_model3 = GetEnt("shoot_model3", "targetname");
shoot_model3 delete();
level.soundEasterEgg++;
thread finishedEasterEgg();
shoot_trig3 delete();
}

function finishedEasterEgg()
{
if(level.soundEasterEgg >= level.playEasterEgg)
{
IPrintLnBold("Elena Siegman - Dead Again");
level.playSoundLocation PlaySound("test_sound"); // Change "sephiroth" to the name of your soundalias.
}
}
and for the script origin I added the KVP exactly, but it just shows the text after I shoot all the triggers. I know it isn't the sound because I get no errors and made sure everything was perfect.
Title: Re: Sound easter egg !
Post by: M0ul3_G4m3r on October 22, 2016, 08:50:16 am
Do you have add sond aliases ?  :o
Title: Re: Sound easter egg !
Post by: Artleck on October 22, 2016, 08:02:18 pm
I've tried this out, I am getting the same issue as WoahDude, I even have it done in my user_aliases.

I originally didn't have test_sound due to me using someone else's user_aliases to help with sound locations. But this is what i put in it.

Spoiler: click to open...
# MUSIC_EE,,,,,,,,,,,,,,,,,,,,
# music,,,music\sabaton\rorkes_drift.wav,,,UIN_MOD,,,,,BUS_MUSIC,,,,,,100,100,,,,,,,,2,oldest,,,1,1,,,,,,2d,,,NONLOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Title: Re: Sound easter egg !
Post by: WoahDude on October 22, 2016, 10:10:02 pm
Yes, and it is the correct format
Title: Re: Sound easter egg !
Post by: M0ul3_G4m3r on October 23, 2016, 08:09:51 am
I've tried this out, I am getting the same issue as WoahDude, I even have it done in my user_aliases.

I originally didn't have test_sound due to me using someone else's user_aliases to help with sound locations. But this is what i put in it.

Spoiler: click to open...
# MUSIC_EE,,,,,,,,,,,,,,,,,,,,
# music,,,music\sabaton\rorkes_drift.wav,,,UIN_MOD,,,,,BUS_MUSIC,,,,,,100,100,,,,,,,,2,oldest,,,1,1,,,,,,2d,,,NONLOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

My aliases is this : (the sound must be in sound_assets)  ;)
Spoiler: click to open...
Code Snippet
Plaintext
musica,,,custom\musica.wav,,,UIN_MOD,,,,,,,,,,,90,90,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

And the script_origin :  ;)
Spoiler: click to open...
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fimage.noelshack.com%2Ffichiers%2F2016%2F42%2F1477210174-script.png&hash=2777fa1e7c496002ea14ec5f71aa90453d0fd8e5)
Title: Re: Sound easter egg !
Post by: shinged on October 23, 2016, 11:42:09 am
I've tried this out, I am getting the same issue as WoahDude, I even have it done in my user_aliases.

I originally didn't have test_sound due to me using someone else's user_aliases to help with sound locations. But this is what i put in it.

Spoiler: click to open...
# MUSIC_EE,,,,,,,,,,,,,,,,,,,,
# music,,,music\sabaton\rorkes_drift.wav,,,UIN_MOD,,,,,BUS_MUSIC,,,,,,100,100,,,,,,,,2,oldest,,,1,1,,,,,,2d,,,NONLOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Try deleting the script origin and putting in a script model and giving it the same kvp
Title: Re: Sound easter egg !
Post by: Artleck on October 23, 2016, 02:37:09 pm
My aliases is this : (the sound must be in sound_assets)  ;)
Spoiler: click to open...
Code Snippet
Plaintext
musica,,,custom\musica.wav,,,UIN_MOD,,,,,,,,,,,90,90,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

And the script_origin :  ;)
Spoiler: click to open...
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fimage.noelshack.com%2Ffichiers%2F2016%2F42%2F1477210174-script.png&hash=2777fa1e7c496002ea14ec5f71aa90453d0fd8e5)

Tried this and also replacing the origin one with model struct, Still nothing is playing, it's all working such as collecting all perk bottles and then nothing will play. it's strange.
Title: Re: Sound easter egg !
Post by: Steve8801 on October 29, 2016, 04:18:03 pm
How do I make a script origin? I have all of my things set in place right with the damage triggers and everything but I have no idea how to make a script origin or to make it a server instead of a client. I have been trying to make it out of a model and it just remains the same. Please help?
Also... I tried to take a song and I have it in the correct wav format but am very confused on how to make sound aliases. I have skype if someone wants to help me out over that or on here if you are willing to type to help me out, it'd be much appreciated :)  :nyan:
Title: Re: Sound easter egg !
Post by: WoahDude on November 05, 2016, 02:14:10 am
Found out another way to add the sound EE https://www.youtube.com/watch?v=lRjxlROYymY (https://www.youtube.com/watch?v=lRjxlROYymY) Hope this helps.