Home   Help Search Login Register  

Author Topic: Ending a misison if someone dies  (Read 361 times)

0 Members and 1 Guest are viewing this topic.

Jim666

  • Guest
Ending a misison if someone dies
« on: 24 Oct 2004, 14:49:05 »
Hey, i'm making a mission and on it you have to assault a town occupied by the russians. In the town ive put a few civillians and named them etc, c1 c2 c3 and so fourth.

I want a trigger to end the game if a civilian gets killed but i dont know what to put in the activation field. (I knew how to do this once, but forgot what to put in the activation field. Heh  8))

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Ending a misison if someone dies
« Reply #1 on: 24 Oct 2004, 15:10:07 »
Put into a script:

#Loop

?!(alive c1): goto "Failed"
?!(alive c2): goto "Failed"
?!(alive c3): goto "Failed"

~10

Goto "Loop"

#Failed

MissionFailed = true

exit

Then call the script in the mission. Then have the condition of the end trigger as MissionFailed and make it massive and activated by anybody.
« Last Edit: 24 Oct 2004, 15:13:41 by C0LDSt33L »

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Ending a misison if someone dies
« Reply #2 on: 25 Oct 2004, 06:15:19 »
...or you could completely forget the script and just use a trigger ;)

Trigger

Radius: 0,0
Condition: none
Type: end#
Condition Field: "not (alive _x)" count [ c1, c2, c3, c4... ] > 0

That will end the mission 'immediately' if a civvie is killed.

You may want to use a variable, as Coldsteel suggested to have an end cutscene or a message about killing a civilian. Up to you I guess :)