Jump to content
Sign in to follow this  
f2k sel

setCombatMode problem

Recommended Posts

I've set a unit up for stealth and combatmode green hold fire.

The problem is he opens fire at 200meters away, I thought he should wait for a command or for someone to fire upon him.

If I set it to blue he never fires but that's not much use as I need him to return fire.

Is the command broken?

killer this setbehaviour "Stealth";killer setCombatMode "green"

Share this post


Link to post
Share on other sites

The commands arent making the AI deaf, blind and retarded. He will hear you, see you and fire upon you (green is more like "hold this position and defend, dont run away fighting the enemy" I think).

So I think its working as intended.

Share this post


Link to post
Share on other sites

I did a little test and set two sides up and if I'm the leader of the group and use a trigger to set the command to hold fire the units respond and won't fire.

If I remove myself from the group and leave to the AI they open fire.

Shouldn't we have a simple command to stop the AI firing unless fired upon, how can you really make a sneaky AI mission without turning of important routines.

Share this post


Link to post
Share on other sites

Well the AI not firing on you doesnt make it sneaky, it just make it retarded... Do you want it to stare at you when you run up to it and dance around?

Have you tried crawling towards an AI unit (from the back) set up like this?

Share this post


Link to post
Share on other sites
Well the AI not firing on you doesnt make it sneaky, it just make it retarded... Do you want it to stare at you when you run up to it and dance around?

Have you tried crawling towards an AI unit (from the back) set up like this?

What I want is for them to sneak into position rather than opening fire from 200meters.

I want them to wait for all of the units to be in position without having to write loads of stupid checks.

It makes it difficult to plan an ambush correctly.

Another problem seems to be if you do put them on "hold fire" and later issue a "fire at will" they don't always open fire unless you get to about the 200m mark.

The whole combatmode command seems floored.

Share this post


Link to post
Share on other sites

The whole Ai is floored mate, I was hoping for better Ai in A2 but its the same old story, unfortunately.

However, there are a few things you could try. Combat Mode - "Hold fire, engage at will". Behaviour - "Careless". Now you would expect that the careless command would mean that the units are, well, careless and don't care, but it seems in A2 that if a unit is in careless mode and gets spotted he suddenly cares and will open fire. Well i say suddenly, suddenly isn't always the case. The time between the enemy spotting the "Careless" unit and the careless units becoming aware of the danger can take a second or two, this more often then not results in the careless unit dying first, but this method should get your units into place without them opening fire untill fired on.

Once your units are in place you could use a radio command to set all untis to combat mode. i.e Killer setbehaviour "Combat"; Killer2 setbehaviour "Combat"; etc etc.

Give that a try and see what happens.

Krutish.

Share this post


Link to post
Share on other sites

thanks guys, I'll keep those ideas in hand, At the moment I'm not doing missions just relearning all the stuff I've forgotten.

I'm also trying to find out where the limits are, ther's no use planning a great mission when stuff can't be done.

For me though "hold fire" should mean just that, it really isn't much use unless they do. If you want AI to hold position then you can use a waypoint there is a command for that.

I'll fill in a bug report they make take notice for Arma3.

Share this post


Link to post
Share on other sites
I'll fill in a bug report they make take notice for Arma3.

Arma3, you're being optimistic aren't you :) The only improvements in Ai that I've noticed over the last 8 years is they can now step over objects.

It's one small step for Ai one giant leap for BIS!

Krutish.

Share this post


Link to post
Share on other sites

I believe the way the hold fire command works is that the unit on hold fire will return fire if he has been detected which doesn't mean that the enemy fired on him only that they spotted him.

Its the same situation as when you are commanding them. If you set them to hold fire they will open fire if someone sees them.

At least this is what I think is happening.

Share this post


Link to post
Share on other sites
I believe the way the hold fire command works is that the unit on hold fire will return fire if he has been detected which doesn't mean that the enemy fired on him only that they spotted him.

Its the same situation as when you are commanding them. If you set them to hold fire they will open fire if someone sees them.

At least this is what I think is happening.

Correct.

Units with combatMode "GREEN" (hold fire) will switch to combatMode "YELLOW" (= open fire ) when fired upon and /or simply detected by the enemy.

Units with combatMode "WHITE" (hold fire, engage at will) will switch to combatMode "RED" (= open fire, engage at will ) under the same condition.

Nothing broken here, IMHO.

Share this post


Link to post
Share on other sites

Open fire when fired upon is correct but how can they know when I've spotted them if I'm not firing?

The only way they should know is when I start shooting.

My men of course always know where the enemy are as they can see through hills and woods which makes the command redundant as it always turns the other sides status to yellow.

We could really use hold "fire until" and then a distance or fired upon command.

Ok not broken but very limited.

Share this post


Link to post
Share on other sites

it is really stupid, if it says hold fire until fired upon then thats what it should do or its broken. IF this is a mil sim then you should be able to tell your units to obey the rules of engagment since that is what these commands are supposed to represent.

Share this post


Link to post
Share on other sites
it is really stupid, if it says hold fire until fired upon then thats what it should do or its broken. IF this is a mil sim then you should be able to tell your units to obey the rules of engagment since that is what these commands are supposed to represent.

So u would let an armed guy run towards you and shoot you point blank in the head because you officer gave you a do not fir unless fired upon order ?

There are alot of tricks you can script and stuff to make the AI respond or not respond until certain conditions are applied.

Personally i would remove the AI's ammo until the player is within a certain distance or like other posts said disableAI is there for a reason :)

Share this post


Link to post
Share on other sites
So u would let an armed guy run towards you and shoot you point blank in the head because you officer gave you a do not fir unless fired upon order ?

There are alot of tricks you can script and stuff to make the AI respond or not respond until certain conditions are applied.

Personally i would remove the AI's ammo until the player is within a certain distance or like other posts said disableAI is there for a reason :)

well im trying to make a mission where the ai follow a truck and defend it. The civilians on the independent side are not even armed most of the time and they occasionaly walk past and the ai guarding the truck, under combat mode green they will shoot on sight everyone on a side that is enemy. Even if the civs are unarmed. Under combat mode green the description is not fire unless fired upon so it's totally wrong, or its totally bugged I guess that is in the eye of the beholder.

Since sometimes the civs players will attack the truck and troops (these are real players on mutli server so i can't set a trigger for a time or place) none of the other options will work in this case, that I know of. Unless of course this combat mode stuff worked like it says it should.

Another example is having a front line, like a border between two countries, with troops on either side, you would like to tell your troops to not fire unless fired upon. I know that you could use captive and setfriend, captive but those are not ideal for most situations , captive will set your unit to not get shot at but will still shoot the enemy. Setfriend works on the entire side, which is rarely what you want to do.

Edited by pwnstar23

Share this post


Link to post
Share on other sites

_grp1 = _this select 0;
_grp1 setcombatmode "blue";
_cnt1 = 0;
while {_cnt1 == 0} do
{
{
if ((damage _x) > 0) then {_cnt1 = 1};
} foreach units _grp1;
sleep 0.2;
};
_grp1 setcombatmode "yellow";

Off the top of my head, that'll make the group passed to the script hold fire utterly until one of them gets hurt, then they get to fire back.

Share this post


Link to post
Share on other sites

except they won't move while civs are around cause they will be to occupied being in combat mode (just not shooting), and pointing there guns at the civs. Which is yet another problem with ai.

Edited by pwnstar23

Share this post


Link to post
Share on other sites
except they won't move while civs are around cause they will be to occupied being in combat mode (just not shooting), and pointing there guns at the civs. Which is yet another problem with ai.

Well why the hell are you making unarmed civilians enemies? Your problem is more of bad mission design it seems. If a civilian is unarmed, you should at least setCaptive it, it's just not proper to keep an unarmed person looking like a hostile.

Share this post


Link to post
Share on other sites

my design may not be the greatest but its not nearly as bad as the BIS's design of the ai.

Well why the hell are you making unarmed civilians enemies? Your problem is more of bad mission design it seems. If a civilian is unarmed, you should at least setCaptive it, it's just not proper to keep an unarmed person looking like a hostile.

It's cause after the soldiers are gone a unarmed civ can still steal the money from inside the truck. A unarmed civ is still very dangerous, they can run over the soldiers break the kamaz's tires, plant bombs (IED's). Again if the green mode did what it actually says it does, then this wouldn't be a problem. But then again the ai isn't smart enough to realize this either and under captive they would not return fire even as the civs run there friends over one by one, so whatever. Discussion over..

Edited by pwnstar23

Share this post


Link to post
Share on other sites
But then again the ai isn't smart enough to realize this either and under captive they would not return fire even as the civs run there friends over one by one, so whatever. Discussion over..

Look. SetCombatMode does as it's supposed to. You have to find ways in your mission to take care of how the AI should react to the civilians. It makes sense that if you make all your civilians hostile and don't use setCaptive, the AI are going to treat them as enemies regardless. It looks like what you want is for the AI to only fire on enemies that are "threats"; I'm sorry but that would cause even more problems. If you are going to make missions you are going to have to realize what you are responsible for yourself as the mission maker.

Now, if you want a solution, you should look into using setCaptive when the civilians are acting like normal civilians, and cancel their captive status when they do something hostile (such as running over your soldiers). But expecting this behavour by default is just taking away too much control from the mission makers.

Share this post


Link to post
Share on other sites

yes cause it makes perfect sense, making everyone the as a prisoner of your military makes perfect sense that is absolute perfect design! YA BALLZ! For a mil sim this thing has a real hard time simulating what everyone's military actually does most the time and thats walk around and not shoot everything that moves. PWNED, want some more?

Share this post


Link to post
Share on other sites

hello all just wanted to second Big Dogs Setcaptive switch trick it is the most cut and dry way in this situation while ArmA 2 is intended to be a mil sim geared toward realism you will never get a real life simulation unless you use PvP elements or join the "insert branch here" .(No Game) can do it 100% the code Bis has does what they intended it to do.That being said there may be another way to do this that I will look into tonight that is script based, I will post in the morning with the results Going to try to keep reseting the guys to hold fire until you need the loop broken.I do think it will be more trouble than its worth but I need the practice.

Cheer's ChefD

Share this post


Link to post
Share on other sites
except they won't move while civs are around cause they will be to occupied being in combat mode (just not shooting), and pointing there guns at the civs. Which is yet another problem with ai.

Then just adapt the script I've given you to cover the civilians in the area too - when it removes combatMode "blue" from the soldiers, make it also setCaptive FALSE on the civvies.

It'd take you thirty seconds.

Share this post


Link to post
Share on other sites
yes cause it makes perfect sense, making everyone the as a prisoner of your military makes perfect sense that is absolute perfect design! YA BALLZ! For a mil sim this thing has a real hard time simulating what everyone's military actually does most the time and thats walk around and not shoot everything that moves. PWNED, want some more?

Your gonna have to sit back and think about your mission - having all those enemy civ's about is gonna make the soldiers act wierd - there are loads of ways to script this, you just need to work out what works best for your mission and test, test, test :)

---------- Post added at 08:39 AM ---------- Previous post was at 08:16 AM ----------

It's cause after the soldiers are gone a unarmed civ can still steal the money from inside the truck. A unarmed civ is still very dangerous, they can run over the soldiers break the kamaz's tires, plant bombs (IED's). Again if the green mode did what it actually says it does, then this wouldn't be a problem. But then again the ai isn't smart enough to realize this either and under captive they would not return fire even as the civs run there friends over one by one, so whatever. Discussion over..

this is how it works - the AI leader will change conditions depending on what situation he is in - so if you set him to not fire he wont fire until he detects the enemy and then and only then will he change his orders to attack the enemy and fire at will, after the fight the AI leader will revert back to his original settings and carry on with his duties..

What u have to remember is AI has been researched a lot longer than BIS has been around so what BIS has achieved in 9 years for a game/sim is pretty impressive if you ask me :)

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  

×