Arma 3
Overthrow [Outdated]
Zothen Jan 17, 2017 @ 5:42am
AI unstuck/reset?
Hello.
My AIs get stuck sometimes in structures, rocks, etc and I found no way to get the properly out of there.
Can you please add an unstuck and/or "reset to base" command?
Thankies.
< >
Showing 1-3 of 3 comments
TiKlon Jan 19, 2017 @ 12:10am 
Or dismiss or sell, I have like 7 or 8 teams stuck, the worst thing is that all number 3 comes without ammo, and the team leader keeps saying "...3 , reload" every 5 minutes
My AIs get constantly stuck over and over again and refuse to do anything.

Is there a solution to this?
It's borderline gamebreaking for me.

I'd rather have retarded AI over an AI script that has a chance of disabling an AI every 5 minutes.
Last edited by Swagmaster Love 🇪🇺; Apr 23, 2017 @ 4:39am
RickOShay Nov 25, 2017 @ 1:18am 
Occasionally AI team mates will get stuck either by glitching through terrain mesh or map object. This can be a mission breaker - especially where group player array count is used.
A way around this is to use a trigger for each npc character that checks the distance the AI unit is from the human team leader - player. Then when the distance is exceeded it teleports them to a random distance behind the player position and set the direction.

Here's a simple script that fixes that - it's the latest version and seems to work in most situations. Tested and evolved over a few years of experimentation.

To setup create one trigger per unit in Eden editor. Doesn't matter that some units will be players- trigger cond and script exits if unit == player. In this instance all units are named p1,p2,p3,p4..... with p1 the group leader and player. Save the script into your scripts folder under your mission folder.

Example Trigger:

Size: NA
Activation: Repeatable

Condition:
!isPlayer p2 && (p2 distance player) >= 120

Trigger: On Activation: (call the script)
null = [p2] execvm "scripts\aistuck.sqf";

ie. you're calling the script for each AI unit via a separate trigger passing the unit name to the script.

Create script in mission scripts folder and put this into it:

// AIstuck - By RickOSHay
// Teleports AI to group leader that are stuck or fall behind
// Where units are named p1,p2,p3.... P1 is player and group leader
// called via repeatable trigger:
// cond: ie.: !isPlayer p2 && p2 distance leader p2 >= 150;
// activation: nul = [p2] execvm "scripts\aistuck.sqf"; and so on for each trigger and unit.

_unit = _this select 0;
_Gleader = leader _unit;
_dir = direction _Gleader;
_pos = getposATL _Gleader;
_group = group _Gleader;

//if (isPlayer _unit) exitWith {};
if (!isnull _Gleader && isTouchingGround _Gleader && (_pos select 2 < 1)) then {
sleep 0.5;
// adjust the following condition if you don't want the AI to auto populate the vehicle you get
// into. ie. change to whole line below to: if (_Gleader == vehicle _Gleader) then {

if (_Gleader != vehicle _Gleader) then {_x moveInAny vehicle _Gleader} else {
_initpos = (_Gleader getPos [5 + random 10, direction _Gleader - 180]);
_pos = [_initpos, 2, 5, 3, 0, 20, 0] call BIS_fnc_findSafePos;
_unit setPosATL [_pos select 0, _pos select 1, 0];
_unit setDir _dir;
_unit switchMove "";
};

{[_x] joinsilent _group} foreach [p1,p2,p3,p4,p5,p6,p7,p8];
_group setFormation "wedge";
_unit setUnitPos "up";

};
Last edited by RickOShay; Nov 25, 2017 @ 1:22am
< >
Showing 1-3 of 3 comments
Per page: 1530 50