Jump to content
Sign in to follow this  
Madmunchkin

AI Artillery - Only fire at command

Recommended Posts

Hello,

I want my AI artillery only fire at my command. I have a base in Camp Maxwell with Sholef and Seara artillery support in it and a mission to clear LZConnor nearby in line of sight to Camp Maxwell. Every time I want to do this mission my artillery is auto attacking every unit that gets spotted by me or by themselve. At the moment I solved that problem using

this setcaptive true;

at every OPFOR soldier at LZConnor but this causes my mission is set instantly to succeeded when entering the map cause my trigger that is set to "OPFOR is present" doesn't realize the OPFOR units in this area as OPFOR anymore.

I know I can solve this using !alive command but this would be a lot of work because i used the militarize script of the AI Spawn Script Pack to occupy LZConnor and some position nearby. I don't know the class names of the units this script randomly inserts at this positions for the !alive command at my trigger. So the easiest way to solve this problem would be to set my artillery to "only fire at command".

This is what I've tried until now:

 this setcombatmode

Using this, the only way to stop the AI from auto attack is "BLUE" but this prevents the AI from fireing even when I call for artillery support.

this setbehaviour

Tried everything but they are still auto attacking the enemy.

this setskill

Decreased their range of sight but they are still attacking if I spot an enemy or the enemy is shooting at their direction approximately.

this disableAI "AUTOTARGET"; this disableAI "TARGET"; this disableAI "FSM"

Doesn't seem to work, too.

Edited by Madmunchkin

Share this post


Link to post
Share on other sites

Place a scorcher or any other vehicle, no need to use a never fire ("BLUE") waypoint or the group setCombatMode "BLUE" code, its auto.

Sync it with provider module.

place this code in the vehicles init:

_null = this spawn {
_veh = vehicle _this;
_grp = (crew _veh) select 0;
while {true} do {
	_grp setCombatMode "BLUE";
	waitUntil { sleep 1; currentCommand _veh == "FIRE AT POSITION" };
	_grp setCombatMode "YELLOW";
	waitUntil { sleep 1; currentCommand _veh != "FIRE AT POSITION" };
};
};

Now place yourself and sync with a requester module.

What code does: sets arty to blue, wait for your arty req command, and sets it to yellow, then when rounds complete, goes back to blue again.

Edited by Demonized
scorcher or any other vehicle

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  

×