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 / Loop sound destroy

Author
Message
Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 6th Oct 2009 18:17
Hi there.

I've been trying to get this to work for ages but no dice - I can't figure out what is wrong.

I have a scenerio in which I want to loop a sound activated via a trigger zone which then stops after I hit a switch.

Currently, I have this script attached to a dynamic entity which spawns when I enter the trigger zone. In theory the sound should start and then stop when the entity is destroyed. However, while the entity spawns, there is no sound.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 7th Oct 2009 00:48
*cough*missingasecondcolononthefirstline*cough*


The one and only,


Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 8th Oct 2009 13:20
Thank you! ;D
Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 9th Oct 2009 18:02
Sorry, one last scripting woe.

The switch now cuts the sound and works as it should. I also want the switch to open 2 doors that have this script I picked up off the forum a while back.



Basically, player moves to the open doors, hits a trigger, doors shut, sound loops. Player presses a switch which stops the sound and reopens the doors. This works to the point where the doors have to be opened again. The switch does nothing to them. I'm confused because I am pretty sure I had this working a while ago. Any ideas?
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 9th Oct 2009 23:48
Add a "activated=0" condition to state 0.

Add a "state=0" action to the last line of the script.


Basically, your script was not looping back to the "open the door" part of the script.


The one and only,


Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 10th Oct 2009 23:54
Like this?



Still doesn't work.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 11th Oct 2009 00:25
Make sure your switch is activating the door with a value of "0" when the door should be opened.


The one and only,


Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 11th Oct 2009 22:36
Ok, some interesting things have happened.

This script



With this on the switch:



Now works the door properly. BUT now the sound that the entity activates does not stop when I hit the switch. I have to hit it and then hit it again into the "off" position (the starting position) to stop the music. What can I do to remedy this?

This is the sound script.



I've tried changed "Activated=1" to "0" but as expected the sound does not play.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 13th Oct 2009 09:32
You need to set a standard for what the script activation values should be accepting.

Right now, you're trying to have one script work with an activation value of 0, and another script work with an activation value of 1... but your switch ONLY sends an activation value of 0.

The logical solution here is to make your sound break script work with an activation value of 0. But, like you said, the sound simply won't play... well, it will if you have your state 0 line activate itself with a value of 1 via the "activate" command, and then in the state 1 line have it wait for an activation value of 0.


The one and only,


Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 29th Oct 2009 21:05 Edited at: 29th Oct 2009 21:06
Hello again! Thanks for all your help. I've been away for a while and just read this. I have altered the script and this is what I now have:


Doing this like you suggested (unless i've done it wrong) results in absolutely nothing happening:




Changing it to the following plays the sound, but the switch does not turn it off.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th Oct 2009 11:43
"activate" is an action and not a condition. You were correct to use "activated" for the consition, however my previous suggestion was to change the value you're checking for. You need to be consistent with what values are being tossed around. By looking at what values are being given between your entities, you should be able to find a value that satisfies all of your goals.


The one and only,


Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 28th Nov 2009 00:58 Edited at: 28th Nov 2009 00:59
Hi there.

It's been a while but I'm still having problems with this. CoffeeGrunt was helping me out alot and combined my sound script and door script into one. However, it still doesn't work the way it should and CG has ran out of ideas.

The sound now plays immediately when I start the test game and stops when I enter the trigger zone. The switch which is supposed to stop the sound now only fulfills half of its purpose and only re-opens the doors.

The sound SHOULD be activating when I enter the trigger zone and stopping when I hit the switch. The script seems like it works, but the events are in the wrong order.

Here is the script on the trigger zone:



The doors which the triggerzone and switch control are all called "door1". CoffeeGrunt also told me to name the triggerzone "door1". I'm assuming this is so that the switch works with the triggerzone?

Script on the switch:



If anyone can provide an answer to this it would be very much appreciated. It's been bothering me for a while now and it's getting frustrating.
starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 28th Nov 2009 01:06
Use an invisible entity instead of a zone. That would be my idea.

Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 28th Nov 2009 11:37
Originally that was what I had but could never get it working fully. That would also require chopping the script into 2 again?
Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 30th Nov 2009 21:17
Anyone?
Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 3rd Dec 2009 00:15
Still having trouble with this.
Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 4th Dec 2009 10:42
Anyone??? :s
Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 5th Dec 2009 16:58
Last try I guess - could anyone please help me?
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 9th Dec 2009 00:24
Zone:



If your zone is named "door1" then that should do the trick.


The one and only,


Butt monkey
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Scotland
Posted: 9th Dec 2009 23:24
Finally, it works.

Thanks a million!

Login to post a reply

Server time is: 2024-11-25 05:27:48
Your offset time is: 2024-11-25 05:27:48