Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Help to tune down the "music-alarm"

Author
Message
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 13th Jun 2017 09:09 Edited at: 13th Jun 2017 09:11
I do trigger a music-alarm when turn off a button. When I leave to the next room I want to tune down the musicvolume but My script dosnt work. Whats wrong???

:state=0,plrwithinzone=1:state=1,music=$0,musicvolume=40,state=2
:state=2,plrwithinzone=0:music=0,state=0

Just saw that the :state=1 is missing in the script...
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 14th Jun 2017 00:01
Mr Love Did you get it to work?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 14th Jun 2017 08:15
No. Is there any way to rewrite the script, do You think?
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 14th Jun 2017 11:37
Mr Love Yes, there are several ways to write this. This one will work the way you have it above...
+ Code Snippet
This only works while in the triggerzone.
Note, sometimes when you already have "music" playing in the background, you have to use
the "musicoverride=x" command (sometimes) to stop what is playing and start a new one.( it's a trial and error thing)
Quote: "When I leave to the next room I want to tune down the musicvolume "

Now if you want the "music" to fade as you leave a room, use this script and it will fade music away.
You will have to adjust the " segment distance" to meet your needs..
+ Code Snippet



I was thinking, since it is an "alarm" sound, why not use the "sound=x or loopsound=x" commands?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 14th Jun 2017 13:29
Nothing works! I cant even turn off the music. Here is the switch-script, maybe You can see something in it...

+ Code Snippet
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 15th Jun 2017 01:11
Mr Love
Quote: "I cant even turn off the music"

Ok, I take it your already playing a background music in your level somewhere, correct?
Then you should use the "musicoverride" command.
As for your script, note that a player distance for "30" is just not possible. Try 60 or 50?
anything less than say "plrdistwwithin=45" is just to close to an entity to work.
I tested your script with a distance of 50 and it worked perfectly (the music starting playing )
Also note that .wav files seem to work the best
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 15th Jun 2017 15:44 Edited at: 15th Jun 2017 17:10
Quote: "Ok, I take it your already playing a background music in your level somewhere, correct?"

Yea, the background sound is "music"...
Quote: "I tested your script with a distance of 50 and it worked perfectly (the music starting playing )"

Well the music is the alarm that start when I turn the button, everything works fine so far.
BUT I JUST CANT TURN THE ALARM (MUSIC) OFF!? HAVE USED OVERRIDE, DIDNT WORK..
I have just found out that I have exact the same problem to turn off soundloops as well.
Courld You help Me to write an override script???
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 15th Jun 2017 20:02
Mr Love
This is what I have that works with an "animated" switch ( not alternate texture switch )
that I assume your using based on your code from above ??? If it's not animated let me know.
+ Code Snippet
Place your "music" in slot $0 and leave slot $1 empty.
This worked for me when I already had a background music playing.
And if you don't want to change your background music and just play a sound file, use this..
+ Code Snippet
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 16th Jun 2017 20:47
I cant belive that it wourld work with Your script and not mine??? The only diffrence in the script was that I put musicoverride=$0 before activateifused=1, so why didnt My script work?
Anyways Im glad that everything works fine now, thank You for Your help. You really deserve Your new badge. Because You help Everybody....

Login to post a reply

Server time is: 2017-09-19 16:08:55
Your offset time is: 2017-09-19 16:08:55