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 / Sound script

Author
Message
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 7th Mar 2012 22:44
hey all
i have been working on this script

and the sound does not play.
i was wondering what was wrong with this script and how do i fix it

''Make sure your hands are clean before you point the finger''
Ross tra damus
3D Media Maker
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 8th Mar 2012 00:25 Edited at: 8th Mar 2012 01:54
gozzy1999

I'm by no means any good at scripting but you could get rid of the condition 'plrdistwithin=50' in the 'second' state3 line.

I don't know if this will help though?

Have you checked the spelling for the .wav file?

EDIT - I also don't think you need the 'inview' condition in the same line mentioned above.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 8th Mar 2012 00:47 Edited at: 8th Mar 2012 00:48
My suggestions:

1. Instead of using plrsound, trying using MUSIC or SOUND and see if that helps.

2. Check to make sure you've got the correct path and spelling of the .wav file. I'm sure you do, but most of the errors people make boil down to simple fat-fingering the keyboard, so it never hurts to check.

3. The scancodekey event for the return key on the keyboard is 28, but the scancodekey event for the enter key on the numeric pad is 156. Are you pressing the correct key on the keyboard?

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 8th Mar 2012 09:00
i used the add sound file command from fpi editpad, so it shouldent be wrong spelling and i don't know about you but the return key is pretty much the same as the enter key, all it does is the same thing.
yes i am pressing the right key and i will try music or sound thank you

''Make sure your hands are clean before you point the finger''

Attachments

Login to view attachments
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 8th Mar 2012 09:29 Edited at: 8th Mar 2012 09:32
you need to change state after setup a soundcommand, or it wont play. here:

...
:state=3,plrdistwithin=50,scancodekeypressed=28,inview=1:plrsound=audiobank\churchilspeach.wav,state=4

:state=4,etimergreater=10000:fpgcrawtextoff



try if it works now (wrong machine here).

@leon: "sound" is a sound related to the position of the object, "music/musicoverride" is changing backgroundsound, "plrsound" is direct soundinput on playerposition, so doesnt change stereo. all 3 work propperly

gz

The Zombie Killer
13
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 8th Mar 2012 10:47 Edited at: 8th Mar 2012 11:01


Try that one gozzy.

-TZK

Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 8th Mar 2012 14:16
Quote: "i don't know about you but the return key is pretty much the same as the enter key, all it does is the same thing."

Yes they do the same thing. But they have different codekeys, so I'm just just trying to make sure you are pressing the correct key.

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 8th Mar 2012 16:59
Quote: "Yes they do the same thing. But they have different codekeys, so I'm just just trying to make sure you are pressing the correct key.
"

lol thanks i was

''Make sure your hands are clean before you point the finger''
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 8th Mar 2012 17:00 Edited at: 8th Mar 2012 17:12
@The Zombie Killer
tried it doesn't wrok strangley

''Make sure your hands are clean before you point the finger''
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 8th Mar 2012 17:32
There's an issue in TZK's script:



Change that line to remove the extra "1" after the keypressed command:



Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 8th Mar 2012 19:21
omg carn't believe i missed that.
will change right away thanks

''Make sure your hands are clean before you point the finger''
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 8th Mar 2012 19:55
it still doesn't work
this script is annoying the hell out of me

''Make sure your hands are clean before you point the finger''
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 8th Mar 2012 21:37
Looking in the manual and the community guide, I cannot find the command KEYPRESSED. Change that to SCANCODEKEYPRESSED and see if that works. Can't believe I missed that the first time...

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 8th Mar 2012 22:16
awesome will do

''Make sure your hands are clean before you point the finger''
The Zombie Killer
13
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 9th Mar 2012 00:37 Edited at: 9th Mar 2012 00:58
It seems that the problem is elsewhere. Using keypressed like that works perfect for me. keypressed=28 0 would indicate that you're not pressing enter, while 1 means you are.

I'll have a good look at the script and see if I can spot the problem.

EDIT: I almost forgot, you need the latest FPSC to use my version. Aka 1.19 BETA8 with r603 installed over the top.

EDIT2: This script works great for me:


This will play once, then deactivate the radio's usability.

-TZK

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 9th Mar 2012 08:31
i use V1.18 and i don't really want to change is there a possability for me to change parts to fit my version

''Make sure your hands are clean before you point the finger''
The Zombie Killer
13
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 9th Mar 2012 08:37 Edited at: 9th Mar 2012 08:40
@gozzy1999
Updating FPSC basically means, better FPS, more bugfixes etc. And looking at the FPS of your videos, 1.19 would really help. It raised my FPS from 15 on some levels, to 75FPS. Trust me 1.19 is worth it. And I don't know if you could change it to fit 1.18 at the moment. I'll check later for you. Right now I'm updating my FPSC from 1.19 r603 to r605 and uploading the update. So I can't right now, but I will at the nearest convenience.

EDIT: Come to think of it, you could try replacing plrfacing=10 with inview=1, but I still strongly recommend updating to 1.19, since you'll get all the latest scripting additions, and you'll be able to use my third person, player body, CoD emplacement, topdown shooter, drivable helicopter, drivable vehicle scripts etc. So still, 1.19 is REALLY worth the update.

-TZK

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 9th Mar 2012 08:57
i installed it and my fpsc went to the free version and wiulden't change back and i did write my serial and name in userdetails.ini but still hates me

''Make sure your hands are clean before you point the finger''
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 9th Mar 2012 09:13
i have attached the churchil speach could someone place it directly into thier audiobank and test the script,
edited for V1.18 version here:

i have got to go school now i will come back at 3 then i am going to improve my gun pickup script then work on this

''Make sure your hands are clean before you point the finger''

Attachments

Login to view attachments
The Zombie Killer
13
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 9th Mar 2012 09:15
@gozzy1999
Copy the FPSCreator.exe from V118 into your folder, that fixes the v119 serial bug. I worked with Lee to reduce piracy of fpsc in v119, so it only shouldn't work if you pirated FPSC or you are entering your serial wrong. I can attach the V118 FPSCreator.exe for you if you don't have a backup of it. btw, I uploaded r605 here (it's the latest version of FPSC at this time) here

Good luck getting the script to work

-TZK

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 9th Mar 2012 16:28
ok will do that stuff

''Make sure your hands are clean before you point the finger''
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 9th Mar 2012 16:48
ok i have entered a v1.18 into my folder and it still says its a free version and i have definatly entered my serial correct
and i never use pirated things
so i don't know whats wrong with it

''Make sure your hands are clean before you point the finger''
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 9th Mar 2012 19:03
and the script you sid worked for you doesn't seem to work for me so i will just go back to v1.18 for the time being unless someone can help with my fpsc to stop it gong to free

''Make sure your hands are clean before you point the finger''
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 9th Mar 2012 23:33
Quote: "Copy the FPSCreator.exe from V118 into your folder, that fixes the v119 serial bug. I worked with Lee to reduce piracy of fpsc in v119, so it only shouldn't work if you pirated FPSC or you are entering your serial wrong."

So if we update to 119, we still have to do some screwed up thing to get it to recognize our serial code? Why is that? Why has this bug not been fixed?

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
The Zombie Killer
13
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 10th Mar 2012 02:31
@Leon Kennedy and gozzy1999
I don't know, it doesn't really trouble me since I use FPSCreator free. But I think I posted a registry key in another thread for gozzy that you install and then you erase your key from userdetails.ini, and FPSC will ask for the key at startup. If I can find it, you should both try that.
Oh and @gozzy1999
The only benefit of the full version is that you can build a game, so I don't think you need to worry about that right now. It's only a problem if you are developing a game.

-TZK

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 10th Mar 2012 08:37
i have started a short game for my brother but that can wait for a while and it gives me some time to fill in all the nooks and crannies

''Make sure your hands are clean before you point the finger''
The Zombie Killer
13
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 12th Mar 2012 04:24
@gozzy1999
I found the problem: The sound is too long.
It only worked for me earlier because I used a simple gunshot sound. FPSC really needs a better sound system.

-TZK

Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 12th Mar 2012 04:33
@TZK: Any idea what the maximum length for a sound is? Gunshots are relatively short, and I thought that FPSC could handle looping music. Which isn't a big deal, but what is the maximum length for a sound bite in FPSC?

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
The Zombie Killer
13
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 12th Mar 2012 06:19
@Leon Kennedy
I have absolutely no idea. I just know that if a sound is too long, it won't play. Which is kinda saddening, lag also stops sounds from playing as well, but a sound not playing at 60fps? That's just ridiculous.

-TZK

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 12th Mar 2012 06:57
Quote: "i have attached the churchil speach could someone place it directly into thier audiobank and test the script,"


After reading this thread, I took some time to take a look and test. I made an alteration since I am running in v1.17.

Your original:



First off, I altered your original script by removing the "inview".

Second, you have an "etimerstart" in state=2 but had no "etimergreater". Although that should not make a difference, I added an "etimergreater=200" to the state=3 line.

Third, by using the wave file, no sound played with either the "sound" or "plrsound" action. I converted to ogg and tested both the "sound" and "plrsound" and it worked.

Here is my altered version with the changes/alterations:



I attached the script to a dynamic radio. As I approached I saw the "Press ENTER to listen to radio", and when I pressed ENTER, the sound played. It worked for both "sound" and "plrsound".

I had discovered a while back that some sound files we had used in developments that were wave no longer played when they had before. I converted mine to ogg and they played. So when dealing with scripts that play sound such as this one from the OP, if your wave(s) don't play, then try converting to ogg and see if that works. If not, then it will be a script syntax.

As a courtesy, I've attached the sound file in ogg format for the OP.


Twitter: @NFoxMedia

Attachments

Login to view attachments
The Zombie Killer
13
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 12th Mar 2012 07:14
@BlackFox
Thanks for the info, that'll be really useful in the future. I still find it a bit strange how they don't play though. If only FPSC could scan scripts for sounds, and then preload them.

-TZK

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 12th Mar 2012 09:39
thank you so much i was about to give up on this

''Make sure your hands are clean before you point the finger''
The Zombie Killer
13
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 12th Mar 2012 10:05
Yes, BlackFox always seems to come up with a solution to almost every problem a user comes across with FPSC. If only I was that good at finding and fixing problems

-TZK

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 12th Mar 2012 17:22
lol if i were that good at scripting i would release so much free context i'll end up having a nobel prize lol

''Make sure your hands are clean before you point the finger''
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 12th Mar 2012 20:47
i will be making a sound script pack and release the sounds aswell in the next few weeks so get ready for alot of bugs lol

''Make sure your hands are clean before you point the finger''

Login to post a reply

Server time is: 2024-11-24 02:38:17
Your offset time is: 2024-11-24 02:38:17