spelmo3 4 Posted January 26, 2021 So im trying to make a super simple helicopter taxi script. nothing fancy.. no RTB or anything.. just go to the marker position placed on the map, land and turn off engine. I've tried creating invisible helipads, using land and landAt.. addwaypoint etc.. its called in via the players addaction with the heli using helo1 as its variable can someone help me out im probably getting the syntax all wrong. deleteMarkerLocal "LZmarker"; _marker = createMarkerLocal ["LZmarker",[0,0,0]]; _marker setMarkerColorLocal "ColorWhite"; _marker setMarkerShapeLocal "ELLIPSE"; _marker setMarkerBrushLocal "Solid"; _marker setMarkerSizeLocal [25, 25]; openMap true; mapclick = false; onMapSingleClick "'LZmarker' setMarkerPosLocal _pos; mapclick = true; true"; waitUntil{!visibleMap}; helo1 domove getMarkerPos "LZmarker"; //just to move to marker position as a filler for now. //something to land the chopper. i've tried waypoints, invisible helipads and i cant seem to get it right onMapSingleClick ""; Share this post Link to post Share on other sites
M1ke_SK 230 Posted January 26, 2021 // something to land the chopper // create helipad for landing private _heliport = createVehicle ["Land_HelipadEmpty_F", getMarkerPos "LZmarker", [], 0, "NONE"]; while { ( (alive helo1) && !(unitReady helo1) ) } do { sleep 1; }; helo1 land "LAND"; waitUntil { sleep 1; isTouchingGround helo1 }; // do stuff deleteVehicle _helipad; 1 Share this post Link to post Share on other sites
Enigx 39 Posted January 26, 2021 Try this. I've written very quickly but it should work. _marker = createMarkerLocal ["LZmarker",[0,0,0]]; _marker setMarkerColorLocal "ColorWhite"; _marker setMarkerShapeLocal "ELLIPSE"; _marker setMarkerBrushLocal "Solid"; _marker setMarkerSizeLocal [25, 25]; mapclick = true; hint "Click on landing position"; onMapSingleClick """LZmarker"" setMarkerPosLocal _pos;mapclick = false; onMapSingleClick ''; true;"; waitUntil {!mapClick}; openMap false; _posToLand = getMarkerPos "LZmarker"; // better to get position in local variable _landPad = createVehicle ["Land_HelipadEmpty_F", _posToLand]; _heliGrp = group helo1; _wp = _heliGrp addWaypoint [_posToLand, 0]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "CARELESS"; _wp setWaypointCombatMode "GREEN"; _wp setWaypointSpeed "NORMAL"; _wp setWaypointStatements ["true", "(vehicle this) land 'LAND'"]; deleteMarkerLocal "LZmarker"; 1 Share this post Link to post Share on other sites
spelmo3 4 Posted January 26, 2021 8 minutes ago, M1ke_SK said: // something to land the chopper // create helipad for landing private _heliport = createVehicle ["Land_HelipadEmpty_F", getMarkerPos "LZmarker", [], 0, "NONE"]; while { ( (alive helo1) && !(unitReady helo1) ) } do { sleep 1; }; helo1 land "LAND"; waitUntil { sleep 1; isTouchingGround helo1 }; // do stuff deleteVehicle _helipad; thats quite close to what i had. albeit yours is much tidier.. but i get the same error.. missing ] on line 21.. issue is with syntax using getMarkerPos.. but i cant figure it out. 1 Share this post Link to post Share on other sites
spelmo3 4 Posted January 26, 2021 24 minutes ago, Enigx said: Try this. I've written very quickly but it should work. _marker = createMarkerLocal ["LZmarker",[0,0,0]]; _marker setMarkerColorLocal "ColorWhite"; _marker setMarkerShapeLocal "ELLIPSE"; _marker setMarkerBrushLocal "Solid"; _marker setMarkerSizeLocal [25, 25]; mapclick = true; hint "Click on landing position"; onMapSingleClick """LZmarker"" setMarkerPosLocal _pos;mapclick = false; onMapSingleClick ''; true;"; waitUntil {!mapClick}; openMap false; _posToLand = getMarkerPos "LZmarker"; // better to get position in local variable _landPad = createVehicle ["Land_HelipadEmpty_F", _posToLand]; _heliGrp = group helo1; _wp = _heliGrp addWaypoint [_posToLand, 0]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "CARELESS"; _wp setWaypointCombatMode "GREEN"; _wp setWaypointSpeed "NORMAL"; _wp setWaypointStatements ["true", "(vehicle this) land 'LAND'"]; deleteMarkerLocal "LZmarker"; works like a charm.. _posToLand = getMarkerPos "LZmarker"; // better to get position in local variable _landPad = createVehicle ["Land_HelipadEmpty_F", _posToLand]; this is where i was going wrong.. i was trying stupid complex things. i was trying to call getmarkerpos within create vehicle.. could of just done a variable hahaha thank you. it works a charm.. changed a few minor things to fit how i want it! 1 Share this post Link to post Share on other sites
Enigx 39 Posted January 31, 2021 Hi Spelmo3, If you are interested I have just shared my script for heli transport that could be usefull for your need. Cheers 1 Share this post Link to post Share on other sites