Home   Help Search Login Register  

Author Topic: stopping triggers once dead [SOLVED]  (Read 1149 times)

0 Members and 1 Guest are viewing this topic.

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
stopping triggers once dead [SOLVED]
« on: 28 Jan 2010, 00:23:17 »
Hi Mad Pup again (sorry for the sudden burst of questions), I would like to know, how to have a trigger, stop executing once an AI civilian is dead. For example, I make a trigger, that executes every time you enter it's boundries, and it has a civilian man in the middle. And once I kill that civilian, the trigger stops executing, even though you exit the boundries, and come back in.
« Last Edit: 30 Jan 2010, 01:22:57 by Mad Pup »
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline Krieg

  • Mission Maker
  • Members
  • *
  • Who dares wins.
Re: stopping triggers once dead
« Reply #1 on: 28 Jan 2010, 13:26:39 »
I think that trigger editing should solve your problem.

Name your old trigger "atrigger"

Add new trigger.

Make it the same size as the one you want to execute while civilian is present.

Place it close to your old trigger.

Group the civilian with the new trigger, open it up and edit it to following:

Vehicle (can only be done when vehicle (i.e. soldier, civilian, Tank etc.) is grouped with trigger)
Once
Not Present

In "On Activation" field write "deleteVehicle atrigger" (of course, without the quotation marks).
____________________________________________________________________________________________

Hope that helps,
Krieg
If you see a light at the end of the tunnel, then it's probably an enemy tank.

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Re: stopping triggers once dead
« Reply #2 on: 30 Jan 2010, 01:22:36 »
Yay! It Worked!  :D
Thanks Once Again Krieg!  :good:
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: stopping triggers once dead [SOLVED]
« Reply #3 on: 31 Jan 2010, 04:11:54 »
Just to help keep unnecssary trigger amounts down you could simply add the check inside the condition field.
Code: [Select]
Condition: this && (alive unitname)That way the script will check for unit presence and the life status of a particular unit.

You could also do it this way...
Code: [Select]
Condition: ? (player distance unitname < 1) and !(alive unitname)
OnActivation: Deletevehicle triggername
You can adjust the distance to your requirements and execute additional code after the deletion by using a semicolon. (If you need to) It will also reduce the amount of triggers used throughout your mission as well as reduce the clutter formed by group lines.


Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Re: stopping triggers once dead [SOLVED]
« Reply #4 on: 31 Jan 2010, 04:16:32 »
Thanks savedbygrace! I'll look into it.

Mad Pup
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad