Jump to content
Sign in to follow this  
jamesg

How to get AI to fire on civilians

Recommended Posts

Hi all

I'm planning an MP mission where the humans play as civilians (armed) acting as insurgents. The problem is that even if civilians are armed and have shot up some soldiers the AI soldiers (East/West) won't fire on them, although civilian AIs have no problem firing at East/West soldiers (depending on how you have configured the allegiance of the Resistance).

I've tried adding 'this setcaptive false" in the init line of the civilians but this has no effect so it seems like 'AI won't engage civilians' is hardcoded into Arma.

Does anybody know a way around this?

Share this post


Link to post
Share on other sites
so it seems like 'AI won't engage civilians' is hardcoded into Arma.

No, setCaptive false only removes the effect of setCaptive true. That is, setCaptive true makes units appear to others as side civilian, setCaptive false restores the unit's appearance to its original side. If the original side is civilian, then he's still going to appear as civilian with setCaptive false. Civilians by default are off limits to the other sides. However, you can do one of a few different things to get AI to engage civilians:

1. Use doFire, it'll command them to fire on any unit regardless of what side they're on. This is only useful for getting specific AI units to fire on specific civilian units, like in cutscenes or situations where you have hostages/prisoners being executed.

2. Give them a negative rating with addRating. A rating below -2000 (or somewhere around there I don't know the exact number) makes them appear as side enemy, this side is enemy to everyone (even the unit in question, kinda odd but true), so the unit will be seen as an enemy even by the other units on their side. If there are other civilians nearby and they're armed, don't use this because they'll all just kill eachother.

3. Put the civilian on a different side (Resistance is the most logical side, this can be done by editing the mission.sqm file or grouping them to a unit of that side in the editor, try searching if you need a better explanation), one that is enemy to the AI you want to engage them. Use setCaptive true to disguise them as civilians (take note however this doesn't change the captive unit's combat mode, they will still fire at the enemy) if you still need to, then when you want to remove their disguise use setCaptive false. This will make the civilians fire at the enemy and vice versa all as if they were East vs West (or East vs Resistance or West vs Resistance). This is the appropriate method for missions where all your civilians are fighting the enemy units together, like if they're a militia for example.

Each of these methods are more appropriate than the others in certain situations, hopefully I've explained them well enough for you to know which to use for each one.

Share this post


Link to post
Share on other sites

I strongly suggest putting the Civilian class units on to a different side, such as the Independent/RACS/Resistance. Changing the Civilian side to enemy of other sides results in units attacking buildings and empty vehicles.

Quote[/b] ]setCaptive true makes units appear to others as side civilian, setCaptive false restores the unit's appearance to its original side.

setCaptive seems to only prevent a unit from being attacked, although I'm not sure of the actual mechanism. Killing captives actually has a positive affect on rating.

Share this post


Link to post
Share on other sites

I allways solved such things by having a commander of the civvy group being west or east... But you cant play with three groups then... Only two... Or well two badguys...

If a east commander is attached to a group of civilians then the civilians become east subordinates. And there for become legit tgt's! yay.gifbiggrin_o.gif

Share this post


Link to post
Share on other sites

Thanks for the help guys, I've settled on using the civies as members of a resistance squad as suggested for this particular mission.

Share this post


Link to post
Share on other sites

You can also add a west/east commander, And make his probobility of presence 0, The civvies will still be hostile to their enemies..

Share this post


Link to post
Share on other sites

Or do what i would. Place an objective on the squad leader with a 15 radios

How can i change them to a rsistance? that will be easyer becuase they wount attack civlians until the waypoint actualy comes and so i cant tell the to move or get in chopper becuase they will stop shooting at them

Share this post


Link to post
Share on other sites
You can also add a west/east commander, And make his probobility of presence 0, The civvies will still be hostile to their enemies..

yes, this is by far the best solution I found out. There is a different one by editing the mission.sqs.

Share this post


Link to post
Share on other sites

Man, this is not a good day for editing for me...

I want a mission where the US special forces are disguised as civillians, so I made a couple, named them as "player1" and "player2" and grouped them with a BLUFOR player who's probability is 0%. Tested the mission in front of an OPFOR firing squad and sure enough ended up dead. I then set in their init line "this setCaptive true" and ran the mision again, no fire this time....

So I said "Great!" and created a trigger that sets their setCaptive state false and figured I had it all sorted out, but when I ran the preview, I didn't get shot at. sad_o.gif I double checked by seting player1 as a BLUFOR soldier; the results were, player1 got shot and player2 didn't. Seems that when the civillian comes off his setCaptive status, the mission forgets he was linked to the BLUFOR side.  banghead.gif  So, is there an elegant way to use civies as Delta for an infiltration?

Thanks again for help with my many dumb questions today...

pistols.gif Rick

Share this post


Link to post
Share on other sites

Make sure that the soldier is the groupleader of the civilians (has the highest rang)

Share this post


Link to post
Share on other sites

Ok, thanks ofpforum, I had that, but apparently my trigger wasn't quite right. After playing with it for a while it does seem to work, but also seems to be a bit dodgy. Sometimes they shoot, sometimes they just look at me like they'd like to shoot me. I'll have to play around with it some more.

Thanks,

Rick

Share this post


Link to post
Share on other sites

Hey Rick.

You could just group the civilians to a West officer, and put this in the officer's init line:

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

This will group the civilian to West, but because the officer has been deleted, the civilian will become the squad leader.

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  

×