Jump to content
Sign in to follow this  
tpw

How to detect if player/unit is falling

Recommended Posts

As has been noted in other threads, the way Arma2 handles falling units is a little less than realistic. Units (including the player) step off ledges, balconies etc,fall ramrod straight and land upright. If the fall is too far then they incur some kind of injury. Obviously there is a variable of some kind at work here to detect falling, but I have no idea what it is.

I'd like to write a little addon that determines if a unit falls, and forces the unit into a crouched stance when they hit the ground. All it will do is add a little more realism, shouldn't affect gameplay in any way.

Anyone know the best way to detect a falling unit?

Thanks in advance

Share this post


Link to post
Share on other sites

http://community.bistudio.com/wiki/velocity

select 1 = x

select 2 = z

select = y

You'd have to force the user via ANIMATION into a crouch state. Not sure what you'd achieve... the user most likely wouldn't know hes doing a crouch animation as he's falling and would probably die anyway. Also to note that falling down a tiny ledge etc might not be enough to trigger the velocity event.

Edited by rexehuk

Share this post


Link to post
Share on other sites

Thanks mate, exactly what I was after. I'll see what I can come up with shall I...

---------- Post added at 14:12 ---------- Previous post was at 12:44 ----------

OK so I had a bit of a play and this is about the best I can come up with.

Basically it just monitors the player's vertical speed and if it exceeds -3m/sec then switches to a short kneeling animation with dropped weapon, transitioning to standing back up.

while {alive player} do {
_v1 = velocity player select 2; 
if (_v1 < -3) then {
player sidechat "Oooff, that hurt!";
player playmove "AinvPknlMstpSnonWrflDnon_medicEnd"; 
};
sleep 0.5;
};

Edited by tpw

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
Sign in to follow this  

×