sound help <3

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Xenon
CJ Newbie
CJ Newbie
Posts: 57
Joined: December 29th, 2011, 12:42 am
Gamertag: Xenon iz Dubby

sound help <3

Post by Xenon » April 13th, 2012, 10:57 pm

right basically i have my sound working .... its in the start room you spawn and it plays .. but 2 of the same song play :/ one plays a spilt second after the last :L:L sounds horrible ... and also if i knife the ground the song will start playing were i knife :L:L:L ................... soo annoying theres like 40 of the same song playing all over the map xD

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: sound help <3

Post by waywaaaard » April 19th, 2012, 11:57 am

Post your gsc that starts the sound please
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
- a$ce -
CJ Newbie
CJ Newbie
Posts: 52
Joined: March 18th, 2012, 6:36 pm
Contact:

Re: sound help <3

Post by - a$ce - » April 19th, 2012, 12:47 pm

maybe ostmob can help u

User avatar
O/S/T-M/O/B
CJ Wannabe
CJ Wannabe
Posts: 27
Joined: April 8th, 2012, 5:04 pm

Re: sound help <3

Post by O/S/T-M/O/B » April 19th, 2012, 1:04 pm

Code: Select all

trigger_init()
{
        soundtriggers = getentarray( "sound_trigger", "targetname" );
 
        for( i = 0; i < soundtriggers.size; i++ )
                soundtriggers[i] thread trigger_sound();
}
 
trigger_sound()
{
        soundpos = getent( self.target, "targetname" );
 
        for(;;)
        {
                self waittill( "trigger", user );
 
                if(!isDefined(user.sound) || user.sound != soundpos.script_noteworthy)
                {
                        if(isDefined(user.sound))
                                user stoplocalsound(user.sound);
 
                        user.sound = soundpos.script_noteworthy;
                        user thread play_the_sound(soundpos.script_noteworthy);
                        user thread waitForLeave(self, soundpos.script_noteworthy);
                }
                wait 0.25;
        }
}
 
play_the_sound( sound )
{
        self endon("disconnect");
        self notify("music_change");
        self endon("music_change");
 
        self playlocalsound( sound );
        wait 500;
        self.sound = undefined;
}
killSuspenseMusic()
{
        wait 1;
 
        if(isDefined(game) && isDefined(game["music"]) && isDefined(game["music"]["suspense"]))
                for(i = 0;i < game["music"]["suspense"].size;i++)
                        game["music"]["suspense"][i] = "null";
}
 
waitForLeave(trigger, sound)
{
        if(!isSubStr(sound, "8") && !isSubStr(sound, "7") && !isSubStr(sound, "10"))
                return;
 
        self endon("disconnect");
        while(self isTouching(trigger))
                wait 0.5;
        self stopLocalSound(sound);
        self.sound = undefined;;
}
try this one datheman modificed it for me. normal script starts sound only for user when you hit the trigger. and sound 7 8 and 10 (you can change) worked only when you in the trigger when you leave trigger sound stopped.

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: sound help <3

Post by TrikX » October 26th, 2012, 7:35 pm

so sound 7 8 and 10 are the sound lines in your soundaliases sequence if i am not mistaking!?
i have that same script you gave me, but mine problem is that the sound does not stop playing
when i leave the trigger!
i also tried to make a looping sound and no success!
when it is on nonlooping it works, but when i set it to looping there is no sound! why is that?

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: sound help <3

Post by TrikX » October 27th, 2012, 11:03 am

i have fixed the trigger problem!
my soundaliases sequence number was 1 so i placed 1 instead of 8 and now
when i exit trigger music stops, so that works fine!
but i still cant set looping, please help me with that!
i need looping because when i save position in music room and go outside,
then reload back inside the music does not start again! it starts only if i enter
trough a teleport!

Post Reply

Who is online

Users browsing this forum: No registered users and 39 guests