rick rawlings 2 Posted May 17, 2018 So I have this fun little mission to destroy a rebel camp and everything is working well except for the helicopter extraction (natch!). Basically, what I want to do is to have the helicopter (heli2) drop off a squad of soldiers to reinforce you after you defend the rebel assault and then have you board the same heli, thus passing each other by. Now I have the heli inbound with a waypoint to transport unload and a get out and move waypoint for the fresh troops. To hold the helicopter on the waypoint until you are in, I try the old skip waypoint ({alive _x;} count units grp1) == ({_x in heli2;} count units grp1); trick, with a "conditions met" hint in the "on Activation" field. Now, since I have been having trouble with this, I pulled the heli part out and tested it by itself and seemed to work fine, but in the mission, the helicopter gives me the "conditions met" hint and cheerfully sits there forever despite the big fat MOVE waypoint that comes after it. Anyone have any ideas to test? Here's the mission file if anyone wants to give it a go... Thanks! Rick Share this post Link to post Share on other sites
major-stiffy 269 Posted May 17, 2018 If your trying to have heli2 go to transport and unload waypoint, then wait for other players to get into heli2, add time to the transport and unload waypoint timers. The heli will sit there until the timer times out. Assuming I understand the mission correctly. Personally, I use LAND waypoint and add time to the waypoint timers if I want the heli to stay on the ground for say 30 seconds then he will the fly to the next MOVE waypoint. Share this post Link to post Share on other sites
KC Grimes 79 Posted May 17, 2018 I use Transport Unload with a "land" command in the on completion statement, kick the cargo out upon landing, wait for the player's group to board, and only then do I add the next waypoint to the heli. This seems to do exactly what you are asking. Code snippet to be more clear: //Create waypoint to tower helipad to drop off cargo _heli1PickupWP = _heli1crew addWaypoint [getPos heli1Pickup, 0]; _heli1PickupWP setWaypointType "TR UNLOAD"; _heli1PickupWP setWaypointBehaviour "SAFE"; _heli1PickupWP setWaypointCombatMode "BLUE"; _heli1PickupWP setWaypointStatements ["true", "_heli1 land 'GET IN';"]; //Wait until touchdown waitUntil {sleep 1; (isTouchingGround _heli1)}; //Make sure cargo exits {unassignVehicle _x} forEach units _heli1cargo; //Have cargo move inside compound just to get out of the way _heli1CargoMoveWP = _heli1cargo addWaypoint [getMarkerPos "mkrCounterAttack", 0]; _heli1CargoMoveWP setWaypointType "MOVE"; _heli1CargoMoveWP setWaypointBehaviour "SAFE"; _heli1CargoMoveWP setWaypointSpeed "LIMITED"; _heli1CargoMoveWP setWaypointCombatMode "BLUE"; _heli1CargoMoveWP setWaypointStatements ["true", ""]; //Wait until player group is inside heli waitUntil {({_x in (crew _heli1)} forEach units _playerGroup)}; //Fly off somewhere _exfilHeliWP = _heli1crew addWaypoint [getMarkerPos "endExfil", 0]; _exfilHeliWP setWaypointType "MOVE"; _exfilHeliWP setWaypointCompletionRadius 100; _exfilHeliWP setWaypointSpeed "FULL"; _exfilHeliWP setWaypointBehaviour "SAFE"; _exfilHeliWP setWaypointCombatMode "RED"; _exfilHeliWP setWaypointStatements ["true", ""]; 2 Share this post Link to post Share on other sites
rick rawlings 2 Posted May 18, 2018 thanks, guys! I will give the add waypoint option a try, that is a clever trick I never would have though of! I could just have the helicopter wait for 30 sec, but I wanted to try learn a bit more about the whole thing works. Thank you both for your help. If anyone knows why it is not working the way it is, that would be nice to know as well! RR Share this post Link to post Share on other sites
rick rawlings 2 Posted May 18, 2018 (edited) ugg, Ok, so I have a heli called "heli2" I took the pilot and did this in the init: heli1crew = group this then I made a trigger that reads this: ({alive _x;} count units grp1) == ({_x in heli2;} count units grp1); for the condition. On activation: 0 = [] execVM "waypoint.sqm" when it runs, I get a "Error undefined variable in expression: _heli1crew" so I am not sure what I am doing wrong. Um...here's waypoint.sqm: _exfilHeliWP = _heli1crew addWaypoint [getMarkerPos "marker_06", 0]; _exfilHeliWP setWaypointType "MOVE"; _exfilHeliWP setWaypointCompletionRadius 100; _exfilHeliWP setWaypointSpeed "FULL"; _exfilHeliWP setWaypointBehaviour "SAFE"; _exfilHeliWP setWaypointCombatMode "RED"; _exfilHeliWP setWaypointStatements ["true", ""]; Thanks! Edited May 18, 2018 by rick rawlings added waypoint.sqm as I forgot before... Share this post Link to post Share on other sites
f2k sel 164 Posted May 18, 2018 Just looking at the last post your not calling the script correctly. 0 = [] execVM "waypoint.sqm" Most scripts now are sqf 0 = [] execVM "waypoint.sqf" The file should also be saved as "waypoint.sqf" If you are using sqm files it would be [] exec "waypoint.sqm" if your group is heli1crew = group this you need to use that exact name in the script without the underscore _heli1crew Share this post Link to post Share on other sites
rick rawlings 2 Posted May 18, 2018 Ah, thank you! Will give it a try right after work! Share this post Link to post Share on other sites
rick rawlings 2 Posted May 19, 2018 *sigh* If BIS released a DLC right now called "Getting in and out by Helicopter!" I'd be all over it. So, the extraction works great in my test mission (after I added the waypoint number, before that it did nothing), in the actual mission however, the script hints that it is done but the helicopter immediately ejects just me and then sits there. Here's the heli variablename: heli2 pilot init: heli1crew = group this trigger condition (grp 1 is correct): ({alive _x;} count units grp1) == ({_x in heli2;} count units grp1); trigger on activation: 0 = [] execVM "waypoint.sqf"; waypoint.sqf: _exfilHeliWP = heli1crew addWaypoint [getMarkerPos "marker_06", 0, 2]; hint "waypoint created"; _exfilHeliWP setWaypointType "MOVE"; hint "waypoint type"; _exfilHeliWP setWaypointCompletionRadius 100; hint "waypoint completion"; _exfilHeliWP setWaypointSpeed "FULL"; hint "waypoint speed"; _exfilHeliWP setWaypointBehaviour "SAFE"; hint "waypoint behaviour"; _exfilHeliWP setWaypointCombatMode "RED"; hint "waypoint combat mode"; _exfilHeliWP setWaypointStatements ["true", ""]; hint "done"; There is definitely a marker_06, it is definitely the 3rd waypoint in the chain, the script hints all the way down to done and then the chopper immediately kicks me out and then just sits there... so, I don't know what is wrong...any ideas? Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted May 19, 2018 Once you're using .sqf scripts there's barely any reason to use waypoints, triggers and other editor related stuff. The thing with doing stuff like what you want while using waypoints is, it requires quite a few triggers, the need to sync waypoints to other waypoints etc., too easy to mess things up. When writing scripts you can do this from the AI point of view. If I got it right you basically have a chopper, AI squad and player squad, after the players destroyed a camp the AI squad should disembark the chopper at the camp position while the player squad enters the chopper and goes RTB? Could be pretty basic: _test = [] spawn { _campPad = campPad;//marks the landing position for the chopper, doesn't have to be a landing pad _basePos = getMarkerPos "MyBase";//has to be a position _chopper = TransportHeli01;//your choppers name _AIleader = AISquadLeader;//has to be your AI group leader _HVT = killMe;//if this unit is dead, the chopper moves towards the camp _debug = true;//displays hints waitUntil {!alive _HVT};//condition to get things rolling if (_debug) then {hint "HVT dead"}; _chopper move getposATL _campPad; waitUntil {_chopper distance2d _campPad < 200}; if (_debug) then {hint "Chopper landing"}; dostop _chopper; _chopper land "Land";//needed to keep it on the ground, get in or get out won't work as good //add a loop to turn the engine back on as soon as the AI turns it off //this is needed to make the engine stay on all the time, despite the "Land" command _engine = _chopper spawn { waitUntil {!(isEngineOn _this) OR !alive _this}; _this engineOn true; }; waitUntil {getPosATL _chopper # 2 < 1}; if (_debug) then {hint "Chopper landed"}; sleep 5;//just in case units _AIleader allowGetIn false; units _AIleader orderGetIn false; if (_debug) then {hint "AI disembark"}; //make the AI squad patrol around or whatever you want [group _AIleader,getposatl _campPad,50] spawn BIS_fnc_taskPatrol; sleep 3; if (_debug) then {hint "Chopper waiting for player"}; waitUntil {{_x in crew _chopper} count units player isEqualTo count (units player select {alive _x})}; if (_debug) then {hint "player in chopper"}; sleep 3; _chopper land "NONE"; _chopper dofollow leader group _chopper;//nullifies the dostop command above _chopper move getposatl _chopper; sleep 5; if (_debug) then {hint "Chopper RTB"}; _chopper move _basePos; }; Check out this simple mission. Cheers 1 Share this post Link to post Share on other sites
rick rawlings 2 Posted May 19, 2018 Thank you for the mission example. To be fair, if I understood how to do all of that, I wouldn't be on here wondering why it didn't work! Also, in the script you wrote, the engine didn't stay on in the chopper! I will try to incorporate it into my mission and see if I can get it to work, I was just curious as to what I was doing wrong in the first place. Here's the sticky part mission file if anyone is bored and wants to check it out... Again, thank you for the help! RR Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted May 19, 2018 1 hour ago, rick rawlings said: Thank you for the mission example. To be fair, if I understood how to do all of that, I wouldn't be on here wondering why it didn't work! Also, in the script you wrote, the engine didn't stay on in the chopper! I will try to incorporate it into my mission and see if I can get it to work, I was just curious as to what I was doing wrong in the first place. Here's the sticky part mission file if anyone is bored and wants to check it out... Again, thank you for the help! RR That's weird, usually does the trick. Try this for a more brute force approach to keep the engine running: _chopper addEventHandler ["Engine",{(_this select 0) engineOn true;}]; Maybe something changed in how AI handle engine turn on/off, having a simple loop to turn it back on after it's off worked in the past just fine. Cheers Share this post Link to post Share on other sites
rick rawlings 2 Posted May 25, 2018 So I ended up basically cutting the helicopter extraction from the test mission that was working and pasting it into the mission that wasn't working and made sure that everything aligned to the new unit names and so forth. This is using the addWaypoint method from the bottom of KC Grimes' script above. It seems to be working, at least in solo play... Share this post Link to post Share on other sites