Page 1 of 1

stopsound in tiki

Posted: Fri Mar 26, 2004 8:18 pm
by wacko
okay. i hope i can explain it so u understand.
i use in my map a steam emitter (formerly animate/adam-pipe-steam.tik), which even has a loopsound command to play a steam sound.
This sound does work only in certain sp maps, so I added to my script:

Code: Select all

local.master=spawn ScriptMaster
local.master aliascache steamloop sound/mechanics/Mec_SteamLoop_01.wav soundparms 1.0 0.3 1.0 0.0 320 2200 item loaded maps "obj dm clone"
fine, now they play. The steam emitters are switched on and off later in the script with:

Code: Select all

	$cloneblow_m_1 anim start
// ...	
// and
// ...
	$cloneblow_m_1 anim stop
Because in the tiki of adam-pipe-steam there's the loopsound command but no stopsound, the sound continues to play, even when there's no steam anymore. Therefore I added a stopsound command to the tiki and use it as wasti-pipe-steam.tik. Here's it's code:

Code: Select all

TIKI
setup
{
	scale 1.0
	path models/fx/dummy
	skelmodel dummy3.skd
}

init
{
	server
	{
		classname animate
		notsolid
		rendereffects +dontdraw
	}
	client
	{
		cache vsssource.spr			

		originemitter steam
		(
			spawnrate 5.00
			model vsssource.spr
			alpha 0.80
			color 0.90 0.85 0.70
			scale 0.25
			life 1.00
			scalerate 8.00
			velocity 60.00
			randvelaxis range 10 -10 range 10 -10 range 10 -10
			accel 0.00 0.00 90.00
			fade
		)
	}
}

animations
{
        idle dummy3.skc
	start dummy3.skc
	{
		client
	        {
			enter emitteron steam
			enter loopsound steamloop
	        }
	}
	stop dummy3.skc
	{
		client
	        {
	    		enter emitteroff steam
	    		enter stoploopsound steamloop
		}
	}
}

/*QUAKED animate_fx_adam-pipe-steam(0.0 0.5 0.5) (-8 -8 -8) (8 8 8)
Senn's Sexy Pipe Steam
*/
Now the sounds still continue to play, but in the console I get a repeating message of "Event 'stoploopsound' does not exist".

So, what is this and what can I do?

try:

Posted: Fri Mar 26, 2004 8:41 pm
by tltrude
enter loopsound steamloop wait
or
enter loopsound steamloop off

BTW, you should change this line or you will have two with the same name in the editor.

/*QUAKED animate_fx_adam-pipe-steam

Posted: Fri Mar 26, 2004 8:53 pm
by jv_map
You cannot use stoploopsound in a client section as it is a server command. Hence you could try using 'stopaliaschannel' instead, or simply control the sounds via script :)

sound

Posted: Fri Mar 26, 2004 9:05 pm
by tltrude
Jv_map is right. You should take the sound out of the tik and just have the steam entity loop the sound. The sound will stop if you "hide" the entity too.

Re: try:

Posted: Fri Mar 26, 2004 9:52 pm
by wacko
okay, thnx a lot. :D
Could have thought of it myself, I even wanted to handle the sounds in the script, but then I found those lines in the tiki and was kind of fixed on solving it this way... As I have another tiki anyway, it won't be a problem.
tltrude wrote:BTW, you should change this line or you will have two with the same name in the editor.

/*QUAKED animate_fx_adam-pipe-steam
I did, just while copy/pasting into this thread, I took the original lines :wink: