Jump to content
Sign in to follow this  
Detritus

Making AI open fire on Civs

Recommended Posts

Hi guys,

I'm really new to the mission editing but have learned one hell of a lot from the forums, they're a great resource. One thing I've been trying to find, and I'm pretty sure I did find it once, is how to make some AI guards open fire on the Civs they're guarding.

To help you understand in what context I want it to work, I have a mission where ur covert ops, you have a number of 'hearts and minds' objectives, one being, to rescue a bunch of Civs being held captive. What I want to achieve is that when the OPFOR guards detect your presence, they start to open up on the Civs they're guarding. I know how to set up the basic settings on the trigger but I just don't know how to make them target and shoot the Civs. Is there a script that will just make the Civs hostile to OPFOR when the trigger is activated, or do you need to script it for each guard and each Civ?

Thanks

Share this post


Link to post
Share on other sites

East setFriend [Civilian, 0];

Worked on A1, shall works on A2.

Share this post


Link to post
Share on other sites

Thanks Benny for the reply, I'll give this a go and report back. I guess this [Civilian, 0] is boolean, does a 1 set them as friendly again?

Share this post


Link to post
Share on other sites

Thanks Inkompetent. One more question, I guess it can be done on a unit by unit basis too? e.g. Unit1 setFriend [unit2, 0]

Share this post


Link to post
Share on other sites

Nope, only setFriend, for units you've got to use:

_unit addRating -1000;

Only thing is, it will set the unit as enemy for everyone.

Share this post


Link to post
Share on other sites

You can read more about it here here. Any time you wonder about a command I suggest you check the wiki first, then ask if the wiki doesn't answer the question :)

setFriend can only be used for a Side and not a single unit, and it also seems like especially the civilian side can cause issues since all Empty-side objects are classed as civilians.

Share this post


Link to post
Share on other sites

Just a follow up, I found it hard to get the setFriend command to work (either in a script or on the trigger), and having done some reading it has a reputation for being a strange command to get working (well at least in Arma), especially when the mission is underway and with civilians.

To get around the problem, I used Independent armed civs (to get civ-like appearance), stripped them of weapons and used the setCaptive to prevent the guards shooting them. Then on the detection trigger I just changed the setCaptive setting and the guards would open fire on them if BLUFOR were detected in the area.

Share this post


Link to post
Share on other sites

dont know if how well this will work but it should work. create your civ units and create an independant or opfor unit with probability of presence 0 andin its init line put enemygrp=group this;(depending on who you want to be enemy, for independant make sure to set them in mission settings to friendly to nobody or something) and name them. then in a trigger activated by whatever case you specified have an onactivation of

[civunitgoneenemy] join enemygrp;

now that should have the civ unit join the enemy group and now will be hostile. You will have to play around with it doing adjustments and maybe some behavior commands to get it to work to your liking.

Share this post


Link to post
Share on other sites

Isn't there a way to script an AI to target a civilian and then force fire on that civilian? I swear I remember doing it for ArmA or OFP but I can't remember how I did it. It makes for good execution scenes. Would anybody happen to know what I am talking about.

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  

×