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 / Play a sound when enemy is spotted/killed. For some reason the script is getting lost in the stalactites of my mind.

Author
Message
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 25th Apr 2012 06:28
As the title states and before you give me the search function lecture. These are the searches I tried before posting.

Play sound when entity is killed
Play sound
destroy
destroy sound
sound
sound in death
sound of death
for the death of me I can't find the answer.

what Id like to do is play a wav file when the player see's the target, and play a sound when he dispatches the enemy.

I am wondering, if I could use a trigger zone attach a script to it.

I am currently using the 341 mp and just want to edit the destroy leave corpse script if possible.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 25th Apr 2012 06:32
Hmmm? At least you have stalactites. I don't think I have any of those.

If you have tried your own scripting, what did you come up with. Some of us like to see at least a try.

I welcome any criticism you have that doesn't effect me. I used to think I was indecisive, but now I'm not so sure.

~I'm the Terry of the Flatlands.
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 25th Apr 2012 07:07
Well I have tried scripting, with some success, in fact since posting I have figured out how to get the sound file I want to play upon the death of the unfortunate enemy. As I said I have had some success with scripting. However thats when the stalactites get in the way. I can read a script and have a pretty good idea of what it's telling the engine to do. And I can com p with an idea in my head and the steps the engine wil have to take to make it happen. Thats where I find myseld wading in a sea of random conditions and actions, states and varibles.

I have tried this script in the main of a trigger,with no success
:state=0,plrwithinzone=1,plrcanbeseen=1:plrsound=audiobank\341\a8.wav
:state=0,plrwithinzone=0,plrcanbeseen=1:plrsound=audiobank\341\a8.wav
:state=0,plrwithinzone=1,plrcanbeseen=0:state=1
:state=0,plrwithinzone=0,plrcanbeseen=0:state=1
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 25th Apr 2012 10:00
Ok so I have as I said I got the right file to play upon the badguy's timely death however I tried tweeking it so there was a few second delay before the file was played. I am using a basic destroy script

[/:state=0:plrsound=$0
:state=1:state=2,destroy,plrsound=audiobank\341\a12.wavcode]

This is how I tweaked it but it doesn't work, why?

[:state=0:plrsound=$0
:state=1:state=2,destroy,timerstart
State=2,timergreater=5000:plrsound=audiobank\314\a12.wavcode]

I have messed around a bit with a menu when a key is pushed script that is triggered from a zone to see if I could use the inview=1 condition to get the enemy sighted file to play with no success.
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 25th Apr 2012 10:23 Edited at: 25th Apr 2012 10:24
you have to change state after a sound is played, if not it would not work. also you missed a ":" at the beginning of the state=2. and i never heard of "wavecode", use .ogg to reduce filesize (audacity is free and can do ogg-files, very good prog). some wave-definitions are not working in fpsc, maybe its the codec (22.400khz for example. 44khz works, also 48khz)

[:state=0:plrsound=$0
:state=1:state=2,timerstart
:state=2,timergreater=5000:plrsound=audiobank\314\a12.wav,state=3
:state=3:destroy]

Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 26th Apr 2012 03:50
Thanks Maho once again. Still trying to get the enemy sighted to work. I actually layed awake last night trying to figure it out in my head. It's bad enough when your job, bills,family keep you up at night, but when the thing you do to get away from all of that keeps you up. Doesn't bode well for the ole sanity.

Login to post a reply

Server time is: 2024-11-23 23:18:52
Your offset time is: 2024-11-23 23:18:52