Harkonin 0 Posted January 8, 2004 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
Taurus 20 Posted January 8, 2004 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
Harkonin 0 Posted January 8, 2004 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
Blanco 0 Posted January 8, 2004 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
bmgarcangel 0 Posted January 8, 2004 so you would put that in like the condition field right Share this post Link to post Share on other sites
Blanco 0 Posted January 8, 2004 No! Off course not. That's the explanation BIS gave us in the official com ref  <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
Taurus 20 Posted January 9, 2004 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
Harkonin 0 Posted January 9, 2004 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
Taurus 20 Posted January 9, 2004 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
Blanco 0 Posted January 9, 2004 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
Harkonin 0 Posted January 11, 2004 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