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 / Playing Sound Once

Author
Message
Siphon_Studios
11
Years of Service
User Offline
Joined: 20th Jan 2013
Location: @ the Mr. Coffee
Posted: 6th Feb 2013 03:07
Hey guys, I'm trying to get some sound to play once. But the thing is, I have about 13 different sounds that need to play at different locations at different times. Each sound should be triggered by a Trigger zone, correct?

This is my script, and I don't know why the audio isnt playing. Any help or ideas on why?



The routing to locate the audio is correct. The sound SHOULD play.

Any help or tips would be much appreciated!

When the darkness falls...
... we arise
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Feb 2013 03:59
I don't know whats going on here:
\Floor 10_ Eli Fobes_ EDITED/0. a flashlight.wav,etimerstart

If the first part is a folder your using a forward slash When it should be a backslash. Don't use spaces in a file name, it might work but its not good practice.

Your script, should you put the wav into the 'forgotton' folder should look like this.

:state=0,plrwithinzone=1:state=1,sound=audiobank\music\Forgotton\aflashlight.wav,etimerstart
:state=1,etimergreater=10000:destroy

I don't trip over...I do random gravity checks.
Siphon_Studios
11
Years of Service
User Offline
Joined: 20th Jan 2013
Location: @ the Mr. Coffee
Posted: 6th Feb 2013 04:03 Edited at: 6th Feb 2013 04:15
Ahhh ok. I see. Ill see if this works.

Just some carelessness on my part. Thanks for the feedback @rolfy

**EDIT**

Nope, didnt work. This is the script as it is now.



I changed the filename to aflashlight, as to match the script. I also moved the destination of the audio from "Files\audiobank\music\Forgotton\Floor 10_ Eli Fobes_ EDITED" to "Files\audiobank\music\Forgotton"

The audio wont play, thats the problem. I need it to become "destroyed" so the audio doesnt play if you walk into the zone again.

When the darkness falls...
... we arise
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Feb 2013 04:21 Edited at: 6th Feb 2013 04:22
Try a stock sound first to check its not the wav thats causing the error.
Put into the folder you intend to use.

I don't trip over...I do random gravity checks.
Siphon_Studios
11
Years of Service
User Offline
Joined: 20th Jan 2013
Location: @ the Mr. Coffee
Posted: 6th Feb 2013 04:24 Edited at: 6th Feb 2013 04:37
It isnt. I tried it on another sound and that didnt work either.

I may have fixed it though, not sure yet...

**EDIT**

Ya know what? It is the .wav file for some reason. Why wouldnt it play the .wav when it plays other sounds????

This script will play its audio and destroy itself while its playing:


But this one doesnt play:


What is wrong????

When the darkness falls...
... we arise
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Feb 2013 04:32 Edited at: 6th Feb 2013 04:44
Null.

I don't trip over...I do random gravity checks.
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Feb 2013 04:40 Edited at: 6th Feb 2013 04:46
In your second script you reference the audiobank twice inside the music folder

Take your time bro'

I don't trip over...I do random gravity checks.
Siphon_Studios
11
Years of Service
User Offline
Joined: 20th Jan 2013
Location: @ the Mr. Coffee
Posted: 6th Feb 2013 04:45
I tried that one and mine. All my others with different files and file locations. No audio would play. I'm gonna assume that its an issue with the .wav itself.

When the darkness falls...
... we arise
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Feb 2013 04:48 Edited at: 6th Feb 2013 04:51
did you notice what I said above?
If your wav plays fine in any audio player try converting to .ogg.

First though bakup a working file you already know your script is triggering and rename your wav to this, if the file plays fine then you may be missing a small naming error.

I don't trip over...I do random gravity checks.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 6th Feb 2013 04:49 Edited at: 6th Feb 2013 04:52
If this script you posted...



... plays audio, and you swap the file for another and it will not play, then it is the audio file.

A good practice when solving script/audio issues is to swap the audio path and file name for one that you know works. If the sound plays when suppose to, the script is good. If not, the script has an issue. Once you know the script is good, it becomes a template to test other sounds.

Make sure the audio track has two channels (stereo) which might be the problem. If that is not the problem, then Rolfy is correct- convert the sound to *ogg.


There's no problem that can't be solved without applying a little scripting.
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Feb 2013 04:54 Edited at: 6th Feb 2013 04:56
As far as I know 8-16bit 22-44.1Kh stereo or mono should play just fine.

But yeah converting to ogg usually solves things.

I don't trip over...I do random gravity checks.
Siphon_Studios
11
Years of Service
User Offline
Joined: 20th Jan 2013
Location: @ the Mr. Coffee
Posted: 6th Feb 2013 04:59
The audio bank twice works fine for another audio script used for an entity (it's an attack sound).

But the audio was switched with other audio and I also tried selecting audio from a different folder. None worked. I went back through the script and everything between the two scripts is the same accept for the audio routing.

I have no idea why it's not working. The bit depth is 16 and it is about 22 Kh. It SHOULD work.

When the darkness falls...
... we arise
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Feb 2013 05:05 Edited at: 6th Feb 2013 05:11
This script works right?


Put your file into that folder and change the file name in the script, if it doesn't work then convert to ogg and try the same again. Keep it simple

Here's how I do this, I right click a file and select rename, I copy it, dont change it, then I paste the name into whatever script so I dont make any typos and it goes faster too. Same with file paths, this means ya dont make mistakes.

I don't trip over...I do random gravity checks.
Siphon_Studios
11
Years of Service
User Offline
Joined: 20th Jan 2013
Location: @ the Mr. Coffee
Posted: 6th Feb 2013 05:57
Cool, thanks! And how do I convert it to .ogg? iTunes doesn't do it and I don't think Prism Converter does either.

When the darkness falls...
... we arise
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 6th Feb 2013 07:42 Edited at: 6th Feb 2013 07:42
Siphon_Studios
11
Years of Service
User Offline
Joined: 20th Jan 2013
Location: @ the Mr. Coffee
Posted: 7th Feb 2013 04:06
Thanks rolfy. I figured out that Audacity 1.3 (beta) also converts to .ogg so ill use that instead.

As for the sound file, I noticed that the one that worked has a kbps of 1411 and the one that doesn't work has a kbps of 3072. Would this affect the playback at all?

When the darkness falls...
... we arise
Siphon_Studios
11
Years of Service
User Offline
Joined: 20th Jan 2013
Location: @ the Mr. Coffee
Posted: 7th Feb 2013 04:26 Edited at: 7th Feb 2013 04:27
I GOT IT TO WORK!!! I dont know if it was because the kbps was too high or the file size was too much, either way, it works now that i converted it to .ogg.

Thanks rolfy for your help getting me here!

**EDIT**

To anyone else who is lurking about this post wondering how to do the same thing, this is how i did it. http://forum.thegamecreators.com/?m=forum_view&t=203444&b=24

When the darkness falls...
... we arise

Login to post a reply

Server time is: 2024-11-23 16:59:57
Your offset time is: 2024-11-23 16:59:57