wyattwic 38 Posted October 14, 2014 (edited) Here is my neat little snipplet that will open ghosthawk doors based on altitude. I couldn't find one already out there, so here it is. Somewhere in the vehicle init null = [this] execvm "ghosthawkdoors.sqf"; ghosthawkdoors.sqf _unit = _this select 0; _doorstate = false; while {alive _unit} do { _alt = getposatl _unit select 2; // If under 10 altitude and doors are already closed, open them. if ((_alt <= 10) && !(_doorstate)) then { _unit animateDoor ['door_R', 1]; _unit animateDoor ['door_L', 1]; _doorstate = true; }; // If over 10 altitude and doors are open then close them. if ((_alt > 10) && (_doorstate)) then { _unit animateDoor ['door_R', 0]; _unit animateDoor ['door_L', 0]; _doorstate = false; }; //Slow the script down some. This is not a critical loop. sleep 7; }; This setup assumes that the doors are closed on start by default, as BIS had them set. If anyone sees an error, it would be a big help. Edited October 14, 2014 by Wyattwic Share this post Link to post Share on other sites
rtek 10 Posted October 14, 2014 That's great. Beats the hell out of setting open or close at different waypoints. Thanks for posting this. Share this post Link to post Share on other sites
iceman77 19 Posted October 14, 2014 Oh neat. Cheers. ---------- Post added at 14:19 ---------- Previous post was at 14:16 ---------- (_doorstate == false) Shouldn't the condition be just !(_doorstate) ? while {alive _unit} do { _alt = getposatl _unit select 2; // If under 10 altitude and doors are already closed, open them. if ((_alt <= 10) && !(_doorstate)) then { _unit animateDoor ['door_R', 1]; _unit animateDoor ['door_L', 1]; _doorstate = true; }; // If over 10 altitude and doors are open then close them. if ((_alt > 10) && (_doorstate)) then { _unit animateDoor ['door_R', 0]; _unit animateDoor ['door_L', 0]; _doorstate = false }; //Slow the script down some. This is not a critical loop. sleep 7; }; Share this post Link to post Share on other sites
wyattwic 38 Posted October 14, 2014 Yea, that works. What I get for seeing almost anything as a string. Updating it. EDIT: that and I found a few syntax errors. lol. Share this post Link to post Share on other sites
iceman77 19 Posted October 15, 2014 No worries. Post the updated version. Neat little script it is. Share this post Link to post Share on other sites
Tajin 349 Posted October 15, 2014 Sweet idea. Personally, I would rather check for both the altitude AND the velocity of the chopper. Share this post Link to post Share on other sites
BEAKSBY 11 Posted October 15, 2014 Do closed doors improve the top speed of the aircraft? Curious if the simulation is that detailed? Share this post Link to post Share on other sites
Tajin 349 Posted October 16, 2014 I highly doubt it. Though you could easily script them to do that. Share this post Link to post Share on other sites