Havoc302

A3XAI DefendOnly

8 posts in this topic

So I've been looking through the A3XAI files and found the below, it apparently lets you set them to defensive only, which I'd like to do, anyone worked out how it works though? I can't see where you'd tell a group that it's supposed to be defensive.

Spoiler

#include "\A3XAI\globaldefines.hpp"

private ["_action", "_unitGroup"];

_action = _this select 1;
_unitGroup = _this select 0;

if (_action isEqualTo "IgnoreEnemies") exitWith {
    _unitGroup setBehaviour "CARELESS";
    _unitGroup setCombatMode "BLUE";
    {_x doWatch objNull} forEach (units _unitGroup);

    true
};

if (_action isEqualTo "Behavior_Reset") exitWith {
    _unitGroup setBehaviour "AWARE";
    _unitGroup setCombatMode "YELLOW";

    true
};

if (_action isEqualTo "DefendOnly") exitWith {
    _unitGroup setBehaviour "AWARE";
    _unitGroup setCombatMode "GREEN";
    {_x doWatch objNull} forEach (units _unitGroup);

    true
};

false

 

It's in the compiles\A3XAI_forceBehaviour.sqf file.

Share this post


Link to post
Share on other sites

Found a way to do it globally, in A3XAI_spawnGroup.sqf you can change line 66 to _unitGroup setSpeedMode "NORMAL"; and that'll mean they only fire if fired upon. Can't figure out how to use the built in one though.

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Tried this. They're still aggressive, and shot at me first. :(
Does this file reside elsewhere? What is the full path to this file?

Share this post


Link to post
Share on other sites

You should look at switching to Exile Occupation by @second_coming. It's a much better AI system and if you set it to 100% Survivor chance, they'd be set to defend only.

 

2 people like this

Share this post


Link to post
Share on other sites

Yeah we tried Exile Occupation but it broke when we tried to give it defined spawn locations rather than using map names.

We haven't experimented with making A3XAI friendly yet but I did notice there's more than one file that you need to change the behaviour in, basically every file that has a setBehaviour in it.

 

Share this post


Link to post
Share on other sites
4 hours ago, Havoc302 said:

Yeah we tried Exile Occupation but it broke when we tried to give it defined spawn locations rather than using map names.

We haven't experimented with making A3XAI friendly yet but I did notice there's more than one file that you need to change the behaviour in, basically every file that has a setBehaviour in it.

 

The static spawns were broken a short while a go but they're working great now. :D

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

I saw this so I went on my test server after opening every single file in A3XAI and changing every occurrence of "setCombatMode" to "GREEN" (defend only), and they still attack. The 1.58 update has damn made it useless without further development. Doesn't help that it is no longer supported either. 

Edited by oSoDirty

Share this post


Link to post
Share on other sites
14 hours ago, oSoDirty said:

I saw this so I went on my test server after opening every single file in A3XAI and changing every occurrence of "setCombatMode" to "GREEN" (defend only), and they still attack. The 1.58 update has damn made it useless without further development. Doesn't help that it is no longer supported either. 

Hold Fire - The leader will order the group to hold fire and disengage (CombatMode "Green"). Individual units will open fire on any enemy units that are both aware of their individual presence and can harm them.

I think you would have to mess around with making them friendly to sides rather then combatmode.

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.