Arma 3
Ai join or leave group player
hi !

this is what i found to make ai join or leave group on arma 3 editor.
you have to put this line in the init of each unit.


this addaction ["Ai join group", { [unitname] join player; }];
this addaction ["Ai leave group", { [unitname] join grpNull; }];


You have to replace "unitname" by some different name if you want to make it work with many units.

"Ai join group" or "Ai leave group" : can be change to anything : Bob join group / get the f*ck out bob :steamhappy:

enjoy !
< >
Visar 1-4 av 4 kommentarer
Dankan37 1 dec, 2018 @ 13:28 
You could improve it by replacing "unitname" with the unit pointed by the player.

"cursorObject", of course you would need to check it it's "isKindOf "Man".
diveyez 6 dec, 2018 @ 21:02 
I was just in a situation where, I am bleeding out, and waiting for my heli extraction bird. I would like to take what you are doing a step further, and also make that AI into QRF Medivacs. That land, join group, heal the wounded, then load them and RTB.
I have automedic code I wrote, but I would not be able to make that happen, to a moving medivac bird without some advice. Cab you guys help?

*Additonal: I wrote the code specifically for AI ACE Medicals on Advanced.*
Senast ändrad av diveyez; 6 dec, 2018 @ 21:03
diveyez 6 dec, 2018 @ 21:10 
this addaction ["Ai join group", { [SARC_Medic] join player; }];
at which time, they should start the code I wrote correct?
OOster 26 apr, 2020 @ 7:11 
Here's an improvement, and a comprehensive breakdown I learned from Lou Montana on the Arma 3 Discord.

this addaction ["Your text here", // title

{ [Unit Name] join (Player); }, // script

nil, // arguments

1.5, // priority ( how high on your action window the script appears)

true, // showWindow

true, // hideOnUse (When you click the action the title disappears until you scroll to it again.)

"", // shortcut (A key stroke if you so choose)

"alive _target", // condition

3 // max distance for the action to display (In meters ofc, default is 50m)

];
------------------------------------------------------------------------------
end result for the units init:
------------------------------------------------------------------------------

this addAction ["Your text",{[Unit name] join player;},nil,1.5,true,true,"","alive Unit name",10];

this addAction ["Your text",{[Unit name] join grpNull;},nil,1.5,true,true,"","alive Unit name",10];

------------------------------------------------------------------------------

Basically now these two addActions allow you to, not only add or join AI to your squad, but now make the addActions disappear when the unit dies, and shorten the range which you can use the addActions :)
Senast ändrad av OOster; 26 apr, 2020 @ 7:45
< >
Visar 1-4 av 4 kommentarer
Per sida: 1530 50

Datum skrivet: 1 dec, 2018 @ 13:09
Inlägg: 4