iNeo 0 Posted May 4, 2003 I just noticed that when I use the createVehicle command and set the object's position to a player, the created object is created at a position at a random number of meters (max ca 10) away from the player. However, setting its position using a marker (getmarkerpos) instead of a player (getpos) is accurate, so an easy work-around is to have a marker following the player(s) in real-time, and setting the created vehicle's position to the marker. <span style='font-size:7.1pt;line-height:100%'>Just thought I'd mention this (didn't find anything about it using the search).</span> Share this post Link to post Share on other sites
RED 0 Posted May 4, 2003 Does this happen if you use the position of an AI unit? I think it might have been done to avoid collision with a player unit that may look messy (just a guess) RED Share this post Link to post Share on other sites
AliMag 0 Posted May 4, 2003 Hi iNeo, The problem is not only with player. It seems that the createVehicle command will NOT create anything on an already occupied location. It will always put the new created vehicle a few meters aside. It works with markers because a marker is not occupying any space. The workaround that I use is just creating the object at [0, 0, 0] location and move it afterwards. Cheers Share this post Link to post Share on other sites
iNeo 0 Posted May 4, 2003 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (RED @ 04 May 2003,15:15)</td></tr><tr><td id="QUOTE">Does this happen if you use the position of an AI unit? I think it might have been done to avoid collision with a player unit that may look messy (just a guess)<span id='postcolor'> No, I used it on myself. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (AliMag @ 04 May 2003,15:18)</td></tr><tr><td id="QUOTE">It seems that the createVehicle command will NOT create anything on an already occupied location. It will always put the new created vehicle a few meters aside. It works with markers because a marker is not occupying any space. The workaround that I use is just creating the object at [0, 0, 0] location and move it afterwards.<span id='postcolor'> Interesting. So to place an object 1 meter infront of the player... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_object = "objectType" createVehicle getpos player<span id='postcolor'> What should I add after player (to place the object 1 meter ahead of him)? Thanks for the replies. Share this post Link to post Share on other sites
RED 0 Posted May 4, 2003 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _x = getpos player select 0 + ((sin (getdir spieler))*1) _y = getpos player select 1 + ((cos (getdir spieler))*1) _z = getpos player select 2 _object setpos [_x,_y,_Z] <span id='postcolor'> Something like that will work. RED Share this post Link to post Share on other sites
iNeo 0 Posted May 4, 2003 Thanks, I will try it tonight Share this post Link to post Share on other sites