Jump to content
Sign in to follow this  
Tand3rsson

Help with civilian kill

Recommended Posts

Hi.

This is my problem; I want that if you kill a civilian before they pass a certain point, then you will lose. If the civilian pushes further, beyond this point, then its is ok to engage him. A great plus would also be if you could do something like checkmuzzel so that you also have to fire a warning shot before shooting him. :confused:

Share this post


Link to post
Share on other sites

Well, if they come within, say 200 m of the camp the player is guarding. Just as an exampel. In my mission youll be behind a HMG, and if the civilian dosent stop outside the base perimiter, you´ll be free to shoot

Share this post


Link to post
Share on other sites

I see. Well in that case what you need to do is a create a repeatedly activated trigger that detects when units from the civilian side are present within the kill zone area (which you can define by altering the size of the trigger). Name this trigger "civTrig" in the "Name" field.

Now create another trigger over the position where all of the civilians start. Make sure that this trigger is large enough to include every single civilian; you might need to make it quite enormous, but that's OK. Like the first trigger, make this trigger activated by civilians being present, but unlike the first trigger, make this one so that it can be activated only once. In the On Activation field of this trigger, put the following:

{_x addEventHandler ["killed",{if !((_this select 0) in (list civTrig)) then {loss = true}}]} forEach thisList

Finally, create a third trigger. This trigger does not need to have any area; it will be activated by the "loss" variable. In the Condition field of this trigger, erase "This" and put the following:

loss

Now change the trigger's type to the End # that corresponds to the debriefing you wish to use in the event that the mission is failed on account of killing a civilian outside of the acceptable engagement range.

Edited by ST_Dux
code correction

Share this post


Link to post
Share on other sites

Thanks! I will try it out!

---------- Post added at 09:51 PM ---------- Previous post was at 09:40 PM ----------

Did it all, did it again, checked, doubble checked.. didnt work for me :(

Share this post


Link to post
Share on other sites

Try it again. I changed the code for the second trigger slightly, so it should work now.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×