Jump to content
Sign in to follow this  
Harkonin

Detect "crwling"

Recommended Posts

Working on a script, actually its done but I would like to add a feature if a unit is crawling.

Anyone know how to detect it like an animation phase maybe or if a unit takes a certain action?

Thanks Hark

Share this post


Link to post
Share on other sites

do you mean that you want to know if the unit is hurt so bad that it cannot stand?

canStand unit1

or do you want the unit to not lay down?

(mr Bradshaw, will you stand up please?)

unit1 setUnitPos "UP"

or?

Share this post


Link to post
Share on other sites

No i just want to detect when unit is on the ground injured or not.

Share this post


Link to post
Share on other sites

canStand soldier

Operand types:

soldier: Object

Type of returned value:

Boolean

Description:

Check if soldier is able to stand up.

Example:

canStand player

Share this post


Link to post
Share on other sites

No! Off course not. That's the explanation BIS gave us in the official com ref  ghostface.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

condition : !canstand player

onactivation : hint "He, I can't walk anymore"

or

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

condition : canstand player

onactivation : hint "Wohoo, I can walk!"

Share this post


Link to post
Share on other sites

but then again, Harkonin said:

No i just want to detect when unit is on the ground injured or not.

Share this post


Link to post
Share on other sites

Correct, I don't care if he can stand ot not I need to detect the "action" of crawling.

something like

?(_unit acton yadayada):whatever

or If (_unit action whatever) then

is there an animation phase maybe?

Share this post


Link to post
Share on other sites
Correct, I don't care if he can stand ot not I need to detect the "action" of crawling.

something like

?(_unit acton yadayada):whatever

or If (_unit action whatever) then

is there an animation phase maybe?

is it perhaps possible to determine the "height above ground" of one soldiers head?

something like

apa1 = getPos soldierHead select 2

if apa1 < 1 then

"hello I'm laying on the ground"

Share this post


Link to post
Share on other sites
Correct, I don't care if he can stand ot not I need to detect the "action" of crawling.

something like

?(_unit acton yadayada):whatever

or If (_unit action whatever) then

is there an animation phase maybe?

I dont think you can do that with animphase.

But check the height of that unit in combination with it's speed could work. When he's crawling, he's moving,so his speed is higher than 0..

Share this post


Link to post
Share on other sites

I'd need a reference point for that, any suggestions?

maybe something like

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = _this select 0

_pos = getpos _unit

_speed = velocity _unit

?(_pos select2) < 0.5 && (_speed < 10):do whatever

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  

×