Jump to content
Sign in to follow this  
Gil Galvanti

Stop AI Firing?

Recommended Posts

Hey,

Is there any way to get the AI to immediately stop firing their weapon after using the doFire command? The only thing I've found to work is "disableAI "ANIM"", but as soon as you enable it again they continue firing. If you use doStop, they finish with the current clip they are shooting before stopping. Is there not a way to immediately stop the AI?

Also on topic, is there a way to stop a civ AI from holstering their pistol? I tried setting behaviour to combat, but it didn't work.

Edited by Gil Galvanti

Share this post


Link to post
Share on other sites

Uh.. Just about the firing, small work around here..

1. Tried to set the behavoiur to carless?

2. Work around = Remove the ammo of their guns?

Share this post


Link to post
Share on other sites

need solution for this also.. whats better than remove ammo and setcaptive?

when i remove ammo from tank they still fire with machine gun.

Share this post


Link to post
Share on other sites

Kill them! :)

Or what Joshii said, didn't BIS just add a way to give a mag with only a certain amount of shots in it? doTarget and doFire used to work really well, lately though something changed and they don't work that great for the "cover this guy" or "assassinate this guy" kind of animations.

Share this post


Link to post
Share on other sites

If you didn't solve the problem yet and are proficient with writing weapon configs, you could consider making a little addon that introduces

a new magazine and ammo class with a insanely high cost value, so the AI would consider the targets not "worthy" enough firing at them when you

addmagazine that magazine to their weapons and remove grenades and secondary weapons. This is mainly to prevent an "Out of ammo" message,

if it's for a cutscene then you could do what was suggested here before.

Or you could monolaterally setfriendly the target side to friendly for the time in question.

Share this post


Link to post
Share on other sites

the remove ammo is ok solution but I found that when applied to abram tank its still firing with it's Machinegun. so can you remove all the ammo as well give them all back?

Share this post


Link to post
Share on other sites

Have you tried just giving them something else to shoot at. An object that has been made invisible should work.

place an object and name him invman

in the init

this hideobject true

then when you want your gunner to stop firing

gunman dotarget invman;

I tried objnull but it had no effect.

you can just use a gamelogic, no need for hideobject. It doesn't even need to be anywhere near the action.

Also how are you getting a tank to fire using dofire, nothing ever happens when I try it.

Edited by F2k Sel

Share this post


Link to post
Share on other sites
the remove ammo is ok solution but I found that when applied to abram tank its still firing with it's Machinegun. so can you remove all the ammo as well give them all back?

_tankMags = (magazines TankName);
_tankTurretMags = (TankName magazinesTurret [0,0]);


[color="#B22222"]//--- Removing all of the tank's ammo[/color]

{TankName removeMagazine _x} forEach _tankMags;
{TankName removeMagazinesturret [_x,[0,0]]} forEach _tankTurretMags;

[color="#B22222"]
//--- Giving it all back[/color]

{TankName addMagazine _x} forEach _tankMags;
{TankName addMagazineTurret [_x,[0,0]]} forEach _tankTurretMags;

Share this post


Link to post
Share on other sites

setting everyone to Captive with setCaptive seems to work well also.

Share this post


Link to post
Share on other sites
If you didn't solve the problem yet and are proficient with writing weapon configs, you could consider making a little addon that introduces

a new magazine and ammo class with a insanely high cost value, so the AI would consider the targets not "worthy" enough firing at them when you

addmagazine that magazine to their weapons and remove grenades and secondary weapons. This is mainly to prevent an "Out of ammo" message,

if it's for a cutscene then you could do what was suggested here before.

Or you could monolaterally setfriendly the target side to friendly for the time in question.

I wonder if there's a possibility of "ramping up" the cost per magazine based on reserves? I often see AI just shoot all their reserves for little gain - if there was some sort of ramping cost maybe they'd employ some sot of pseudo-intelligent conservation routine.

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  

×