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 can I get a sound to play when destroying, then re-spawning an entity?

Author
Message
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 31st Mar 2012 05:23
I've created an 'Easter Egg' scene for my game, as part of the background story.

What happens is this;

The player lifts an an entity up, carries it to another entity, drops it, and it disappears, then re-appears at the other side of the room. I've successfully created the destroying and spawning script, but I need to make a sound play, when the entity being carried is destroyed.

Here's the script so far, with a 'plrsound' action, which doesn't work (the rest of the script does work), I've also tried the 'sound' action, which doesn't work either;



Can anyone tell me what I'm doing wrong?

maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 31st Mar 2012 10:10
put destroy into the next state. there has to be a running state in between.

hope it helps.

Ross tra damus
3D Media Maker
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 31st Mar 2012 11:03 Edited at: 31st Mar 2012 11:03
bruce3371

I'm no good at scripting but maybe check this to see if it works

bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 31st Mar 2012 15:31 Edited at: 31st Mar 2012 15:33
@Maho, like this? (I need the 'activateifused' to happen last)



@Ross, thanks, I'll try your idea next

bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 31st Mar 2012 15:44
Thanks guys, using both your suggestions, I got it working

I had to seperate the plrsound and destroy actions into different states;



BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 31st Mar 2012 15:50 Edited at: 31st Mar 2012 15:51
@ Maho,

Quote: "put destroy into the next state."


Good catch.

@ Ross,

Quote: "I'm no good at scripting but maybe check this to see if it works"


And you say you are no good at scripting. You were very close- just had a double sound in your script, but you were on the right track.

@ Bruce

Quote: "I had to seperate the plrsound and destroy actions into different states"


It is always good to keep the "sound" on a separate state from the "destroy". We too had encountered this issue, and by using your method, that seems to work every time.


Twitter: @NFoxMedia
Ross tra damus
3D Media Maker
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 31st Mar 2012 15:51 Edited at: 31st Mar 2012 15:53
bruce3371

Glad you got it working.
Sorry about my script idea because I thought you wanted another (2x sound FX) to play in the process of the script.

All the best of luck

EDIT - Cheers BlackFox
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 31st Mar 2012 16:00
Quote: "It is always good to keep the "sound" on a separate state from the "destroy"."


I'm enjoying the learning experience. For every mistake I make, I learn something new

Quote: "Sorry about my script idea because I thought you wanted another"


No worries, your idea helped anyway

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 2nd Apr 2012 00:17
Quote: " For every mistake I make, I learn something new"


Me too. Like how Ross says he is no good at scripting, but I think he does very well.


Twitter: @NFoxMedia
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 2nd Apr 2012 02:31
3 tips I'd give to anyone learning scripting;

1, Learn from your mistakes

2, Take a look at other people's scripts, to see how they're written

3, If all else fails, pick BlackFox's brain lol

Login to post a reply

Server time is: 2024-11-24 02:50:22
Your offset time is: 2024-11-24 02:50:22