Mass suicide?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Mass suicide?

Post 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
Mapping is just INCREDIBLY time consuming.
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post 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
      }
   }
Mapping 4 life
LiTe
Corporal
Posts: 34
Joined: Sat Dec 13, 2003 1:07 pm
Contact:

Post by LiTe »

Couldn't you also do something like 'stufftext "kill" ' for each player?
33rd[SS]SCpl.*LiTe*|AD|SP|

"Casualties many; Percentage of dead unknown; Combat efficiency; we're winning."
- Colonel David M. Shoup
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Post 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.
Mapping is just INCREDIBLY time consuming.
LiTe
Corporal
Posts: 34
Joined: Sat Dec 13, 2003 1:07 pm
Contact:

Post 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.
33rd[SS]SCpl.*LiTe*|AD|SP|

"Casualties many; Percentage of dead unknown; Combat efficiency; we're winning."
- Colonel David M. Shoup
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post 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:
Mapping 4 life
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post 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.
Post Reply