Jump to content
pognivet

How to make injured units leave their squad and join a new one

Recommended Posts

I want to do some medevac type thing so when someone gets extremely injured I want them to leave their squad and join a "wounded" squad with other injured people in anticipation of dustoff. Is this possible, especially with ACE?

Share this post


Link to post
Share on other sites

Yes this is possible.

 

Idk an ACE-solution but vanilla could be like:

_side = west; //preferred side
_allUnits = (allPlayers - entities "HeadlessClient_F") select {alive _x};
_allUnits append allUnits;

_injuredUnits = allUnits select {side _x isEqualTo _side && {damage _x > 0.5}};

_injuredGroup = createGroup _side;

{
 [_x] joinSilent _injuredGroup;
} count _injuredUnits;

EDIT: added vanilla solution

EDIT: corrected syntax for joinSilent

Edited by sarogahtyp

Share this post


Link to post
Share on other sites

[_x] joinSilent _injuredGroup

 

And add a loop if you spawn units.

  • Like 1

Share this post


Link to post
Share on other sites

Great contributions. Those look great for vanilla use.

 

Obviously ACE is a pain in the ass, but I'm sure there's a way. I'll try doing some experimentation myself and report back.

 

Anyone have any idea on how to make one AI drag/carry another AI or use the ACE system to heal them? How about putting them in body bags or loading wounded/dead into vehicles? I couldn't find anything on ACE's framework/website about it. Any help would be much appreciated. It doesn't matter too much if the action is "faked". As long as it's done and looks normal enough to the player.

 

I'm working on a very special mission. 🤡

Share this post


Link to post
Share on other sites
On 4/23/2019 at 5:14 AM, sarogahtyp said:

Yes this is possible.

 

Idk an ACE-solution but vanilla could be like:


_side = west; //preferred side
_allUnits = (allPlayers - entities "HeadlessClient_F") select {alive _x};
_allUnits append allUnits;

_injuredUnits = allUnits select {side _x isEqualTo _side && {damage _x > 0.5}};

_injuredGroup = createGroup _side;

{
 _x joinSilent _injuredGroup;
} count _injuredUnits;

EDIT: added vanilla solution

_allUnits seemingly to be only players in this script. This doesn't work for AI, am I correct?

Share this post


Link to post
Share on other sites
6 minutes ago, pognivet said:

_allUnits seemingly to be only players in this script. This doesn't work for AI, am I correct?

No it should work for AI the line

_allUnits append allUnits;

appends all AI to the array.

but you have to change  this line

_x joinSilent _injuredGroup;

to this:

[_x] joinSilent _injuredGroup;

 

Share this post


Link to post
Share on other sites

Thanks for all the help. I got one problem though.

 

When using ACE and a unit gets injured their "damage" is always at 0. The only time this changes is when they're dead at which time it changes to 1.

 

Is there any way to detect whether or not an ACE unit is injured in any way? By using just vanilla scripting as far as I can see you can only detect when they're dead. Maybe there's a workaround that I don't know about?

 

I thought about using "ace_unconscious" so units injured enough to be knocked out are considered so fucked up that they're out of action, but it seems somewhat unreliable.

Share this post


Link to post
Share on other sites

if you can't get an answer here then try an ACE-community ...

maybe this:

 

ACE3 Public Chat
 

Quote

Join our public chat! We're glad to answer questions concerning ACE3, development or Arma things.
If you made something with this mod (screen shots, artwork, videos) we'd love to see it.

 

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

×