Jump to content
Sign in to follow this  
RogueRunner

Trigger to dedect civvies

Recommended Posts

Ok so I'm a scripting n00b and I need to clear a town of baddies but leave the civvies intact, lets say 70% of them alive. Two questions.

How do I do this, obviously with a trigger (I hope wink_o.gif ) and get a message saying 'Damage to high, yadda yadda yadda your a bad soldier'

I have a trigger currently looking for bad guys in a huge circle around the town. As soon as it sense none in the circle it abrutly stops and give me my score. How do I do it so that you continue flying/playing with just a message popping up in the center of the screen telling you you have won?

Share this post


Link to post
Share on other sites

My orignal problem was that the trigger circles overlapped and then one of them did not work. When I changed it so that the one is smaller than the other and none of the circle lines crossed both triggers work. Now my problem is just how to make it to detect that 30% if the civs were killed and not the 'once, not present' thing smile_o.gif

Share this post


Link to post
Share on other sites

Im a noob to scripting in arma too, but I have done some coding in the past.  The way I would do this in the coding is make an if statment.

Example

if Civ1 dead +1

do that for each civ, then have another if statment

if 40 hit(40 dead civ) then call mission end.  

you would have to put this in the loop.sqs i think.

Now I know the basic how to do it, but I have no idea how to get it to work in arma.  But I think that would be the best way to do it in arma, mayb some one can plug in the right commands and just use that +1 idea.

Sorry could not be of more help.

Share this post


Link to post
Share on other sites

There is no trigger option or editor accessible function like that.

So if you have never written a script, there is unfortunately no way, you can achieve exactly what you want.

You would actually have to write a script that counts all

civilians and calculates the percentage of dead civilians from the total number of civilians:

So let's say your trigger feeds a list array named "townarray"

then it can be like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_totalcivs={side _x==civilian} count townarray

_deadcivs={(not alive _x) and (side _x==civilian)} count townarray

_percentage=(_deadcivs/_totalcivs)*100

The list array is stated in the condition field of the trigger like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

townarray=thisList

See if that gets you further.

EDIT: Dead soldier of the west,east side in the trigger might distort the total number, because they are for some reason made civilians after they die. But if no soldiers die in your case, then you are fine.

Share this post


Link to post
Share on other sites

That made whooooosh as it went by wink_o.gifwink_o.gif

Thanx for the help guys but looks like it's not meant to be biggrin_o.gif

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  

×