TrueCruel 10 Posted February 20, 2014 Hi! I have a small issue with a Zeus mission I made. I have a Helo evac script but everytime the helo touches the ground, he takes off immediately and flies to the corner of the map. That only appears if I load up the misison on the dedicated server, SP or creating ingame a session aren't affected by that. Here's the code: 1 setRadioMsg "NULL"; _requester = _this select 0; _helo_marker = createMarker ["Marker2", getPosATL mohawk1]; _helipad_temp = createVehicle ["Land_HelipadEmpty_F", getPosATL _requester, [], 0, "NONE"]; wp0 = e_h_grp addWaypoint [getPosATL _helipad_temp, 0]; wp0 setWaypointBehaviour "AWARE"; wp0 setwaypointtype "MOVE"; wp0 setWaypointFormation "NONE"; wp0 setWaypointSpeed "FULL"; wp0 setwaypointstatements ["True", "mohawk1 land 'GET IN'"]; wp0 setwaypointposition [getPosATL _helipad_temp, 0]; m_pilot1 sideChat format["Roger that %1, EVAC dispatched on your position. Sit tight boys, out.", _requester]; waituntil{_requester in mohawk1}; wp1 = e_h_grp addWaypoint [(getmarkerpos _helo_marker), 0]; wp1 setWaypointBehaviour "AWARE"; wp1 setwaypointtype "MOVE"; wp1 setWaypointFormation "NONE"; wp1 setWaypointSpeed "FULL"; wp1 setwaypointstatements ["True", "mohawk1 land 'LAND'; [] execVM 'evac_base_land.sqf'"]; wp1 setwaypointposition [getmarkerpos _helo_marker, 0]; I hope you can help me with that. Thanks! Share this post Link to post Share on other sites
Beerkan 71 Posted February 20, 2014 Try this mohawk1 setfuel 0; waituntil{_requester in mohawk1}; mohawk1 setfuel 1; Share this post Link to post Share on other sites
TrueCruel 10 Posted February 20, 2014 Nope doesn't work... even if it did it would be just a workaround, I would like to know why the helo takes off immediately after the he touches the ground and then makes a waypoint to the corner of the map. Still thanks :) Share this post Link to post Share on other sites
cameroon 12 Posted February 21, 2014 Getting AI helicopter's to stay landed (or to land at all) can be brutal. I ended up creating a pair of functions that make it easier for me to accomplish and in general it seems to be working well for me. If you want, take a look at the file dynamicTransports in this sandbox I was using to create themhttps://dl.dropboxusercontent.com/u/8018430/DynamicHeliTransports.Stratis.zip. You can ignore/remove the EOS stuff, that's just there because I was testing it out. Essentially, the various behavior modifiers (e.g. CARELESS) are there because the AI pilots are extremely likely to simply fly off if they know about any enemies. I really want to be able to flag a helicopter as primarily a transport and have that modify it's priorities. Since that doesn't exist, this is what I ended up with. The loadAt is actually the hardest, because there has to be some way to tell the AI that it's loaded. I wrote in two methods, either by providing a variable to watch (which would let a radio trigger or some other event tell it to take off) or to pass in a group, in which case it will wait until the group is loaded. I've tested it out in SP, local hosting and dedicated and it worked fine in all of them. Feel free to use, modify or ignore as needed ;) Share this post Link to post Share on other sites
Beerkan 71 Posted February 21, 2014 Nope doesn't work... even if it did it would be just a workaround, I would like to know why the helo takes off immediately after the he touches the ground and then makes a waypoint to the corner of the map.Still thanks :) Also might be worth checking out this thread... Help-Heli-insertion-not-going-to-plan Share this post Link to post Share on other sites
TrueCruel 10 Posted February 22, 2014 Nothing works... I'm close to despair... @cameroon Thanks for that, but that art of scripting is still too high for me (but that's just awesome, much kudos for you) ^^ but there must be some easier way to do it in my case. The ony problem is that he takes off immediately after he touches the ground. Everything else works like it should, I reall would know how server scripting differs so much from SP. He just needs to land and wait for me, but no he takes off and flies to the corner of the map. That's hilarious (no it's not) :D Share this post Link to post Share on other sites
TrueCruel 10 Posted February 23, 2014 I did it! The solution is totally controversial, but hey it works :D After the helo touches the ground, I give him a doStop command. After that I delete the pilots and create new ones with a waypoint to the base. Share this post Link to post Share on other sites
KC Grimes 79 Posted February 23, 2014 Here's how I did it in one of my missions, without killing the pilots :P wp11h1 = _heli1crew addWaypoint [(getPos helipad), 0]; wp11h1 setWaypointType "TR UNLOAD"; wp11h1 setWaypointBehaviour "SAFE"; wp11h1 setWaypointCombatMode "BLUE"; wp11h1 setWaypointStatements ["true","_heli1 land 'GET IN';"]; waitUntil {speed _heli1 > 10}; waitUntil {speed _heli1 < 2}; {unassignVehicle _x} forEach units _heli1group; wp1o1 = _heli1group addWaypoint [(getmarkerpos "debrief"), 0]; wp1o1 setWaypointType "MOVE"; wp1o1 setWaypointBehaviour "SAFE"; wp1o1 setWaypointSpeed "LIMITED"; wp1o1 setWaypointCombatMode "BLUE"; wp1o1 setWaypointStatements ["true",""]; Where _helicrew is the name of the group including the heli's pilot, _heli1 is the heli of subject, and _heli1group is a group of soldiers getting out. Share this post Link to post Share on other sites