Page 1 of 1

sound help <3

Posted: April 13th, 2012, 10:57 pm
by Xenon
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

Re: sound help <3

Posted: April 19th, 2012, 11:57 am
by waywaaaard
Post your gsc that starts the sound please

Re: sound help <3

Posted: April 19th, 2012, 12:47 pm
by - a$ce -
maybe ostmob can help u

Re: sound help <3

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

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.

Re: sound help <3

Posted: October 26th, 2012, 7:35 pm
by TrikX
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?

Re: sound help <3

Posted: October 27th, 2012, 11:03 am
by TrikX
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!