stopsound in tiki

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

stopsound in tiki

Post 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?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

try:

Post 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
Last edited by tltrude on Fri Mar 26, 2004 9:00 pm, edited 2 times in total.
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :)
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

sound

Post 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.
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Re: try:

Post 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:
Post Reply