sskakarot51
03-30-2003, 04:15 PM
Last request. Finnaly i am going to need...a self destruct that is activated by 2 switches both must be active before it will count down. then it will kill all players in 30 secs with an option to play a .wav upon activation, at 20 seconds and at 10 seconds.and if possible....i want the self destruct to be nullified if the player crosses a specific sector. again its for my Ship the U.S.S Archer so when you actually leave the ship in a shuttle or go to the planet the destruct will not hurt you. Im sorry for all the requests ive made lately but they wil help my level's gameplay so much.
------------------
DogSRoOL
03-30-2003, 06:37 PM
hmm... that one might be a little tougher. I don't know a lot about MP cogs... http://forums.massassi.net/html/frown.gif
I might give it a try if nobody else does (or says they will, at least).
------------------
May the forks be with you.
sskakarot51
03-31-2003, 01:59 PM
Actually. Forget the nullify sector stuff. Just every thing else will do fine. also i forgot i think, a third switch to deactivate it and reset it.
------------------
DSLS_DeathSythe
03-31-2003, 04:51 PM
here is something you might use, i did it with two cogs.
heres the first.
# Written By DSLS_DeathSythe
symbols
#=====
message startup
message activated
message timer
surface actswitch01 linkid=1 mask=0x400
surface actswitch02 linkid=2 mask=0x400
surface deactswitch linkid=3 mask=0x400
int first_on=0 local
int second_on=0 local
sound swchact_snd
sound alarm_snd
sound deact_snd
int kill_trig=1
#-----
end
#=====
code
#-----
startup:
if(IsServer())
{
SetWallCel(actswitch01, 0);
SetWallCel(actswitch02, 0);
SetWallCel(deactswitch, 0);
first_on = 0;
second_on = 0;
}
return;
#-----
activated:
if((GetSenderID() == 1) && (first_on == 0))
{
first_on = 1;
SetWallCel(actswitch01, 1);
PlaySoundPos(swchact_snd, GetSurfaceCenter(actswitch01), 1.0, -1, -1, 0x0);
if(first_on == 1 && second_on == 1)
{
PlaySoundGlobal(alarm_snd, 1.0, 0, 0x0);
SetTimerEx(10.0, 1, 0, 0);
return;
}
return;
}
else
if((GetSenderID() == 2) && (second_on == 0))
{
second_on = 1;
SetWallCel(actswitch02, 1);
PlaySoundPos(swchact_snd, GetSurfaceCenter(actswitch02), 1.0, -1, -1, 0x0);
if(first_on == 1 && second_on == 1)
{
PlaySoundGlobal(alarm_snd, 1.0, 0, 0x0);
SetTimerEx(10.0, 1, 0, 0);
return;
}
return;
}
else
if(GetSenderID() == 3)
{
SetWallCel(deactswitch, 1);
PlaySoundPos(swchact_snd, GetSurfaceCenter(deactswitch), 1.0, -1, -1, 0x0);
PlaySoundGlobal(deact_snd, 1.0, 0, 0x0);
SetTimerEx(1.0, 4, 0, 0);
KillTimerEx(1);
KillTimerEx(2);
KillTimerEx(3);
first_on = 0;
second_on = 0;
SetWallCel(actswitch01, 0);
SetWallCel(actswitch02, 0);
return;
}
return;
#-----
timer:
if(GetSenderID() == 1)
{
PlaySoundGlobal(alarm_snd, 1.0, 0, 0x0);
SetTimerEx(10.0, 2, 0, 0);
return;
}
else
if(GetSenderID() == 2)
{
PlaySoundGlobal(alarm_snd, 1.0, 0, 0x0);
SetTimerEx(GetSoundLen(alarm_snd), 3, 0, 0);
return;
}
else
if(GetSenderID() == 3)
{
if(IsServer())
{
SendTrigger(-1, kill_trig, 0, 0, 0, 0);
}
first_on = 0;
second_on = 0;
SetWallCel(actswitch01, 0);
SetWallCel(actswitch02, 0);
return;
}
else
if(GetSenderID() == 4)
{
SetWallCel(deactswitch, 0);
return;
}
return;
#=====
end
that cog controls the timer and the switches. i added a deactivate sound so when the deactswitch is activated it plays that. i also put in a switch act sound that will play when a switch is activated.
this cog does the killing.
# Written By DSLS_DeathSythe
flags=0x240
symbols
#=====
message startup
message trigger
thing player=-1 local
int kill_trig=1
#-----
end
#=====
code
#-----
startup:
player = GetLocalPlayerThing();
return;
#-----
trigger:
if(GetSourceRef() == kill_trig)
DamageThing(player, 1000.0, 0x1, player);
return;
#=====
end
this cog recives a trigger from the other cog when the timer is up. just make sure that the kill_trig number is the same for both cogs and different from anyother cog that uses a trigger.
it should kill everyone in the game.
hope that will work for you. need any changes just ask.
------------------
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.