Hello again. This time i need help with this cog... It works when you press the switch but it wont turn off when you press the switch again... The only way to really get it to turn of right now is to have it play silence.
If someone could help me, I would be very nice
- Unlike some people, whose middle name is cogger, my middle name is retard.
# Jedi Knight Cog Script
#
# prl_sectorsound.cog by Sylvicolus - 23 April 2001
#
# Sound triggered by activating switch. Use 1 or 2 switches.
# Activate switch again to turn sound off.
# Sound is heard inside of 1 to 4 sectors.
# Choose volume and wav sound.
#
# This cog is not supported by LucasArts Entertainment Co.
symbols
message activate
surface switch0 linkid=1
surface switch1 linkid=1
sector sector0 nolink
sector sector1 nolink
sector sector2 nolink
sector sector3 nolink
flex volume=1.0
sound wav0=00AlarmLoop03.WAV
int channel0 local
int channel1 local
int channel2 local
int channel3 local
int soundstatus=0 local
flex FadeOut=0.2 local
end
# ===============================================
code
startup:
setwallcel(switch0, 1);
if (switch1) setwallcel(switch1, 1);
return;
## Sets the switch mat to the 2nd cell, which is green or off position.
activate:
if (soundstatus==0)
{
soundstatus=1;
setwallcel(switch0, 0);
if (switch1) setwallcel(switch1, 0);
channel0 = SectorSound(sector0, wav0, volume);
if (sector1) channel1 = SectorSound(sector1, wav0, volume);
if (sector2) channel2 = SectorSound(sector2, wav0, volume);
if (sector3) channel3 = SectorSound(sector3, wav0, volume);
return;
} //else turn off sound
soundstatus=0;
setwallcel(switch0, 1);
if (switch1) setwallcel(switch1, 1);
StopSound(channel0,FadeOut);
if (sector1) StopSound(channel1,FadeOut);
if (sector2) StopSound(channel2,FadeOut);
if (sector3) StopSound(channel3,FadeOut);
return;
end
------------------
Bob Dole likes peanut butter. Bob Dole's never been afraid to admit that
If someone could help me, I would be very nice
![http://forums.massassi.net/html/biggrin.gif [http://forums.massassi.net/html/biggrin.gif]](http://forums.massassi.net/html/biggrin.gif)
# Jedi Knight Cog Script
#
# prl_sectorsound.cog by Sylvicolus - 23 April 2001
#
# Sound triggered by activating switch. Use 1 or 2 switches.
# Activate switch again to turn sound off.
# Sound is heard inside of 1 to 4 sectors.
# Choose volume and wav sound.
#
# This cog is not supported by LucasArts Entertainment Co.
symbols
message activate
surface switch0 linkid=1
surface switch1 linkid=1
sector sector0 nolink
sector sector1 nolink
sector sector2 nolink
sector sector3 nolink
flex volume=1.0
sound wav0=00AlarmLoop03.WAV
int channel0 local
int channel1 local
int channel2 local
int channel3 local
int soundstatus=0 local
flex FadeOut=0.2 local
end
# ===============================================
code
startup:
setwallcel(switch0, 1);
if (switch1) setwallcel(switch1, 1);
return;
## Sets the switch mat to the 2nd cell, which is green or off position.
activate:
if (soundstatus==0)
{
soundstatus=1;
setwallcel(switch0, 0);
if (switch1) setwallcel(switch1, 0);
channel0 = SectorSound(sector0, wav0, volume);
if (sector1) channel1 = SectorSound(sector1, wav0, volume);
if (sector2) channel2 = SectorSound(sector2, wav0, volume);
if (sector3) channel3 = SectorSound(sector3, wav0, volume);
return;
} //else turn off sound
soundstatus=0;
setwallcel(switch0, 1);
if (switch1) setwallcel(switch1, 1);
StopSound(channel0,FadeOut);
if (sector1) StopSound(channel1,FadeOut);
if (sector2) StopSound(channel2,FadeOut);
if (sector3) StopSound(channel3,FadeOut);
return;
end
------------------
Bob Dole likes peanut butter. Bob Dole's never been afraid to admit that