Placing vehicleson top of buildings

clifdayz

Well-Known Member
I've read a bunch of posts on this and the discussion is usually around. when the vehicle is placed in regard to the building itself and if its done in a script or in the database.

In this case, I'm using DZMS as the framework, so the creation of the vehicle is at minimum server_start+4 minutes. I want to place a heli on top of the Cherno factory. I can do it in the db, no problem. When I take those same coordinates and try to placeplace the heli, it seems to fall off one or the other side and explode. I've tried moving it ever so much, but nothing works.

_chopper = createVehicle ["UH1H_DZ",[6647.94,2585.85,36.403],[], 0, "NONE"];

This is the same call used to place it on the ground, except it has elevation. Am I just ,missing something easy?
 
I feel like I had an issue with this before and had trouble figuring it out as well. Maybe after creating using setPosASL could get it up on top of the building.

EDIT*

setPosATL could also be what I was thinking of..
 
Last edited:
_this = createVehicle ["UH1H_TK_EP1", [6647.94,2585.85,36.403], [], 0, "CAN_COLLIDE"];
You mean like this? Appears to work, only difference in the editor placement is the Can collide, shouldnt be the issue. I would say there is some other script that is interfering. What does your RPT log say when the heli is destroyed? Put a debug line after the heli is created to show its position in the log file.
Post your DZMS mission file.
 
Part of the difficulty in Arma2 is the lack of definitive manual. Nothing is said about the "special" parameter other than this:
special: String - "NONE", "FLY", "FORM", "CAN_COLLIDE". "CAN_COLLIDE" creates the vehicle exactly where asked, not checking if others objects can cross its 3D model.
So why can't you use NONE or FORM and when would you want to use those options? ... Who knows .. I do know that FLY makes the heli spawn actually flying rather than fall like a rock, and no you can't make a tank fly with that option. :rolleyes:

My solution to most issues like you had is to go into the 3D editor and create the object or whatever, click preview and see if it works. If it does, then I open the mission.sqf file and grab the working code.
 
But can I make the pigs fly?!

You're always helpful and that reminds me that my editor suddenly stopped working so I have to get that fixed. I was a software developer for years and not having API documentation drives me nuts. Trial and error, google and opendayz seem to be where I get most answers.

Any wisdom on placing AI on that same platform? When I tried, they just aren't there. When I misplaced them near a building they end up on top. I'll just keep plugging away.
 
After some experimentation I arrived at a working solution. I moved one guy up there, then created another group with another guy, then another group with another guy. it seems that the LEADER of a group will stay put if he doesnt have a waypoint, but the 'nobody' units will wander off the roof. So each unit has to be the leader of his own group and have no waypoints. If you are using DZAI or any other spawn system they will be giving waypoints. The units I tested would walk off the roof REGARDLESS of where the waypoint was or what the order was .. EXCEPT if the waypoint order was "scripted" in which case you could create a script to put them on alert or create a trigger to have them target players etc .. So you cant use a spawn system, you have to use an sqf script.
Little 'proof of concept' video. You can see in the first part that the leader stays put but his subordinate walks off the roof. I paused the recording and then put three leaders with no waypoints and they all stayed put. I did a few tests and that was the only thing I got working.

Code:
activateAddons [
];

activateAddons [];
initAmbientLife;

_this = createCenter west;
_center_0 = _this;

_group_0 = createGroup _center_0;

_unit_0 = objNull;
if (true) then
{
  _this = _group_0 createUnit ["BAF_Soldier_AA_W", [6670.4922, 2627.2664, 46.849197], [], 0, "CAN_COLLIDE"];
  _unit_0 = _this;
  _this setDir -0.19758946;
  _this setUnitAbility 0.60000002;
  if (true) then {_group_0 selectLeader _this;};
  if (true) then {selectPlayer _this;};
  if (true) then {setPlayable _this;};
};

_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["UH1H_TK_EP1", [6697.0142, 2650.1694, 37.136414], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setPos [6697.0142, 2650.1694, 37.136414];
};

_group_1 = createGroup _center_0;

_unit_3 = objNull;
if (true) then
{
  _this = _group_1 createUnit ["BAF_Soldier_AA_W", [6690.2134, 2642.9634, 36.703178], [], 0, "CAN_COLLIDE"];
  _unit_3 = _this;
  _this setDir -158.92447;
  _this setUnitAbility 0.60000002;
  if (true) then {_group_1 selectLeader _this;};
};

_group_3 = createGroup _center_0;

_group_4 = createGroup _center_0;

_unit_33 = objNull;
if (true) then
{
  _this = _group_3 createUnit ["BAF_Soldier_AA_W", [6690.7578, 2642.7539, 36.4524], [], 0, "CAN_COLLIDE"];
  _unit_33 = _this;
  _this setUnitAbility 0.60000002;
  if (true) then {_group_3 selectLeader _this;};
};

_unit_34 = objNull;
if (true) then
{
  _this = _group_4 createUnit ["BAF_Soldier_AA_W", [6692.1016, 2643.4863, 36.4524], [], 0, "CAN_COLLIDE"];
  _unit_34 = _this;
  _this setUnitAbility 0.60000002;
  if (true) then {_group_4 selectLeader _this;};
};

processInitCommands;
runInitScript;
finishMissionInit;
 
Back
Top