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 / How do I make sounds play completely random?

Author
Message
Deine Mutter
9
Years of Service
User Offline
Joined: 13th Jan 2015
Location:
Posted: 1st Dec 2015 16:31
Hey. I'm making a Horror game, is there a way to make sounds appear completely random?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 4th Dec 2015 03:57
Deine Mutter
Quote: "make sounds appear completely random"

Yes, it's very easy. Are you familiar with the "random" command?
Look in the syntax list, just used the "random" command and list a bunch
of .wav files. Throw an etimer in with it and your good to go.

My games never have bugs. They just develop random features..
Lots and lots of random features...
Deine Mutter
9
Years of Service
User Offline
Joined: 13th Jan 2015
Location:
Posted: 4th Dec 2015 18:58
I'm familiar with almost no command
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 10th Dec 2015 02:05
Deine Mutter
Did you figure it out, are you still stuck?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Deine Mutter
9
Years of Service
User Offline
Joined: 13th Jan 2015
Location:
Posted: 14th Dec 2015 19:13
I'm still stuck.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 16th Dec 2015 11:13
HI Deine Mutter
Here's a simple one I threw together. Tested and it works ok.


I used a random timer and random sound to play. You may want to adjust or add to the timer
and sound files. Don't forget to add your own sounds files.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Deine Mutter
9
Years of Service
User Offline
Joined: 13th Jan 2015
Location:
Posted: 19th Dec 2015 18:26
It doesn't seem to work. Here's my edited Version: (I already tried putting ".wav" to the end of the Sound datas, but it still doesnt work)


ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 19th Dec 2015 20:28 Edited at: 19th Dec 2015 20:30
Deine Mutter
Did you add it to a trigger and placed it in your level? And yes, you need to add the extension to each file if it's a .wav file
like this...


It will work if done properly. Double check everything. Are the sound file paths
correct? They are .wav files and not .ogg right?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Deine Mutter
9
Years of Service
User Offline
Joined: 13th Jan 2015
Location:
Posted: 20th Dec 2015 13:50
Still doesnt work.

File paths are correct.
They are .wav files.

I dont know what to do
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th Dec 2015 16:22
Deine Mutter
I just noticed something I didn't catch before. You changed the "random" command to chronological order.

Sorry I did not catch that before, ( I copied and pasted what you had) but it needs to the same an in the first script I posted.
The "random" command " Is true when a random number between 0 and X equals 0. I.e.
random=1 gives a 50% chance of being true, whereas random=100 gives a 1%
chance of being true"
You need to keep the random the same numbers. You have 5 choices, so a random of 5
for each gives them a 20% chance each of playing. Like this.

If you have say 3 choices you would use something like this..

That would give each 33% chance. Get it. Change your script and try it again.
Don't forget to run your cleaner between script changes.
best




My games never have bugs. They just develop random features..
Lots and lots of random features...
Deine Mutter
9
Years of Service
User Offline
Joined: 13th Jan 2015
Location:
Posted: 20th Dec 2015 17:14
Still doesnt work.
Full script here again: (changed as you said)

ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th Dec 2015 18:46
Deine Mutter
Just tried it again and it works perfectly for me. (using my sound files of course)
It should work for you also. I would really look into the sound files your using.
I know you said they are .wav files, but do you have a program to double check these files?
Can you play these files with Win media player or something else? I would look into
these, they are most likely the problem here...
best
My games never have bugs. They just develop random features..
Lots and lots of random features...
Deine Mutter
9
Years of Service
User Offline
Joined: 13th Jan 2015
Location:
Posted: 22nd Dec 2015 18:33
Audacity and Win Media Player Play really loud sounds. No Problem with the sounds.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 23rd Dec 2015 15:19
Deine Mutter
Try this test map. I attach a simple stock map with script and sound files.
I tested and it works fine for me. Run the map and see if it works for you also.
Remember you might have to wait for 25 sec's before the first sound plays?
My games never have bugs. They just develop random features..
Lots and lots of random features...

Attachments

Login to view attachments
Deine Mutter
9
Years of Service
User Offline
Joined: 13th Jan 2015
Location:
Posted: 30th Dec 2015 14:35
This seems to work!

Login to post a reply

Server time is: 2024-03-29 11:32:08
Your offset time is: 2024-03-29 11:32:08