OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: Ironman on 15 Feb 2010, 04:40:11

Title: setVehiclePosition
Post by: Ironman on 15 Feb 2010, 04:40:11
Can someone tell me if this command, setVehiclePosition,  actually does anything? I am trying to randomly place a editor placed unit. I know I can just create a vehicle and do it a similar way, but nothing is happening with this command... I just want to make sure it is broken.
Title: Re: setVehiclePosition
Post by: h- on 15 Feb 2010, 08:39:04
Works fine here..
Title: Re: setVehiclePosition
Post by: Ironman on 15 Feb 2010, 13:22:31
Init file:

Code: [Select]

if (isserver)then
{
_box = HOZ_BOMB setVehiclePosition [[2061.8525,21.288868,2347.99], ["bomb_pos1","bomb_pos2","bomb_pos3","bomb_pos4"], 0]
};


HOZ_BOMB is the name of the object. The first array is the actual position of the object in the editor. The 4 marker pos are empty and are properly named as the array says.
Title: Re: setVehiclePosition
Post by: h- on 15 Feb 2010, 14:29:42
Leave the position to [0,0,0].
If there's no position given it will use the marker positions instead..
Quote
If the markers array contains more than one marker name, the position of a random one is used.
Otherwise, the given position is used.
Title: Re: setVehiclePosition
Post by: Ironman on 16 Feb 2010, 11:36:02
ok thank you, will try it out.
Title: Re: setVehiclePosition
Post by: Ironman on 23 Feb 2010, 01:05:25
still not working. I have no idea where it is placing this unit.

EDIT:

when I use it as "Player" it works fine. But when I use a empty object/vehicle it doesn't seem to work. Well, not entirely true... I noticed it puts the object into the ground.

EDIT:

Init of empty car:
this setVehiclePosition [[0,0,0], ["pos1_obj1","pos2_obj1","pos3_obj1","pos4_obj1"], 0]; this setpos [getpos this select 0, getpos this select 1, +0];

This spawns the car on top of the ground but it is finicky.... the car dissapears if you are not looking at it from the correct angle. Also, you can not destroy the car with anything.
Title: Re: setVehiclePosition
Post by: h- on 23 Feb 2010, 10:39:05
So it does.
Ok, so the command is buggy, or they have just meant it to be used on man class vehicles misleadingly naming it with "vehicle" instead of "unit".. :dunno:
Although it works on tanks, they don't sink, they jump a bit but stay above the ground. Didn't test if they get invulnerable in the process though.

So I guess you need to use the old fashion group-vehicle-with-marker method for the vehicles..