Raptor 2101 0 Posted July 13, 2003 <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 _add=_this select 1 _time = _this select 2 _ziel = _this select 3 _speed = _this select 4 _Granaten="SmokeShell" camcreate getpos _unit _time= 1 / _time _xs = (velocity _unit) select 0 _ys = (velocity _unit) select 1 #drehung _x=(getPos _unit) select 0 +_xs _y=(getPos _unit) select 1 +_ys _z=(getPos _unit) select 2 _unit setPos[_x,_y,_z] _x1 = (getPos _unit) select 0 _y1 = (getPos _unit) select 1 _z1 = (getPos _unit) select 2 _Granaten setPos [_x1, _y1, _z1+30] _unit setDir ((getDir _unit) + _add) ~(_time) goto "drehung" Exit this code give this error massage "'_unit setPos[_x,_y,_z]'|x| Fehler Typer jeder, zahl erwartet" and i dont understand why. i give the operator setpos legal numbers to operate have anyone a idia Share this post Link to post Share on other sites
Raptor 2101 0 Posted July 13, 2003 any idia or question ?? please i need help Share this post Link to post Share on other sites
Harnu 0 Posted July 13, 2003 Quote[/b] ]Fehler Typer jeder, zahl erwartet If you translate that I might know whats going on. Share this post Link to post Share on other sites
the editing man 0 Posted July 13, 2003 I´ve seen something on ofpec a setpos script maybe you should download that script, and that script on ofpec is working because i use it myself with no problems at all. Share this post Link to post Share on other sites
Raptor 2101 0 Posted July 13, 2003 Error : Error Typer all: Number expected @editing man: i know how setpos works (from the referens) but i dont understand the massage evere values i give are numbers i dont know who the programm get char values Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted July 13, 2003 Try changing: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_x=(getPos _unit) select 0 +_xs _y=(getPos _unit) select 1 +_ys To: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _x=(getPos _unit select 0) +_xs _y=(getPos _unit select 1) +_ys You may be telling it to select an element that does not exist? Share this post Link to post Share on other sites
Raptor 2101 0 Posted July 13, 2003 no because the other order "setDir" works fine Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted July 13, 2003 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_x=(getPos _unit) select 0 +_xs The above code will give me an error everytime in OFP with a Division by zero, error message? If _xs = 10 then the code would translate to: _x=(getpos _unit) select (0 + 10) As GetPos only returns 3 elements, it will fall over trying to find element 10. Because the line where you initialise _x fails, your code goes on to call: Quote[/b] ]_unit setPos[_x,_y,_z] So you get the "Type all: Number expected" error message because _x un-initialised is of type any. And SetPos expects  numbers. If you added: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #drehung _x=0 _y=0 _x=(getPos _unit) select 0 +_xs _y=(getPos _unit) select 1 +_ys And then run your code, you will get the "Division by zero" error message as mentioned above. You have to be careful, OFP only displays the last error message. Share this post Link to post Share on other sites
Raptor 2101 0 Posted July 14, 2003 thanks i will try Share this post Link to post Share on other sites
Guest jacobaby Posted July 14, 2003 [code_x=(getPos _unit select 0) +_xs_y=(getPos _unit select 1) +_ys _z=(getPos _unit select 2) _unit setPos[_x,_y,_z] Brackets in the wrong places fixed above TJ Share this post Link to post Share on other sites
Raptor 2101 0 Posted July 15, 2003 thanks to all it works now a other it is posibel to let a flying helicopter smoke? i have found no way an with camecreate "SmokeShell" that works with groudn units but, if you try it with a flying unit the granate fell down Share this post Link to post Share on other sites
Trapper 0 Posted July 15, 2003 Use the drop command to create your own kind of smoke that you can attach to any object. Here you can find a good tutorial and examples to get into it: Vektorbosons homepage Share this post Link to post Share on other sites
[aps]gnat 28 Posted July 15, 2003 And at the Editing Centre, doolittles "Vehicle Respawn With Smoke"....use the smoke script Gnat Share this post Link to post Share on other sites