Looped, triggered speakers that can set off and on


(limmylim) #1

Ive read like all speaker topics but none of helped so dont redirect me pl0x >_>

Im creating a uberlame sniper map with a secret room. I wanna have you switch 4 songs on or off.

I have 5 func_invisible_user’s that are connected to 5 target_script_trigger’s. I looked at the script of voilegarde_b2 and i got this:

triggersongoff
{
	spawn
	{
	}

	trigger play
	{
		disablespeaker music1
		disablespeaker music2
		disablespeaker music3
		disablespeaker music4
	}
}
		

triggersong1
{
	spawn
	{
	}

	trigger play
	{
		enablespeaker music1
		disablespeaker music2
		disablespeaker music3
		disablespeaker music4
	}
}

triggersong2
{
	spawn
	{
	}

	trigger play
	{
		disablespeaker music1
		enablespeaker music2
		disablespeaker music3
		disablespeaker music4
	}
}

triggersong3
{
	spawn
	{
	}

	trigger play
	{
		disablespeaker music1
		disablespeaker music2
		enablespeaker music3
		disablespeaker music4
	}
}

triggersong4
{
	spawn
	{
	}

	trigger play
	{
		disablespeaker music1
		disablespeaker music2
		disablespeaker music3
		enablespeaker music4
	}
}

Should be easy but i havent script in a while so im stuck from this point.
i dont have a speaker yet, but what targetname/target/scriptname must i give it? And is the script correct?

Its a looped song btw. I want the music to be off when the map starts.

thnx <3
limmeh


(aburn) #2

I would make one script mover and than play different looping files in it :stuck_out_tongue:
the target_script_triggers would activate the parts of script in the mover script

like this


my_script_trigger
{
	spawn
	{
		wait 300
	}
	

	activate //target_script_triggers targetname :P
	{
		trigger sound_mover play1
	}
}



sound_mover
{

	spawn
	{
		wait 300
	}

	trigger play1
	{
		stopsound
		playsound [ur_sound_file] looping volume 512
	}

	trigger play2
	{
		stopsound
		playsound [ur_sound_file] looping volume 512
	}
		
}

Hope you get me here
u get ur target_script_triggs to play particullar stuff in the mover…
and the mover may be a radio or anything you want… even… if you want you can just make it our of small clip brushes…


(murka) #3

o, i spot a problem, the activate in your script isnt the “targetname” of TST, its the “target”


(aburn) #4

yeh… true :stuck_out_tongue:

SOZ


(limmylim) #5

my_script_trigger
{
	spawn
	{
		wait 300
	}
	

	activate //target_script_triggers target :P
	{
		trigger sound_mover play1
	}
}



sound_mover
{

	spawn
	{
		wait 300
	}

	trigger play1
	{
		stopsound
		playsound [ur_sound_file] looping volume 512
	}

	trigger play2
	{
		stopsound
		playsound [ur_sound_file] looping volume 512
	}
		
}

What entity must have the ‘my_script_trigger’ as scriptname?

Ah its confusing me.
Basiccaly the ‘my_script_trigger’ makes set the play1 as default right? But how can i trigger the play2 etc?


(murka) #6

the entity is an “target_scipt_trigger”
you make another one with different name for play2 etc.


(MrLego) #7

Here’s a forum post from a while back that has some other methods of activating sounds.

http://www.splashdamage.com/forums/viewtopic.php?t=13035


(limmylim) #8

Oh ubergods of mapping, please make me a prefab

i tried it like 100 times i cant get it sorted </3 :<