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 / Have Music in Game

Author
Message
Molten Ice
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 16th Feb 2008 17:04
Q: How do you get a sound zone to play music from when the player steps into the zone?
A: Well, you could either make a soundloopinzone and make the sound zone really huge, or you can put a trigger zone instead of a sound zone. Make the trigger zone activate an entity outside of the level. Make sure that the entity has a 'no' under spawn at start then put its main script has repeatsound, then go to its sound0, and put that as the sound you want to play. Here’s how to use a trigger zone:
1. Go to the entitybank in FPSC and pull out the blue generator thing (this could be any entity).
2. Place the generator outside of the 2 rooms.
3. Under the generator settings, set the 'spawn at start' to no, and at the very bottom, 'sound0' to whatever you want your music to be.
4. In the trigger zone's settings, change the 'ifused' field to the name of the generator.
5. Under the trigger zones main script, select plrinzoneactivateused.fpi
6. Test the game and see what happens.

Ring a bell?

Got this off the hints and tips PDF. Though the problem is IT DUZNT WORK!

I have a .wav file and did EXACTLY as said but the file duznt play!! has anyone tested if this works? Does anyone have a better solution (plz dont say put a sound zone everywhere as I want the player to walk to the trigger zone and start playing a .wav file ONCE no matter wherever the player goes or dies...)

I found this article doing a search for 'add music' and found this: http://forum.thegamecreators.com/?m=forum_view&t=95129&b=24

It's quite useless though.

Any help appreciated. I'm sure this has been posted before but I haven't found it!

Thanks in advance!
Pride
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Eastern USA
Posted: 16th Feb 2008 17:10 Edited at: 16th Feb 2008 17:10
Hm...well, to make a default music loop (without going anywhere, just when the game starts, music starts playing) on the main toolbar, click "File" then find "Build Game". Then click on the "Level Settings" tab. Find the "Global Script" thing and press "Edit". Then, the VERY FIRST option there is the music! Woo... Hope I helped.

VERY IMPORTANT: The music you have ABSOLUTELY MUST be in the audiobank!!! If not, the music WILL NOT operate correctly. Also, you may need to change the .wav to .ogg, because FPSC recognized .ogg's better, I've not tried .wav's, so I don't know. A great sound editig program is Audacity. It can even convert .wav's to .ogg's. Google It.

"When all of hell breaks loose, I will be laughing at the people believing a god will save them."
Molten Ice
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 16th Feb 2008 18:37
Quote: "(plz dont say put a sound zone everywhere as I want the player to walk to the trigger zone and start playing a .wav file ONCE no matter wherever the player goes or dies...)
"


This is why i wanted to use this tutorial.... dont want it to go on loop and dont want it to play from the start of the game! I want it to play ONCE when the user reaches or goes through the trigger zone.

i'll change it to ogg.... thanks for that.

Please tell me if this tutorial shown above works or if there is a better solution. Awaiting your reply! Thanks!
Pride
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Eastern USA
Posted: 16th Feb 2008 21:22
Oh! Then use a sound zone! Sounds zones play a sound ONCE, even if you walk over it again, it won't play. But you do need .ogg's for soundzones.

Free blood...Here and Here.
Molten Ice
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 17th Feb 2008 13:36
U sure?? I thot sound zones played only when u were IN ZONE! What script should I use for it?

I'll use .ogg as i believe it is smaller in size too....

lol instaed of posting this message i cud have tried the above 2 things already but I aint at home so.... thot i'll post it incase wen i get home it duznt work...
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 18th Feb 2008 14:53
Quote: "U sure?? I thot sound zones played only when u were IN ZONE! What script should I use for it?"


You need the script MUSICINZONE.fpi to play the music/sound only when in a zone.

Login to post a reply

Server time is: 2024-11-24 06:31:36
Your offset time is: 2024-11-24 06:31:36