Col Saint 0 Posted October 9, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setpos[(getpos this select 0),(getpos this select 1),4]<span id='postcolor'> This is to change the hight of an object in OFP, I used it to change and fit objects into uneven terrain. I tried to use it in OFP-Resistance, and all I get is a the movement North and west and not the hight. Did they change the command in Res. Please help, for my map cant be finished without getting object back to the ground. Thank you! Share this post Link to post Share on other sites
RED 0 Posted October 9, 2002 Strange I have seen this problem, have you tried using the setpos command on any other objects on a diffrent section of land? RED Share this post Link to post Share on other sites
Spitfire 0 Posted October 9, 2002 There certainly seems to be a problem with some objects which causes some lateral (X-Y) movement even though only the height of the object is supposed to be adjusted with the SetPos -command. I have made an elevator -type thingamajing as a test which uses a looping "this setpos[getpos this select 0,getpos this select 1,(getpos this select 2) + 0.1]" -command. The elevator goes up OK, but it also moves every time a little bit to to the north. I remember using commands like this in 1.46 too but I didn't notice these symptoms back then. It doesn't affect all objects, though. As a workaround I use a game logic object (I would use markers but you can't change their height) which I move around and then move the desired object to the game logic. Share this post Link to post Share on other sites
JAP 2 Posted October 9, 2002 doesnt it have to say "+4" or "-4" Share this post Link to post Share on other sites
Chris Death 0 Posted October 9, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">doesnt it have to say "+4" or "-4" Â <span id='postcolor'> 4 = +4 -4 = -4 :note 4 without the "+" or "-" automatically becomes a positive number, so it's +4 Â :edit - btw this is not only OFP thingy, this is general math's ~S~ CD Share this post Link to post Share on other sites
kegetys 2 Posted October 9, 2002 A little bit offtopic, but theres also a problem with setpos/getpos on objects with a roadway lod (buildings, bridges,etc.), when using "getpos" the height seems to be always relative to the height of the roadway lod, but when using "setpos" the height is relative to ground level. So, for example if you getpos a person standing on a bridge, you will get the height of 0, and if you use the same coordinates to setpos something there it will end up on ground below the bridge. Share this post Link to post Share on other sites
JAP 2 Posted October 9, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (DV Chris Death @ Oct. 09 2002,10:49)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">doesnt it have to say "+4" or "-4" Â <span id='postcolor'> 4 = +4 -4 = -4 :note 4 without the "+" or "-" automatically becomes a positive number, so it's +4 Â :edit - btw this is not only OFP thingy, this is general math's ~S~ CD<span id='postcolor'> Thx DV As i learned everything from tutorials ( and use the commands completely over like they tell in those ) i didn t really know. I m hopeless at scripting and those <> == etc commands. I know difference between 4 -4 +4 ( i have a bankaccount ) Just trying to help Share this post Link to post Share on other sites
Col Saint 0 Posted October 9, 2002 I think I have found out the problem but first about that -4/+4. Resistance is calling out an error (mine does) if I use a number without an positive or negative sign, that from the start. Somehow the problem occurs (hope spelled right) on diffrent terrain. I tried to build a bunker beach fortification. And the terain on the island is very uneven. The slope are very sharp angled. So trying to set the Object to a higher position causes a move of the choosen Object to a higher position on the groundlevel. So up the hill not up in the air. If the ground is level it jumps in the air. But not allways. I copied a Object on the Editor and inserted it with CTRL + V and suddenly it worked. The object was floting in the air. I try allways to get an M2 on a Concrete Wall Section. but it drops down to the flor and vanishes into the Block. If I change the hight, I move the position on ground not the flyposition. Even the command: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setpos ((nearestBuilding this) buildingpos 1) <span id='postcolor'> is not working. It was possible to set Units into a tower but now this even don´t work. Funny this is, right? Seems I have to find a way to get it done for I need guns like Motar MG into my bunkers otherwise it looks funny, unarmed fort. Share this post Link to post Share on other sites