Jump to content
thy_

[SOLVED] Prevent the civilian parachuter, when landing, from walking in a crouch

Recommended Posts

When I create blufor units in the air, and make them use parachutes to touch the ground safely, everything runs fine, but if I do the same with civilians, the civilian units get panic (guess)!

The same happens if I use ZEUS to throw the civilian in the air. Their parachute is opened and, when they touch the ground, they're crouched.

 

What I want:

That civilian parachuters when on land, walk normally, in the "UP" position. 

 

 

My snippet:

Right before the CIVILIAN unit is created in the air, falling down from 1km altitude with a parachute bag:

_grp setBehaviourStrong "CARELESS";
_grp allowFleeing 0;
{
    _x setBehaviour "CARELESS";
    _x disableAI "FSM";
  
} forEach units _grp;

After landing:

{
    // Wait the own unit (_x) touch the ground if not yet:
    waitUntil { sleep 3; (getPos _x select 2) < 0.2 || !alive _x };
    sleep 2;
    _x enableAI "FSM";
    _x switchmove "";
    _x setUnitPos "UP";
    //_x setUnitPosWeak "UP"; 
  
} forEach units _grp;

 

The bad result: always the civilian units are walking in a crouch, even if there's no opfor, blufor, or independent on the map.

image.png

 

 

Commands I'm using:

https://community.bistudio.com/wiki/setBehaviourStrong

https://community.bistudio.com/wiki/allowFleeing

https://community.bistudio.com/wiki/disableAI

https://community.bistudio.com/wiki/setUnitPosWeak

https://community.bistudio.com/wiki/setUnitPos

https://community.bistudio.com/wiki/switchAction

 

 

Share this post


Link to post
Share on other sites

Maybe it could make any difference if you disable civilians' damage until they reach the ground... ?
Let´s say use " _x allowDammage false; " in the first part and " _x allowDammage true; " inside the "waitUntil" part.

I was also thinking about using 'setCaptive true", but then remembered that civilians are already recognized as captives by default.

And you have probably already tried using "setCombatBehaviour" instead...

==========

EDIT: by the way, recently someone has posted in a thread regarding to avoid AI to go prone while inside buildings. Maybe you can find something for your case there as well (they used _x setUnitPos "UP";  https://community.bistudio.com/wiki/setUnitPos ):

 

Share this post


Link to post
Share on other sites

how about using the

_x setUnitPos "UP"; 
Command in the ForEach loop

Edited by Play3r
Typo

Share this post


Link to post
Share on other sites
21 minutes ago, Play3r said:

how about using the

_x setUnitPos "UP"; 
Command in the ForEach loop

 

The unit just ignores the setUnitPos and the setUnitPosWeak. Super wierd but I understand the civilian gets panic when is falling down. Even with Zeus in vanilla if you trow the civilian, the behavior is the same.

Share this post


Link to post
Share on other sites

I don't know whether "human" units can have their simulation disabled. If yes, you could try to do that and then something like " sleep 0.25; enableSimulation true;" after they touch ground.

EDIT: oh, but with simulation disabled, they would probably NOT fall down and just hang locked mid-flight.... 😑

  • Haha 1

Share this post


Link to post
Share on other sites

Solution:

 

Before to landing: nothing!

//_grp setBehaviourStrong "CARELESS";  <<----------------- Not needed!
//_grp allowFleeing 0;  <<-------------------------------- Not needed!
//{
    //_x setBehaviour "CARELESS";  << -------------------- Not needed!
    //_x disableAI "FSM";  <<----------------------------- Not needed!
  
//} forEach units _grp;

 

Right after landing:

{ 
  // Wait the own unit (_x) touch the ground if not yet:
  waitUntil { sleep 3; (getPos _x select 2) < 0.2 || !alive _x };
  // Restart the unit animation, forcing them to be "UP":
  _x switchmove "";

} forEach units _grp;

 

It works well even civilian parachuter is under fire.

😉

  • Thanks 2

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

×