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
/* 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
Code Snippet
Plaintext
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 ----> https://www.youtube.com/watch?v=wVmWFarXQpk
Last Edit: November 12, 2019, 11:16:26 am by klevi
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
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.
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
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!