Verruckt Style song easter egg

broken avatar :(
Created 579 days ago
by klevi
0 Members and 1 Guest are viewing this topic.
799 views
broken avatar :(
×
broken avatar :(
Location: alDurrës
Date Registered: 6 June 2017
Last active: 11 days ago
Posts
166
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Groups
More
My Contact & Social Links
More
Signature
i am the issue
×
klevi's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
1. Go in radiant and place  a trigger/use , select it, press N and give it the following KVP
key:targetname
value:toilet_trig
Done with radiant.

2. Get two sounds, the first sound for the toilet flush sound, and the second sound for the actual song you want to play for your
easter egg. After you convert them in Audacity(or whatever you use to convert your sounds), and after you have included them in your mapname
(literally when you've finished adding your sounds) open your
CoD WaW Root/mods/ YOUR MAP NAME/maps/ YOUR MAP NAME.gsc

3. Go to the bottom of that file, copy the code below and paste it
Code: cpp
toilet_flush()
{
trig = GetEnt( "toilet_trig","targetname" );

num = 0;

trig SetHintString( "" );
trig SetCursorHint( "HINT_NOICON" );
trig UseTriggerRequireLookAt(  );

while( true )
{
players = get_players(  );
trig  waittill( "trigger", players );
PlaySoundAtPosition( "toilet_flush", trig.origin);
num = num + 1;
trig disable_trigger(  );
wait 4;
trig enable_trigger(  );
if( num == 3) 
{
players PlaySound( "cha_ching" );
trig Delete(  );
players PlaySound( "verruckt_sound" );
}
}
}

/*
trig SetHintString( "" );  you can put a Hint String inside the brackets if you want EX: Press and old &&1 to press the toilet button

trig SetCursorHint( "HINT_NOICON" );  you can remove this line and the default HAND ICON will appear when you're near the trigger

PlaySoundAtPosition( "toilet_flush", trig.origin); change the toilet_flush to the name of your flush sound alias

wait 4; put the length of your flush sound here

if( num == 3)  change the 3 to the number of how many times you want the player to press the trigger in order to play the sound

players PlaySound( "verruckt_sound" ); change the verruckt_sound to the name of the soundalias of the song you want to play
*/
4. Then scroll up until you find FUNCTION CALLS PRE-LOAD and paste this line underneath
thread toilet_flush();
5. Save the file, build your mod, compile the map and DONE. Go in game and check if it worked.
NOTE: It doesn't mean that it has to be a trigger/use, it could be a trigger damage instead, but since in verruckt it is a trigger use
i did the same for the sake of this tutorial. No need for any credit anyway.
 Well, that's it, worked fine for me, should do the same with you.
How to add custom sounds on your map ----> [You are not allowed to view external links. Register or Login to see them]
Last Edit: November 12, 2019, 11:16:26 am by klevi
broken avatar :(
×
broken avatar :(
Location: usunknown
Date Registered: 27 December 2016
Last active: 9 days ago
Posts
86
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
cristian_morales's Contact & Social Linkscristian_m
nice
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 2 days ago
Posts
488
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Hellowa!
Signature
My published cod maps:

Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks (Beta): https://www.ugx-mods.com/forum/mods/7/black-ops-perks/18611/
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
This looks like a great tutorial but I have a few questions about this.
  • This while loop is infinite waiting for you to press the trigger. Maybe you want to end the loop after the task is done?
  • Num = num + 1 is also num++
  • From my experience "PlaySound" is a person function. So I think you have to do this in a forloop? players PlaySound("your sound");
  • Players = get_Players() is not necessary inside the while loop. The player count is not going to change.
  • The easteregg songs are not called with the function "PlaySound" but it does the trick. Now you are still able to hear the round sounds and other stuff.
Last Edit: November 15, 2019, 10:15:00 am by gympie6
broken avatar :(
×
broken avatar :(
Location: alDurrës
Date Registered: 6 June 2017
Last active: 11 days ago
Posts
166
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Groups
More
My Contact & Social Links
More
×
klevi's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
This looks like a great tutorial but I have a few questions about this.
  • This while loop is infinite waiting for you to press the trigger. Maybe you want to end the loop after the task is done?
  • Num = num + 1 is also num++
  • From my experience "PlaySound" is a person function. So I think you have to do this in a forloop? players PlaySound("your sound");
  • Players = get_Players() is not necessary inside the while loop. The player count is not going to change.
  • The easteregg songs are not called with the function "PlaySound" but it does the trick. Now you are still able to hear the round sounds and other stuff.
Code: cpp
toilet_flush()
{

trig = GetEnt( "toilet_trig","targetname" );

num = 0;

trig SetHintString( "" );
trig SetCursorHint( "HINT_NOICON" );
trig UseTriggerRequireLookAt(  );

for(;;)
{
trig  waittill( "trigger", player );
PlaySoundAtPosition( "toilet_flush", trig.origin);
num = num + 1;
trig disable_trigger(  );
wait 4;
trig enable_trigger(  );
if( num == 3)
{
player PlaySound( "cha_ching" );
trig Delete(  );
player PlaySound( "verruckt_sound" );
break;
}
}
}
num = num + 1;  looks cooler imo  :p 
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 2 days ago
Posts
488
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Hellowa!
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
Code: cpp
toilet_flush()
{

trig = GetEnt( "toilet_trig","targetname" );

num = 0;

trig SetHintString( "" );
trig SetCursorHint( "HINT_NOICON" );
trig UseTriggerRequireLookAt(  );

for(;;)
{
trig  waittill( "trigger", player );
PlaySoundAtPosition( "toilet_flush", trig.origin);
num = num + 1;
trig disable_trigger(  );
wait 4;
trig enable_trigger(  );
if( num == 3)
{
player PlaySound( "cha_ching" );
trig Delete(  );
player PlaySound( "verruckt_sound" );
break;
}
}
}
num = num + 1;  looks cooler imo  :p
toilet_flush()
{
    trig = GetEnt( "toilet_trig","targetname" );

    num = 0;

    trig SetHintString( "" );
    trig SetCursorHint( "HINT_NOICON" );
    trig UseTriggerRequireLookAt();

    while (true)
    {
        trig waittill( "trigger", player );
        trig disable_trigger();
        PlaySoundAtPosition( "toilet_flush", trig.origin );

        num = num + 1;
        wait 4;

        trig enable_trigger();

        // This goes true for one time
        if ( num == 3)
        {
            player PlaySound( "cha_ching" );
            trig Delete();
            players = get_players();
            for (i = 0; i == players.size; i++)
            {
               players[i] PlaySound( "verruckt_sound" );
            }
            return;
        }
    }
}
Almost :)
Last Edit: November 14, 2019, 01:49:15 pm by gympie6
broken avatar :(
×
broken avatar :(
Location: alDurrës
Date Registered: 6 June 2017
Last active: 11 days ago
Posts
166
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Groups
More
My Contact & Social Links
More
×
klevi's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
toilet_flush()
{
    trig = GetEnt( "toilet_trig","targetname" );

    num = 0;

    trig SetHintString( "" );
    trig SetCursorHint( "HINT_NOICON" );
    trig UseTriggerRequireLookAt();

    while (true)
    {
        trig waittill( "trigger", player );
        trig disable_trigger();
        PlaySoundAtPosition( "toilet_flush", trig.origin );

        num = num + 1;
        wait 4;

        trig enable_trigger();

        // This goes true for one time
        if ( num == 3)
        {
            player PlaySound( "cha_ching" );
            trig Delete();
            players = get_players();
            for (i = 0; i == players.size; i++)
            {
               players[i] PlaySound( "verruckt_sound" );
            }
            return;
        }
    }
}
Almost :)
 Well, yeah, you're way more experienced then me anyway XD, but thanks anyways, it has a ton of different ways to script same thing at all :p , but they worked fine when i tested them!

 

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
Loading ...