Jump to content
Sign in to follow this  
rommn

Make selective units not fire at certain targets?

Recommended Posts

I want to create a mission where the infantry ai would not target above helicopters, but would target enemy units. At the same time, I am trying to make the anti air units target the helicopters, so the setcaptive command won't work in this situation. Does anyone have any idea how to do this?

Thank you.

Share this post


Link to post
Share on other sites

So does anyone have a solution to this?

Share this post


Link to post
Share on other sites

Fabulous question but no I don't have a solution.

Share this post


Link to post
Share on other sites

From the lack of responses I'm going to assume that there are no solutions to this issue at the moment.

Share this post


Link to post
Share on other sites

Sorry if this answer is insufficient, but I don't have time right now, so hopefully it's at least a start.
 

_aiUnit = ...    //however the rifleman is initialized

_aiUnit spawn
{
    while {alive _this} do
    {
        scopeName "unitAliveScope";
        
        {
            if ((side _x != side _this) && {!((typeOf _x) isKindOf "Air")} && {_this distance _x < 200}) then
            {
                _this doTarget _x;
                _this doFire _x;
                waitUntil {sleep 3; !alive _this || {_this distance _x > 200} || {!alive _x}};
                breakTo "unitAliveScope";
            };
        } forEach (_this nearEntities 350);
    };
};

This will make the unit check for enemies in a radius of 350 meters. If it finds one which is not a plane or chopper and is closer than 200 meters, it will start to fire at that very unit until either unit (rifleman or target) dies or the distance is greater than 200m again.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks. I'll try this out when I get the chance.

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  

×