Arma 3
Go Go Go & Move Faster Modes
Ibragim  [developer] 14 Nov, 2021 @ 8:21pm
Code for AI groups to use in WP Activation
IBR_ACC_AI_ANIM_SPEED_COEF = 0.2; Ibr_AI_fn_gogogo_combat_mode = { params ["_units"]; if (count _units == 0) exitWith {}; _targets = (leader (group (_units select 0))) targets [true, 1000, [], 0]; { (group (_units select 0)) forgetTarget _x; } forEach _targets; { [_x] spawn Ibr_AI_fn_dasableAI_in_gogogo_mode; } forEach _units; }; Ibr_AI_fn_dasableAI_in_gogogo_mode = { params ["_unit"]; { _unit disableAI _x; } forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"]; _speedCoef = getAnimSpeedCoef _unit; _unit setSpeedMode "FULL"; _mode = "BLUE"; _behaviour = "AWARE"; _unit setUnitCombatMode _mode; _unit setCombatBehaviour _behaviour; _unit setAnimSpeedCoef _speedCoef + IBR_ACC_AI_ANIM_SPEED_COEF; group _unit setCombatMode _mode; group _unit setBehaviourStrong _behaviour; sleep 0.1; waitUntil { _unit doTarget objNull; !(combatMode _unit in [_mode]) || !(behaviour _unit in [_behaviour]); }; _behaviour = behaviour (leader group _unit); { _unit enableAI _x; } forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"]; group _unit setCombatMode "YELLOW"; group _unit setBehaviourStrong _behaviour; { _x setUnitCombatMode "YELLOW"; _x setCombatBehaviour _behaviour; } forEach units group _unit; _unit setAnimSpeedCoef _speedCoef; }; [units group this] spawn Ibr_AI_fn_gogogo_combat_mode;



Этот код работает исправно, ниже уже не актуальная дискуссия.
This code works fine, the discussion below is no longer relevant.



Режим Двигай! прекращается сменой режима боя или режима огня.
Go Go Go! combat mode is terminated by changing the combat mode or behaviour.
Last edited by Ibragim; 1 Dec, 2021 @ 7:51pm
< >
Showing 1-15 of 19 comments
RayyaViper 16 Nov, 2021 @ 9:30am 
hi, can i use this in zeus ?
Ibragim  [developer] 16 Nov, 2021 @ 9:38am 
I do not use it.
MaeshimaR 23 Nov, 2021 @ 4:13am 
thank you so much it help me a lot , sorry for I cannot understand scripts above, if I named the group leader with name "a1" and the team called "g1", and then place a move waypoint , what I need to write in its on activation box? Thanks
Ibragim  [developer] 23 Nov, 2021 @ 5:51am 
Originally posted by MaeshimaR:
thank you so much it help me a lot , sorry for I cannot understand scripts above, if I named the group leader with name "a1" and the team called "g1", and then place a move waypoint , what I need to write in its on activation box? Thanks
Make additional WP MOVE on group position and copy this script in onActivation by changing arguments in the last line like this:
[units g1] spawn Ibr_fn_gogogo_combat_mode;
Then make second WP at position your wish and they will move there in gogogo mode.
To exit gogogo mode, change group's combat mode or beheviour.
MaeshimaR 24 Nov, 2021 @ 8:01am 
Originally posted by Ibragim:
Originally posted by MaeshimaR:
thank you so much it help me a lot , sorry for I cannot understand scripts above, if I named the group leader with name "a1" and the team called "g1", and then place a move waypoint , what I need to write in its on activation box? Thanks
Make additional WP MOVE on group position and copy this script in onActivation by changing arguments in the last line like this:
[units g1] spawn Ibr_fn_gogogo_combat_mode;
Then make second WP at position your wish and they will move there in gogogo mode.
To exit gogogo mode, change group's combat mode or beheviour.
Thank you for replying, I did like that . Most of AI behavior was fine ,AI could ignore enemy and rush to WP. however, there is a problem that once enemy firing to group , AI group stop running and shooting to enemy...if gogogo mode set from player command menu this problem won`t appear.
Following steps are what I did:
1.Placing a 3 men group and select all of them given a name "g1"
2.Placing a move WP with scripts in its OnActivation:
Ibr_fn_gogogo_combat_mode =
{
params ["_units"];

if (count _units == 0) exitWith {};

_targets = (leader (group (_units select 0))) targets [true, 1000, [], 0];
{
(group (_units select 0)) forgetTarget _x;
} forEach _targets;

{
[_x] spawn Ibr_fn_dasableAI_in_gogogo_mode;
} forEach _units;
};

Ibr_fn_dasableAI_in_gogogo_mode =
{
params ["_unit"];

{
_unit disableAI _x;
} forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"];

_speedCoef = getAnimSpeedCoef _unit;
_unit setSpeedMode "FULL";
_mode = "BLUE";
_behaviour = "AWARE";

_unit setUnitCombatMode _mode;
_unit setCombatBehaviour _behaviour;
_unit setAnimSpeedCoef _speedCoef + IBR_ACC_ANIM_SPEED_COEF;

waitUntil
{
sleep 0.5;

!(unitCombatMode _unit in [_mode])
||
!(combatBehaviour _unit in [_behaviour]);
};

{
_unit enableAI _x;
} forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"];

if (unitCombatMode _unit in [_mode]) then
{
_unit setUnitCombatMode "YELLOW";
};

_unit setAnimSpeedCoef _speedCoef;
};

[units g1] spawn Ibr_fn_gogogo_combat_mode;
3.Placing the other move WP

Where I did wrong? Thank you so much.
Ibragim  [developer] 24 Nov, 2021 @ 8:07am 
It seems to me that the problem is that the leader of their group independently gives them new orders, and therefore they open fire. Try adding these to the disabled abilities:
"TARGET"
"FSM"
"CHECKVISIBLE"

For example:

["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM","TARGET"]
MaeshimaR 25 Nov, 2021 @ 3:46am 
Originally posted by Ibragim:
It seems to me that the problem is that the leader of their group independently gives them new orders, and therefore they open fire. Try adding these to the disabled abilities:
"TARGET"
"FSM"
"CHECKVISIBLE"

For example:

["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM","TARGET"]
Thank you , I`m with the same idea, when AI get enemy fired I can clearly hear the team leader said "weapons arm". I tried disabled these elements however nothing get changed , AI still open firing...
Ibragim  [developer] 25 Nov, 2021 @ 5:00am 
Ok, try to replace waitUntil block with this one and try again:

waitUntil
{
sleep 0.1;

_targets = _unit targets [true];

{_unit forgetTarget _x} forEach _targets;

!(unitCombatMode _unit in [_mode])
||
!(combatBehaviour _unit in [_behaviour]);
};
MaeshimaR 25 Nov, 2021 @ 5:25am 
Originally posted by Ibragim:
Ok, try to replace waitUntil block with this one and try again:

waitUntil
{
sleep 0.1;

_targets = _unit targets [true];

{_unit forgetTarget _x} forEach _targets;

!(unitCombatMode _unit in [_mode])
||
!(combatBehaviour _unit in [_behaviour]);
};
Thanks a lot ,AI still take reaction towards enemy but get improved. AI won`t open fire immediately when shot by enemy , AI could keep running for nearly 2 seconds and then fire to enemy. Whole team could keep firing while moving front. I guess is it possible to force AI change in careless mode and force its speed in max? Appreciate .
Ibragim  [developer] 25 Nov, 2021 @ 6:05am 
Delete

sleep 0.1;

in waitUntil block and also add to it:

_unit doTarget objNull;
MaeshimaR 25 Nov, 2021 @ 6:38am 
Originally posted by Ibragim:
Delete

sleep 0.1;

in waitUntil block and also add to it:

_unit doTarget objNull;
It`s working perfectly !:steamhappy:Cheers mate:steamhappy:You make my dream come true:)
MaeshimaR 29 Nov, 2021 @ 5:29am 
Hello mate , I am facing the other problem , AI seems cannot exit gogogo mode called by scripts, I tried change AI`s behavior and combat mode. Changing behavior nothing happened , changing combat mode could let AI do aiming to enemy but cannot open fire... how can I let AI return to regular mode? Thanks a lot.
Ibragim  [developer] 29 Nov, 2021 @ 5:58am 
Try this script:
Ibr_fn_gogogo_combat_mode = { params ["_units"]; if (count _units == 0) exitWith {}; _targets = (leader (group (_units select 0))) targets [true, 1000, [], 0]; { (group (_units select 0)) forgetTarget _x; } forEach _targets; { [_x] spawn Ibr_fn_dasableAI_in_gogogo_mode; } forEach _units; }; Ibr_fn_dasableAI_in_gogogo_mode = { params ["_unit"]; { _unit disableAI _x; } forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"]; _speedCoef = getAnimSpeedCoef _unit; _unit setSpeedMode "FULL"; _mode = "BLUE"; _behaviour = "AWARE"; _unit setUnitCombatMode _mode; _unit setCombatBehaviour _behaviour; _unit setAnimSpeedCoef _speedCoef + IBR_ACC_ANIM_SPEED_COEF; group _unit setCombatMode _mode; group _unit setBehaviourStrong _behaviour; sleep 0.1; waitUntil { _unit doTarget objNull; !(combatMode group _unit in [_mode]) || !(behaviour group _unit in [_behaviour]); }; { _unit enableAI _x; } forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"]; if (unitCombatMode _unit in [_mode]) then { group _unit setCombatMode "YELLOW"; }; _unit setAnimSpeedCoef _speedCoef; }; [units group _group] spawn Ibr_fn_gogogo_combat_mode;

Exit it by changing the whole group combat mode (to green, white, yellow or red) or behaviour (to safe, combat or stealth).
MaeshimaR 29 Nov, 2021 @ 6:24am 
Originally posted by Ibragim:
Try this script:
Ibr_fn_gogogo_combat_mode = { params ["_units"]; if (count _units == 0) exitWith {}; _targets = (leader (group (_units select 0))) targets [true, 1000, [], 0]; { (group (_units select 0)) forgetTarget _x; } forEach _targets; { [_x] spawn Ibr_fn_dasableAI_in_gogogo_mode; } forEach _units; }; Ibr_fn_dasableAI_in_gogogo_mode = { params ["_unit"]; { _unit disableAI _x; } forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"]; _speedCoef = getAnimSpeedCoef _unit; _unit setSpeedMode "FULL"; _mode = "BLUE"; _behaviour = "AWARE"; _unit setUnitCombatMode _mode; _unit setCombatBehaviour _behaviour; _unit setAnimSpeedCoef _speedCoef + IBR_ACC_ANIM_SPEED_COEF; group _unit setCombatMode _mode; group _unit setBehaviourStrong _behaviour; sleep 0.1; waitUntil { _unit doTarget objNull; !(combatMode group _unit in [_mode]) || !(behaviour group _unit in [_behaviour]); }; { _unit enableAI _x; } forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"]; if (unitCombatMode _unit in [_mode]) then { group _unit setCombatMode "YELLOW"; }; _unit setAnimSpeedCoef _speedCoef; }; [units group _group] spawn Ibr_fn_gogogo_combat_mode;

Exit it by changing the whole group combat mode (to green, white, yellow or red) or behaviour (to safe, combat or stealth).
Thanks mate , it`s working great to let the team leader exist mode immediately , just a little problem that it seems only half on team member could exit the gogogo mode , some crews still keep in gogogo mode unless the team leader get killed to enable them exit the mode.
Ibragim  [developer] 29 Nov, 2021 @ 6:44am 
Try this:
Ibr_fn_gogogo_combat_mode = { params ["_units"]; if (count _units == 0) exitWith {}; _targets = (leader (group (_units select 0))) targets [true, 1000, [], 0]; { (group (_units select 0)) forgetTarget _x; } forEach _targets; { [_x] spawn Ibr_fn_dasableAI_in_gogogo_mode; } forEach _units; }; Ibr_fn_dasableAI_in_gogogo_mode = { params ["_unit"]; { _unit disableAI _x; } forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"]; _speedCoef = getAnimSpeedCoef _unit; _unit setSpeedMode "FULL"; _mode = "BLUE"; _behaviour = "AWARE"; _unit setUnitCombatMode _mode; _unit setCombatBehaviour _behaviour; _unit setAnimSpeedCoef _speedCoef + IBR_ACC_ANIM_SPEED_COEF; group _unit setCombatMode _mode; group _unit setBehaviourStrong _behaviour; sleep 0.1; waitUntil { _unit doTarget objNull; !(combatMode group _unit in [_mode]) || !(behaviour group _unit in [_behaviour]); }; _behaviour = behaviour (leader group _unit); { _unit enableAI _x; } forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"]; group _unit setCombatMode "YELLOW"; group _unit setBehaviourStrong _behaviour; { _x setUnitCombatMode "YELLOW"; _x setCombatBehaviour _behaviour; } forEach units group _unit; _unit setAnimSpeedCoef _speedCoef; }; [units group _group] spawn Ibr_fn_gogogo_combat_mode;
< >
Showing 1-15 of 19 comments
Per page: 1530 50