uiox 0 Posted October 8, 2002 With 1.75 I have problem with the command distance With this _Dist = unit1 distance unit2 '_Dist = unit1 I#Idistance unit2': Error unknown operator distance Share this post Link to post Share on other sites
vektorboson 8 Posted October 8, 2002 I heard of a similar problem; that guy has used distance as a variable, and then he tried to use it as a function and since resistance there is an automatic variable/function detection to keep old missions playable that use variable names that are reserved for Resi functions. Perhaps you did in your code somewhere by accident distance = 50 or ?distance = 50: blabla And therefore used distance as a variable! Share this post Link to post Share on other sites
Placebo 29 Posted October 8, 2002 Again this is more a ME question Moving to ME. Share this post Link to post Share on other sites
uiox 0 Posted October 8, 2002 Thanks BigPoppa, I'm sure you're right, because if it's OFP bug... Share this post Link to post Share on other sites
GAMEER_77 0 Posted October 9, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bigpoppa @ Oct. 08 2002,11:59)</td></tr><tr><td id="QUOTE">I heard of a similar problem; that guy has used distance as a variable, and then he tried to use it as a function and since resistance there is an automatic variable/function detection to keep old missions playable that use variable names that are reserved for Resi functions. Perhaps you did in your code somewhere by accident distance = 50 or ?distance = 50: blabla And therefore used distance as a variable!<span id='postcolor'> Share this post Link to post Share on other sites
uiox 0 Posted October 9, 2002 It's not English Gameer77, it's EnglishOFP... So, le Français que je suis, has understand and solve his problem. Share this post Link to post Share on other sites
vektorboson 8 Posted October 9, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (uiox @ Oct. 09 2002,09:29)</td></tr><tr><td id="QUOTE"> It's not English Gameer77, it's EnglishOFP... So, le Français que je suis, has understand and solve his problem. <span id='postcolor'> I think that Gameer knows about the distance-problem Share this post Link to post Share on other sites
Prospero 1 Posted October 9, 2002 Also be aware that (from my experiments) the distance command rounds off numbers owing to float resolution. Not good for accurate absolute height determination. My way of getting absolute height of an object goes a little like this: Make a trigger - let's call it mytrigger. Use a getPos on the object in question and store the values as _x, _y and _z. Then: mytrigger setPos [_x, _y, 0] _height = _z - (getPos mytrigger select 2) Suma - I'd say adding a function for absolute height would be number one on my list of fantasy functions. Edit: I should probably make clear that this method (which I believe is original) is superior because: 1) It also allows you to extract the height of the ground below the object directly = -(getPos mytrigger select 2) 2) It solves the resolution problem. Prospero Share this post Link to post Share on other sites
Prospero 1 Posted October 10, 2002 It is probably also worth pointing out that this method can be extended to setting an object into the world at an absolute height. Let us say that you wish to set the object (which we will call myobject) into the OFP world at an east/west value of _x and a north/south value of _y, and with an absolute height of _z. You must first find the height of the ground at that particular location (in terms of _x and _y). So you do this: mytrigger setPos [_x, _y, 0] _heightofground = -(getPos mytrigger select 2) You then do the following: myobject setPos [_x, _y, (_z - _heightofground)] You can of course reduce this process by substitution to: mytrigger setPos [_x, _y, 0] myobject setPos [_x, _y, (_z + (getPos mytrigger select 2))] Prospero Share this post Link to post Share on other sites
RED 0 Posted October 10, 2002 hmm I used </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _Dist = unit1 distance unit2 hint format ["%1", _Dist] Also I used: _Dist = (unit1 distance unit2) hint format ["%1", _Dist] <span id='postcolor'> I didn't get any errors from either of them? RED Share this post Link to post Share on other sites
GAMEER_77 0 Posted October 10, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bigpoppa @ Oct. 09 2002,09:59)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (uiox @ Oct. 09 2002,09:29)</td></tr><tr><td id="QUOTE"> It's not English Gameer77, it's EnglishOFP... So, le Français que je suis, has understand and solve his problem. <span id='postcolor'> I think that Gameer knows about the distance-problem  <span id='postcolor'> Damn right! PEACE Share this post Link to post Share on other sites