Jump to content
Sign in to follow this  
reaptor

Detecting civilian kills and arresting people

Recommended Posts

I want two diffrent things for my MP mission:

1:I want a trigger to be activated if the resistance side kills any civilian units.

2:I want anyone on the resistance side to be able to walk to any civilian and make him stop and switch animation to "FXStandSurDown" via the action menu. It would also be good if the arrested unit would switch animation to "FXStandSurDead" when killed.

Can anyone help me?

Share this post


Link to post
Share on other sites
Quote[/b] ]2:I want anyone on the resistance side to be able to walk to any civilian and make him stop and switch animation to "FXStandSurDown" via the action menu. It would also be good if the arrested unit would switch animation to "FXStandSurDead" when killed.

im not sure, but i think this will work biggrin_o.gif

1) create script that says:

unitname switchmove "FXStandSurDown"

Exit

save script as arrest.sqs

2) in the units init field type in:

unitname addAction ["Arrest","arrest.sqs"]

Arrest = what will appear in the action menu

if that doesn't work try playmove instead of switchmove

im not sure about the dying part

Share this post


Link to post
Share on other sites
Quote[/b] ]1:I want a trigger to be activated if the resistance side kills any civilian units.

Create a civilian present trigger the covers the map. In the acitviation field put:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{{_x AddEventHandler [{killed}, {if ((side (_this select 1)) == resistance) then {Resistance_Killed_civ = true}}]} forEach (crew _x)} forEach thislist

Create a second trigger that has the following condition field:

Resistance_Killed_civ

Don't forget to set Resistance_Killed_civ = false at the start of the mission, preferably in init.sqs  The reason for this is if later when you are making changes if you want something to happen if Resistance has not yet killed a civilian then you will want to use the condition:

not Resistance_Killed_civ

This will only be true if you have initialised Resistance_Killed_civ to false

There might be more elegant ways but the above should work.

Note:  The trigger will fire the first time a resistance unit kills a civilan.  If you want this to repeat then one quick way would be to set the trigger to be repeating and have another trigger with condition field:

Resistance_Killed_civ

a time delay of say 0.5 seconds

and an activation field of:

Resistance_Killed_civ = false

The main trigger will then fire everytime a civilian is killed by a resistance unit - providing they are killed more than 0.5 seconds apart.

EDIT:

The above is all for SP. I leave it as an exercise to the reader to make the necessary changes for MP

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  

×