Dr_Prof_Evil

_chopper move position <NameOfObj> doesn't work

5 posts in this topic

Posted (edited)

Hello.

Before I want to tell you my problem, I want to let you know, that I'm from Germany. So my english isn't very good.

___

 

I want to use the command "move" for a chopper.

First I spawn an flying chopper and a pilot. I set the pilot into the chopper as driver.

params ["_position"];

_newUnit = objNull;
_pilot_group = createGroup opfor;
_veh = createVehicle ["O_Heli_Transport_04_bench_F", _position, [], 0, "FLY"];
"O_helipilot_F" createUnit [_position, _pilot_group, "_newUnit = this;", 1];
_newUnit moveInDriver _veh;

So now I have a empty object ( a wall ) called "Fly_POS1". Now the pilot should fly to the position of it. But it doesn't work. 

Here a all variations I have tried:

_veh move position Fly_POS1;
_group _newUnit move position Fly_POS1; // _newUnit is the pilot
_pilot_group move getMarkerPos format ["%1", position Fly_POS1]; // Here. The chopper begins to fly. But it flys always to the south of the map and wants to land on the top of the water :/
_veh doMove position Fly_POS1;

I also tried to use coordinates to test it:

_veh move [7088.17, 8513.67];
_veh move [7088.17, 8513.67, 10.0];

 

Edited by Dr_Prof_Evil

Share this post


Link to post
Share on other sites

Posted (edited)

So what you can do is 

units _pilot_group doMove (getPos Fly_POS1);

To make it even better you should check if the position is above sea or land and do something like this 

_pos = if(surfaceIsWater (getPos _Fly_POS1))then{getPosASL Fly_POS1}else{getPosAGL Fly_POS1};

units _pilot_group doMove _pos;

 

Edited by Janski
typo in the code

Share this post


Link to post
Share on other sites
Advertisement

Posted (edited)

24 minutes ago, Janski said:

So what you can do is 


units _pilot_group doMove (getPos Fly_POS1);

 

I have changed it, but it doesn't work. The chopper is hovering in the same position where it spawns. 

 

Btw., Before I make the command, I add some bots to the cargo of the chopper. Does it change anything?

{
  _x moveInCargo _veh;
} forEach _created_units;

 

Edited by Dr_Prof_Evil

Share this post


Link to post
Share on other sites

Hmm this can be tricky since sometime units doesn't want to move if their leader isn't moving or they have different orders. 

To make sure you don't have any conflicting orders I would do 

(crew _veh) joinSilent _pilot_group;

_pilot_group selectLeader ((crew _veh) select 0);

Do this before you are moving them.

 

Share this post


Link to post
Share on other sites

You also need to execute this code where the objects are local. 

And if you wanna be even more careful use this 

doStop (units _pilot_group);
UISleep 5;

before executing the doMove command to make sure they have aborted their previous orders. 

UISleep 5; - isn't always necessary 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.