Jump to content
Sign in to follow this  
_qor

How to make AI attack civilians

Recommended Posts

I am currently creating a mission, in which the military suits of the soldiers doesnt fit to the story.

So I am using civilians for the playable units. I created a BLUFOR unit with PoP of 0% leading the group of civilians, to make OPFOR attacking the civilians.

But OPFOR behaves kind of curious.

Normally, confronting BLUEFOR and OPFOR units, they instantly attack each other. Unfortunately this is not the case in my mission. There is a time span of about 5 seconds before OPFOR attacks the civilians.

The group of civilians also consists of Independents, which basically is set to be not friendly to OPFOR.

Besides, the unit which leads the group after the BLUFOR unit doesnt pop up (PoP 0%) is a civilian.

Anybody an idea?

EDIT: ah, the OPFOR unit only attacks the both Independent units. By the way it seems to be different each startup... or I just wasnt carefully.

Anyway, apparently the trick with the BLUFOR unit as group-leader doesnt work...

Edited by _qoR

Share this post


Link to post
Share on other sites

Try putting this in your this in your init.sqf see if it works. Using the setFriend command.

EAST setFriend [CIVILIAN, 0];

Share this post


Link to post
Share on other sites

just create a "init.sqf" inside my mission folder and add those lines, right?

...if yes, it doesnt work unfortnuately...

ah, I have to set both sides to attack the other one! dont I?

EAST setFriend [CIVILIAN, 0];

CIVILIAN setfriend [EAST, 0];

>>okay, with these lines OPFOR soldier is attacking all the playable units, apart from the player (me, civilian).

whats wrong?

Edited by _qoR

Share this post


Link to post
Share on other sites

You need this:

EAST setFriend [WEST, 1];

EAST setFriend [CIVILIAN, 0];
WEST setFriend [CIVILIAN, 0];

CIVILIAN setfriend [WEST, 0];
CIVILIAN setfriend [EAST, 0];

Also if using independent and you want them unfriendly to civilian, set them as friendly to both/opfor/blufor in editor---intel.

Then:

CIVILIAN setfriend [RESISTANCE, 0];

RESISTANCE setFriend [CIVILIAN, 0];

Edited by PELHAM

Share this post


Link to post
Share on other sites

but I want OPFOR being friendly to no one and CIVILIAN, INDEPENDENT and BLUFOR being friends.

But the commands are clear to me, obviously contrary to how I start them up.

I created a "init.sqf" in my mission folder and added

EAST setFriend [CIVILIAN, 0];

CIVILIAN setfriend [EAST, 0];

But when I preview my mission with facing an OPFOR unit, the OPFOR unit lays down and aims on the civilians/Independets, but doesnt shoot.

Share this post


Link to post
Share on other sites
but I want OPFOR being friendly to no one and CIVILIAN, INDEPENDENT and BLUFOR being friends.

But the commands are clear to me, obviously contrary to how I start them up.

I created a "init.sqf" in my mission folder and added

EAST setFriend [CIVILIAN, 0];

CIVILIAN setfriend [EAST, 0];

But when I preview my mission with facing an OPFOR unit, the OPFOR unit lays down and aims on the civilians/Independets, but doesnt shoot.

Did you arm the civilians? I made a mexican standoff with the 4 different armed sides. It worked perfectly for me that way.

You want to shoot unarmed civilians, tut tut!

Use doTarget, doFire or commandfire for each of the civilians you want dead. If it's just 1 unit doing the firing you will need a script to call the death of each civilian. Arma AI only kill those they are ordered to kill, they don't shoot unarmed people, it's against the ROI you know!!!

Edited by PELHAM

Share this post


Link to post
Share on other sites
But when I preview my mission with facing an OPFOR unit, the OPFOR unit lays down and aims on the civilians/Independets, but doesnt shoot.

I find the easiest way to get around the opfor engaging issue with civilians is to do the following.

1). Add a bluefor unit in the editor but set his Probability of presence to "0", and set his rank to sargeant or something.

2). Make him the leader of your civilians by dragging a group line from each of your civs to the blufor guy (who will never spawn).

3). In your Init.sqf add: EAST setFriend [CIVILIAN, 0]; CIVILIAN setfriend [EAST, 0];

Then you will find east troops will attack the civs with no additional scripting required. In using this method, I believe the civilians are still of the side "Civilian" even though you may think otherwise (unconfirmed).

For some reason AI will not always engage civilians by just using the setfriend command I have found from previous experience.

Thanks

Rough Knight

Edited by Rough Knight

Share this post


Link to post
Share on other sites

You want to shoot unarmed civilians, tut tut!

Yes I want to. Does Arma AI distinguishes between armed and unarmed units in regard whether they shoot them or not?

Share this post


Link to post
Share on other sites

Yes - with the civilian side, thats why j_frosts method works best.

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  

×