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!
Multiple triggers to start an effect at multiple origins.
Moderator: Core Staff
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Multiple triggers to start an effect at multiple origins
Possibly the sound is not correctly set up in soundalias to play at a distance and is cutting off.
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Multiple triggers to start an effect at multiple origins
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.
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.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Multiple triggers to start an effect at multiple origins
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.
0-256 = 100% sound
256-512 = 100%-0% sound
Make the distance larger and sound will be heard from further.
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ Wannabe
- Posts: 4
- Joined: June 26th, 2014, 4:18 pm
Re: Multiple triggers to start an effect at multiple origins
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
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
Who is online
Users browsing this forum: No registered users and 0 guests