Jump to content
Sign in to follow this  
bangabob

Find stance of unit

Recommended Posts

Hi. Im adapting a respawn script that spawns the player on a units position.

I have been trying this code to poll the stance of a unit... ("Middle", "up", "down")

_return = _unit1 call getStance;
hint format ["unit1 stance is %1",_return]; 

However, this script just returns the hint "any".

Maybe Arma 3 doesnt understand getstance yet because of the new stances implemented. Just wondering whether anyone has any ideas.

Share this post


Link to post
Share on other sites

try this:

_return = stance _unit1;

always check the biki for correct syntax http://community.bistudio.com/wiki/stance

this will return "stand", "crouch" or "prone". there might be more but those came up after a short test.

"middle", "up" and "down" are the values returned by unitpos http://community.bistudio.com/wiki/unitPos

example:

_return = unitpos _unit1;

stance is a new command. i don't see how it's useful yet. maybe they will add more values for all the stances in between the major ones.

Share this post


Link to post
Share on other sites

Try

_return = stance _unit1;

But im also new too this stuff so ....

Zzzz too late ;)

Share this post


Link to post
Share on other sites

Okay thanks.

So stance returns "stand", "crouch" or "prone".

But unitpos returns "auto". Which doesn't make any sense.

I would prefer to get unitpos working so i can use the _return to setunitpos eg.

_unit1 = (_this select 0);

_return = unitpos _unit1;
hint format ["%1 stance is %2",_unit1,_return];

s1 setunitpos _return;

But maybe there is similar command for stance eg.

_unit1 = (_this select 0);

_return = stance _unit1;
hint format ["%1 stance is %2",_unit1,_return];

s1 MISSING COMMAND _return;

---------- Post added at 17:46 ---------- Previous post was at 17:33 ----------

I have found a workaround

_unit1 = (_this select 0);

_return = stance _unit1;
hint format ["%1 stance is %2",_unit1,_return];


if (_return == "stand") then {_return = "up";};
sleep 0.02;
if (_return == "crouch") then {_return = "middle";};
sleep 0.02;
if (_return == "prone") then {_return = "down";};
sleep 1;

hint format ["%1",_return];
s1 setUnitPos _return; 

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  

×