Jump to content
Sign in to follow this  
Cyper

How to make a single civilian unit hostile

Recommended Posts

I have used

this setFriend [blufor, 0];

and it makes the particular AI civilian unit hostile towards BLUFOR. But Bluefor does not attack the civilian unit.

I can of course use

blufor setFriend [civilian, 0];

, but the problem is that I want like 20 hostile civilian units. It then becomes a pain to name all of them.

Share this post


Link to post
Share on other sites

Why don't you just make Blufor hostile to another faction like resistance, and then have the civilian join a resistance group or an Opfor group (if you don't care about Opfor hostility towards the civilian) at the appropriate time? Is there a reason you're not simply having the Civilian unit(s) join an Opfor group?

Share this post


Link to post
Share on other sites

Well, I could drag a civilian unit to a OPFOR unit and then set probability of presence to 0%... but then, if the civilian unit is tied to a leader, It's going to become problematic to use waypoints.

Share this post


Link to post
Share on other sites

Possibly using Addrating ?

Never used it on a civ before, but I would think it would work..

this addRating -20000;

Share this post


Link to post
Share on other sites

It works, but unfortunately, the civilians will start to shoot at each others unless I group them. Another problem that I came to think about is that you can't give civilians waypoints such as ''Gaurd''.

Share this post


Link to post
Share on other sites

I don't see why there isn't a script like:

this setEnemy [blufor];

or

OPFOR setFriend [blufor];

That would make things a lot easier.

Share this post


Link to post
Share on other sites

I have still not found a solution to this problem. Use of setfriend or grouping is not only impractical but it makes the AI behave very irratic, sometimes ignoring the player completely or running around.

The only solution yet, which is not very practical but it works, is to put civilian clothes on for example independent.

The unit becomes hostile, but all clothing items except shirt and pants is added. The unit is standing there in his underwear! It seems like I can't add civilian clothes on blufor, opfor or independent units???

This is the script I used:

removeAllWeapons this; removeUniform this; removeHeadgear this; removeVest this; this unassignItem "NVGoggles"; this removeItem "NVGoggles";                                                        
this addUniform "U_C_Poloshirt_blue"; this addHeadgear "H_Cap_red"; this addVest "V_BandollierB_cbr"; this addMagazine "HandGrenade";  this addMagazines ["30Rnd_65x39_caseless_green", 5];

Share this post


Link to post
Share on other sites

Uniforms are side-bound in ArmA3, so soldiers can only use uniforms of "their" side.

However, there is forceAddUniform to circumvent this restriction.

Regarding the underlying problem: The usual solution is to make the specific unit switch sides when needed. This is done by using

[this] join createGroup WEST

If you add this code to a unit that's inside a group already, it will remove it from that group. It will then act independently. If you want an entire group to switch, just add all the group members to the command:

(units group this) join createGroup WEST

Share this post


Link to post
Share on other sites

Thank you!

It works now.

In the future, I hope there will be a simple module to make specific units hostile.

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  

×