Page 1 of 1

Mass suicide?

Posted: Tue Jan 06, 2004 8:19 pm
by Ramah Palmer
Hi, me and a m8 are in the design stage of what will hopefully be a bit of a fun map. Basically it's a double objective map with a race to be the first team to complete their task. One of the suggested ways to complete this is that when one team presses a certain trigger, the entire other team commits suicide, thus giving them all a nice -1 to add to their score. :) So it won't be an objective map as such, more a round-based map with an added element.

So my question is this: Is it possible to script so that at the press of a switch all the Axis or the Allies (depending on which team DIDN'T press their switch) keel over and die?

Thanks in advance for any help given. :D

Posted: Tue Jan 06, 2004 9:39 pm
by martijn_NL
I never tried that but maybe this will work:

Code: Select all

for (self.i = 1; self.i <= $player.size; self.i++) 
   { 
      if ( isalive($player[self.i]) && ($player[self.i].health > 0)  && $player[self.i].dmteam == axis) 
      { 
            player[self.i].health = -1
      }
   }

Posted: Tue Jan 06, 2004 10:33 pm
by LiTe
Couldn't you also do something like 'stufftext "kill" ' for each player?

Posted: Wed Jan 07, 2004 7:09 pm
by Ramah Palmer
Well I'm still only a beginner when it comes to scripting so am not sure about the stufftext idea. Ive seen a few posts on these forums about the command but am not really sure how to use it.

Martin: wouldn't altering the player's health like that just cause the player to die but not to suicide? If that's the only way to do it, then I'm ok with that, but it would be fun if I could get the suicide bit instead.

Posted: Wed Jan 07, 2004 10:21 pm
by LiTe
the kill command will bring up something in the messages(+ it will kill you) 'ThisGuy took himself out of commission.' kill is the suicide command.

Posted: Wed Jan 07, 2004 10:30 pm
by martijn_NL
Hmm about that you are right Ramah. But i didn't if the command kill could be used in scripting, so i used the health. But the scripting principle works the same. I also used it for a tank in a multiplayer map, that shot on allied soldiers.

By the way my name is martijn, not martin :wink:

Posted: Thu Jan 08, 2004 12:19 am
by bdbodger
what if you have a tigger over the switch that has

key: setthread Value:suicide

and you put this thread in your level script

suicide:

local.player = parm.other

local.player stufftext ( " say suicide switch activated die you suckers die ")

wait 1

for(local.i=1;local.i <= $player.size ;local.i++)
{
if($player[local.i].dmteam != local.player.dmteam)
$player[local.i] stufftext ("kill")
}
end

Posted: Thu Jan 08, 2004 2:28 am
by omniscient
well, what if u made 2 trigger kills that overlap eachother the size of ur sky box. target them allied_win and axis_win. then with trigger uses, set em off.