Using music with the playSound() and destroy ?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Dragomir
Posts: 12
Joined: Wed Jan 16, 2013 12:09 am

Using music with the playSound() and destroy ?

Post by Dragomir »

Hi i just started playing with the editor and i was able to define a sound (which is a music) and connected a pressure plate to my script and everything is fine. My question is, is it possible to destroy that sound ? I tried to destroy the sound but wasnt able to do it.

Is there no way to stop a sound or something ?
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Using music with the playSound() and destroy ?

Post by Phitt »

There is a relatively complicated workaround, can be found here:

viewtopic.php?f=14&t=4512&p=47328

This is currently the best approach to start/stop (looping or not) sounds and make them keep playing even after reloading a save game.
Dragomir
Posts: 12
Joined: Wed Jan 16, 2013 12:09 am

Re: Using music with the playSound() and destroy ?

Post by Dragomir »

Yeah ive seen that one but its only for a door. I dont think i can do that for a pressure plate or lets say that the sound stop when the monster is dead since there is no sound destroy or soundStop()
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Using music with the playSound() and destroy ?

Post by Phitt »

I think you misunderstand how this approach works. The door is only used to play the sound (due to technical limitations this is the only way to stop the sound at will). There is no door the player can see or run into. You can use this workaround with every sound effect you like.
Dragomir
Posts: 12
Joined: Wed Jan 16, 2013 12:09 am

Re: Using music with the playSound() and destroy ?

Post by Dragomir »

Yeah im sorry you are totaly right there ;)

"The door is invisible & is spawned then immediately opened thus producing the lockSound which is your defined sound. This fixes problem #4 as door produced sound does not occur on every level as playSoundAt() does. The sound can be stopped at anytime by simply destroying the door which fixes problem #1. The door never blocks anything as it's opened the moment it's spawned at a velocity of 100."

Thx i will try that later :)
Post Reply