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 / Script Sound Help

Author
Message
PFTLOGLMSGames
12
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 22nd Aug 2012 01:20
Hey guys, got this script to make the Entity make a sound when the player is closer than 140, the issue is that it just loops the sound a stupid number of times rather than playing it just once, any help would be greatly appreciated!



Thanks!

PleaseForTheLoveOfGodLetMeSleep! Games

The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 22nd Aug 2012 14:57
Try PLRSOUND instead of SOUND.

And I don't understand the DESTROY action in state=2, doesn't that kill the entity?

In case you find my grammar and spelling weird ---> native German speaker ^^
PFTLOGLMSGames
12
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 22nd Aug 2012 16:05
Ah, yeah, I basically only want it to attack the player once, before being dissapearing, cant seem to put the 'destroy' in the right place though :/

Thanks!

PleaseForTheLoveOfGodLetMeSleep! Games

Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 22nd Aug 2012 16:49 Edited at: 22nd Aug 2012 16:52
check those lines :
Quote: ":state=1,plrdistwithin=140:sound=audiobank\user\Scream3.wav,state=2
:state=1,plrdistwithin=90,rateoffire:rotatetoplr,setframe=8,state=2
:state=2,framebeyond=8 60,plrdistwithin=100:plraddhealth=-10,state=3,destroy"


Now when the player gets close in 140 units , The script goes to state=2 which requires framebeyond condition , while you didn't use setframe-x at all , add to that - as ST01 said - you use destroy which would destroy the entity .
So your script should look like this (not tested):

compare the 2 scripts and you should get the trick .

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
PFTLOGLMSGames
12
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 22nd Aug 2012 21:41
Thats awesome, thank you for the help Mr Illusionist,
but I was wondering if there is a way to set it so the sound doesnt
stop when the entity dissapears?

PleaseForTheLoveOfGodLetMeSleep! Games

Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 24th Aug 2012 07:36
Sadly not, the sound is tied to the entities existence.

You could may be try hiding the entity, and only destroy it when the sound has finished.

maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 24th Aug 2012 11:34 Edited at: 24th Aug 2012 11:35
you can trigger a soundzone instead of playing a sound with the entity, so soundzone plays the sample without neccessarity of the entity remain in game.

instead of the line
":state=1,plrdistwithin=140:sound=audiobank\user\Scream3.wav,state=2"

use

":state=1,plrdistwithin=140:settargetname=soundzone1,activatetarget=1,state=2"

then setup a triggerzone named "soundzone1" with a soundscript as main:

:state=0,activated=1:plrsound=audiobank\user\Scream3.wav,state=1
:state=1:none

hope it works, i am out of practice.^^

PFTLOGLMSGames
12
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 26th Aug 2012 00:08
Got it working now, thanks guys!

PleaseForTheLoveOfGodLetMeSleep! Games

Login to post a reply

Server time is: 2024-11-23 23:09:05
Your offset time is: 2024-11-23 23:09:05