Page 2 of 2

Re: Multiple triggers to start an effect at multiple origins

Posted: October 20th, 2011, 8:25 am
by roxsman
Yup, that was it.. Aside from one small detail it works right now.. But that detail is somewhat hard to explain.
The sound seems to come from only one of the origins, while the light effect plays at all of the origins.

To illustrate: imagine a long path divided into 5 sections. At each transition is a pole with a lamp-model and an origin. On the mostleft, middle and mostright pole a trigger is attached. Kinda like so:

T_____P_____T_____P_____T

T= pole with origin and trigger
P= pole with origin

If I use the mostleft trigger and start walking towards the middle the sound just dies. If I walk back, it comes back. Afterwards, if I use the mostright trigger, the sound only comes from the mostright pole. Which seems strange as each trigger is connected to all origins and I can't really find a reason for this. Is there a limitation in the playsound function maybe? Because the playfx thing DOES work at all origins. It's not a BIG problem cuz if this doesn't work I can just play the sound "level-wide" but it would be a cooler effect if the sound was played at multiple origins as well :)

Anyways, thanks for all the help!! Much appreciated and learned a lot!

Re: Multiple triggers to start an effect at multiple origins

Posted: October 20th, 2011, 8:41 pm
by Drofder2004
Possibly the sound is not correctly set up in soundalias to play at a distance and is cutting off.

Re: Multiple triggers to start an effect at multiple origins

Posted: October 21st, 2011, 9:27 am
by roxsman
Ok.. I kept the soundalias as simple as I thought was possible so this is it:

jb_fire_alarm,,amb_emitters/jb_fire_alarm.wav,,,,,,256,512,auto,,,nonlooping,,,,,,,,,,

Copied it from some sound in the common.csv and edited to my liking.

Re: Multiple triggers to start an effect at multiple origins

Posted: October 21st, 2011, 8:13 pm
by Drofder2004
The 256 and 512 are the min and max distance.
0-256 = 100% sound
256-512 = 100%-0% sound

Make the distance larger and sound will be heard from further.

Re: Multiple triggers to start an effect at multiple origins

Posted: July 17th, 2014, 2:20 pm
by privateparts
ok i have the eefect working but no sound i chose it appears to have repeated the sound over and over again of an explosion how do i get it to play the sound i want and also what do you write in the csv file.

here is the script


main()
{
level.alarmfx = loadfx("misc/light_c4_blink");
level.alarm_sound = "ring";
level.armed=true;
thread alarmTrigsetup();
}

alarmTrigsetup()
{
fireAlarms = getEntArray("alarm_trig","targetname");
for(i=0;i<fireAlarms.size;i++)
fireAlarms alarmTrig();
}

alarmTrig()
{
while(true)
{
self waittill("trigger");
if(level.armed)
{
level.armed=false;
turnonalarms();
wait 5;
level.armed=true;
}
}
}


turnonalarms()
{
o = getEntArray("alarm_orig","targetname");
for(i=0;i<o.size;i++)
{
playfx(level.alarmfx, o.origin);
o playloopsound (level.alarm_sound);
}
}

it keeps repeating my motar sounds over and over when i have donr=e thrigger and dont stop