OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Semedar on 28 Dec 2009, 22:29:27

Title: Misson Win On Killing A Civilian
Post by: Semedar on 28 Dec 2009, 22:29:27
Can anyone help me out how to script my mission so when you kill a civilian (Just one) you complete the mission and it ends?

And if possible, how to make it when you kill the civilian a sound plays then the mission ends.

Anyways thanks for reading  :)

My mission:

Kill the civilian thats surrounded by bunch of OPFOR in a heavily wooded area to complete the mission.
Title: Re: Misson Win On Killing A Civilian
Post by: Krieg on 29 Dec 2009, 13:24:14
Does civilian have to move around?

If not, it is this simple:
Quote
Put a trigger in are the civilian would be present, size whatever you want, activated by civilian, once not present.
In type of the trigger select "End 1", and put whatever time delay you want.

And also,  :welcome: to OFPEC!
Title: Re: Misson Win On Killing A Civilian
Post by: Semedar on 29 Dec 2009, 21:17:43
Hah, that easy huh?  :D Thanks for the help, and I've came to this site plenty of times before to look at scripts and what-not, just not ask for help.  ;) But thanks!  :)
Title: Re: Misson Win On Killing A Civilian
Post by: JasonO on 30 Dec 2009, 03:52:28
Another solution is to have in the condition field of a trigger the following:

Code: [Select]
!alive unitName
If dead, the trigger will, well.. trigger!  :scratch:

It can be size 0 x 0 and doesn't need to be activated by anyone. It can have the End #1 selected with the delay as mentioned in the above post which is still a method of doing it but if they do happen to move around then it could help soemone else looking for an answer :)
Title: Re: Misson Win On Killing A Civilian
Post by: Semedar on 30 Dec 2009, 05:47:45
Aye, thanks for the tip.  :) It'll come useful for some people I'm sure. Thanks.  :)

Edit: Is it possible to have more than one unit in the condition field? Say when you kill two people (Bob, Joe) then the trigger activates.
Title: Re: Misson Win On Killing A Civilian
Post by: Krieg on 30 Dec 2009, 07:51:51
Maybe

Code: [Select]
!alive Bob && !alive Joe
In condition field would work?

Title: Re: Misson Win On Killing A Civilian
Post by: JasonO on 30 Dec 2009, 14:03:01
Yep you can use the above example if you want it to trigger when they are both dead. You can also do it so only one of the two has to die for it to trigger.

Code: [Select]
!alive Bob || !alive Joe
With that, only one of them have to die for it to trigger. Might come in handy.
Title: Re: Misson Win On Killing A Civilian
Post by: Semedar on 31 Dec 2009, 01:18:42
Aye, thanks for the help! :)