Jump to content
Sign in to follow this  
Flogger23m

Need help understanding AI Behaviors - Do Not Fire Unless Fired Upon / Careless

Recommended Posts

Hello,

 

I am having some trouble with AI behavior types. I am trying to make enemy NPCs only return fire if they are shot at. I have done the following:

 

Set behavior to Careless, Combat Mode (?) to Do Not Fire Unless Fired Upon, Keep Formation.

 

However I am getting very mixed results. Some NPCs with these settings will never return fire, even if I am standing right in front of them and shoot them twice in the leg. Other times NPC units with the exact same settings opens fire on me even when I have not fired a single shot. I am setting these conditions at the first way point. Can anyone explain why I am seeing two very different results? And as either result is not what I am looking for, is there a way to make enemy NPCs do the following:

 

- Only return fire when shot at/shot.

 

 

To give some background, here is what I am trying to do mission wise:

 

- BLUFOR is disguised in OPFOR uniforms. Using an element of surprise so they're not shot on sight, the player & their squad is to silently eliminate a town of guards to steal vehicles. To simulate this, the NPCs must not shoot as soon as BLUFOR is spotted but must be able to return fire when they notice the player/squad shooting them.

 

- Vehicles are then stolen, driven to an air field where the player/squad destroys some parked helicopters before making an ex-filtration. Again, the OFPOR NPCs must not shoot the player/BLUFOR on sight. Remember, we're in OPFOR vehicles and it is night so they can't tell that enemies are using their uniforms/gear until we open fire.

 

 

Any help in making the NPCs work correctly for such a mission would be helpful. Also, slightly less important topic, but how do I write text briefings? I am using EDEN to be clear.

 

 

Share this post


Link to post
Share on other sites

Units will never fire in Careless mode I think. Try setting them to Aware, so they can switch to Combat mode when required.

Share this post


Link to post
Share on other sites

Careless really do not care. Good for cut scenes or if you want a plane to fly straight and so on.

 

I think you need to play around with setcaptive or joinsilent.

Share this post


Link to post
Share on other sites

Seems odd because as I mentioned in the OP, different units with the same settings do entirely different things (shoot on sight or never shoot). Oh well, I have a more simple question now:

 

How can I make units activate a waypoint when certain units are dead? EX) I want to make helicopters come in for support after air defense units are destroyed, and when armor is destroyed transports will come in after that.

Share this post


Link to post
Share on other sites

One more bump. Still trying the following:

 

How can I make units activate a waypoint when certain units are dead? EX) I want to make helicopters come in for support after air defense units are destroyed, and when armor is destroyed transports will come in after that.

 

Been at this for hours with zero success. It takes seconds in every editor in every other game I've played. There is no excuse for the bullshit required for the most frequently used function in a mission editor.

Share this post


Link to post
Share on other sites

One more bump. Still trying the following:

 

How can I make units activate a waypoint when certain units are dead? EX) I want to make helicopters come in for support after air defense units are destroyed, and when armor is destroyed transports will come in after that.

 

Been at this for hours with zero success. It takes seconds in every editor in every other game I've played. There is no excuse for the bullshit required for the most frequently used function in a mission editor.

 

I haven't played around with Eden enough to know if there is a non-script way to do what you want, but here are some pointers from the traditional editor scripting.

 

I've tried all the things you're attempting at some point. The only element I'm not sure about is your use of enemy uniforms on your BLUFOR units. It may not be possible or how it behaves. I am sure there are MUCH more elegant ways of doing it all, but I'm crap at scripting, and this is how I got it to work for me :

- For making sure bad guys don't shoot at you, in the unit init or another trigger, use setcaptive :

unitname setcaptive true 

- For the enemy units you want to be become hostile when being shot at, you can use the firednear eventhandler in their init fields

this addeventHandler ["firednear",{unitname setcaptive false}]

The unitname is the name of your BLUFOR soldier.

 

- To activate a waypoint when specific units are dead, you can try putting this in the condition field for a waypoint :

(!alive unit1) && (!alive unit2) && (!alive unit3) && (!alive unit4)

The waypoint shouldn't fire until all those units are dead. Keep in mind, they need to be blown up. Disabled units won't count.

 

 

References :

https://community.bistudio.com/wiki/alive

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#FiredNear

https://community.bistudio.com/wiki/setCaptive

Share this post


Link to post
Share on other sites

I know this is an old post, but I'm new to this and figured I'd make a suggestion for future reference since the original question asked never got the right answer. So you have to set each unit themselves to the never fire "..." behavior as well not just the waypoints. I ran into the same issue and was trying different things to resolve it and this seems to work for me. I was making a mission where I have a n opfor dressed as civilian and needed him to not be fired upon as he'd run to the enemy camp to alert the opfor but be able to partake in defenses. Hope this helps everyone trying to figure this out.

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  

×