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 / simple sound and music script dont work (Cant turn music/sound off)

Author
Message
Mr Love
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 14th Aug 2017 17:05 Edited at: 14th Aug 2017 17:06
As I wrote, I cant turn music or sound off with a "wall-switch" the sound I am using is an alarm that shourld be turned off by the alarm-switch I made a pretty easy script, dont know what Im doing wrong?? (I have tried both sound and music but no sucess)

Switch script:


And This is My script:

Can someone help?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 14th Aug 2017 22:49 Edited at: 14th Aug 2017 22:49
Mr Love The "music" & "sound" are two different things. With trigger or sound zones you should use the command "sound=$0"
Your script is doing what it is suppose to do. Once "activated" (state=2) it does a music "over-ride" and then the script is destroyed.
It appears your using a "triggerzone"? So try this with the trigger...add your "sound" in $0 slot, player enters zone, alarm sound loops, player leaves
zone goes to switch, hits switch to kill alarm.

Remember to give unique name & place name of zone in switch's "Ifused" field.
This should work
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 15th Aug 2017 06:17
LOL! I know that music and sound are two different thingys. I just tried both, and I did have the alarmsound in slot $0, and I did have the right name of the Triggerzone in the switch "ifused" field. So why isnt it working???
Ok, I will try Your script and see If it works......
Mr Love
18
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 15th Aug 2017 06:31
Yes, it worked fine! Courld You also do it more advanced by letting the player turn the alarm back on If the player so wish?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 16th Aug 2017 21:45 Edited at: 17th Aug 2017 12:55
Mr Love
Quote: " letting the player turn the alarm back on If the player so wish"

Yes, very easy. First, use the stock "switch2.fpi" for the switch, NOT the "switch2key.fpi (If you don't have it let me know, you should though)
Then use this for the "alarm" trigger...

Setup just like the last triggerzone..., I tested, and works good
Player can stop then start alarm again from switch.

Edit: I just noticed this can be trimmed down a bit...?

I think that should work a little better?
My games never have bugs. They just develop random features..
Lots and lots of random features...

Login to post a reply

Server time is: 2024-04-19 20:46:52
Your offset time is: 2024-04-19 20:46:52