nullrick 10 Posted October 22, 2014 Apart from hopelessly trying to get AI to open the Huron's cargo door open, I'm now left wondering if there's just a script to have it open througout the mission. Share this post Link to post Share on other sites
iceman77 18 Posted October 22, 2014 (edited) Have you tried animateDoor ? myHelo animateDoor ["door_rear", 1, false]; init.sqf myHelo addAction ["Toggle Door", { private [ "_state" ]; _state = ( _this select 0 ) doorPhase "door_rear"; if ( _state == 0 ) then { ( _this select 0 ) animateDoor ["Door_rear", 1, false]; } else { ( _this select 0 ) animateDoor ["Door_rear", 0, false]; }; }]; Edited October 22, 2014 by Iceman77 Share this post Link to post Share on other sites
nullrick 10 Posted October 22, 2014 I don't know what's wrong, but it's not working. Tried both ways and changed "myHelo" to what I needed. I changed it to ["door_rear", 1, true]; and other values as well. Maybe the Huron doesn't have properly designated doors for scripts yet? Share this post Link to post Share on other sites
2nd ranger 282 Posted October 22, 2014 It's "Door_rear_source". Use the config viewer to find out the AnimationSources for vehicles. Or the A3 assets list. Share this post Link to post Share on other sites
nullrick 10 Posted October 22, 2014 You're both glorious! Thank you very much! Especially for that sources list, Ranger. Share this post Link to post Share on other sites
iceman77 18 Posted October 23, 2014 ikr . . could have looked in the cfgviewer :p Share this post Link to post Share on other sites
frost995 13 Posted November 19, 2014 heli1 AnimateDoor ["Door_rear_source", 1, true] :D 1 Share this post Link to post Share on other sites
Erwin23p 34 Posted November 19, 2014 Thanks, very useful. :) Share this post Link to post Share on other sites
jshock 513 Posted November 20, 2014 (edited) I did this for another thread in the A3 Q&A Forum, but I figured it's relevant here as well, for those interested. Binds user custom action keys #9 and #10 to open/close the rear ramp of the Huron: //in the init.sqf if (hasInterface && !isDedicated) then { _animateDoors = (findDisplay 46) displayAddEventHandler ["KeyDown", { _handled = false; if ((_this select 1) in (actionKeys "User9") && ((typeOf vehicle player) == "B_Heli_Transport_03_F")) then { (vehicle player) animateDoor ["Door_rear_source", 0]; _handled = true; }; if ((_this select 1) in (actionKeys "User10") && ((typeOf vehicle player) == "B_Heli_Transport_03_F")) then { (vehicle player) animateDoor ["Door_rear_source", 1]; _handled = true; }; _handled; }; }; EDIT: For those of you who only want to define one user action key (this is cleaned up a bit as well :D): //in the init.sqf if (hasInterface && !isDedicated) then { _animateDoors = (findDisplay 46) displayAddEventHandler ["KeyDown", { _veh = vehicle player; _handled = false; if ((_this select 1) in (actionKeys "User9") && ((typeOf _veh) == "B_Heli_Transport_03_F")) then { if (((_veh) doorPhase "Door_rear_source") > 0) then { (_veh) animateDoor ["Door_rear_source", 0]; _handled = true; } else { (_veh) animateDoor ["Door_rear_source", 1]; _handled = true; }; }; _handled; }; }; Edited November 21, 2014 by JShock 1 Share this post Link to post Share on other sites
intrepid_rabbit 0 Posted December 28, 2021 Hey I know this thread is old, but I'm having an issue. The heli1 AnimateDoor ["Door_rear_source", 1, true] code changes the rear ramp from closed to open instantly, without the animation of it actually opening. I found somewhere a script that does allow for the animated opening of the ramp but cannot, for the life of me, find it anywhere anymore. Do any of you know what I'm talking about? And can anyone please help? Thank you, Rabbit Share this post Link to post Share on other sites
NunesSergio 17 Posted December 28, 2021 12 minutes ago, intrepid_rabbit said: Hey I know this thread is old, but I'm having an issue. The heli1 AnimateDoor ["Door_rear_source", 1, true] code changes the rear ramp from closed to open instantly, without the animation of it actually opening. I found somewhere a script that does allow for the animated opening of the ramp but cannot, for the life of me, find it anywhere anymore. Do any of you know what I'm talking about? And can anyone please help? Thank you, Rabbit Just use "false" as the third parameter of this command: heli1 AnimateDoor ["Door_rear_source", 1, false] 1 Share this post Link to post Share on other sites
intrepid_rabbit 0 Posted December 28, 2021 🤦♂️ Yup. Thanks! Share this post Link to post Share on other sites
stegman 3 Posted January 28, 2022 Pushing my luck i know, but since the thread is active again; Would it be possible to see this if the heli is under say 10 feet of the ground? So the doors open and close as it lands or takes off? 1 Share this post Link to post Share on other sites
Harzach 2517 Posted January 28, 2022 42 minutes ago, stegman said: Would it be possible It's Arma! Quick and dirty: //give your helicopter the variable name "heli1" //paste into heli1's init field: [] spawn { while {alive heli1} do { if (getPosATL heli1#2 < 3) then { heli1 AnimateDoor ["Door_rear_source", 1, false] } else { heli1 AnimateDoor ["Door_rear_source", 0, false] }; sleep 1; } }; Share this post Link to post Share on other sites
stegman 3 Posted January 28, 2022 DUDE! That is awesome! Thanks so much. Tested and works on the Huron! but..one Welsh guy to another;) ..how would i do this for the ghoshawk? I tried this, but it wont work.. [] spawn { while {alive heli1} do { if (getPosATL heli1#2 < 3) then { ( _this select 0 ) animateDoor ["Door_R", 1, false]; ( _this select 0 ) animateDoor ["Door_L", 1, false]; } else { ( _this select 0 ) animateDoor ["Door_R", 0, false]; ( _this select 0 ) animateDoor ["Door_L", 0, false]; }; sleep 1; } }; I'm guessing its the #2 bit, right? Anyway, i don't want to push it, thanks again mate. I'll figure it out from here hopefully. 🙂 And i'll check out your other links there! thanks. Share this post Link to post Share on other sites
Harzach 2517 Posted January 28, 2022 if (getPosATL heli1#2 < 3) then # is shorthand for "select", so this says "if heli1's height above terrain level is less than 3 meters, then..." The problem is that "_this" is not defined. [] spawn { while {alive heli1} do { if (getPosATL heli1#2 < 3) then { heli1 animateDoor ["Door_R", 1, false]; heli1 animateDoor ["Door_L", 1, false]; } else { heli1 animateDoor ["Door_R", 0, false]; heli1 animateDoor ["Door_L", 0, false]; }; sleep 1; } }; Of course, we could also bypass variable names by passing the vehicle via params: [this] spawn { params ["_this"]; while {alive _this} do { if (getPosATL _this#2 < 3) then { _this animateDoor ["Door_R", 1, false]; _this animateDoor ["Door_L", 1, false]; } else { _this animateDoor ["Door_R", 0, false]; _this animateDoor ["Door_L", 0, false]; }; sleep 1; } }; 1 Share this post Link to post Share on other sites
Harzach 2517 Posted January 28, 2022 15 minutes ago, stegman said: i don't want to push it The forums are here for all to ask questions. Bring 'em! (btw, I'm not Welsh per se, but it's in my blood from several generations ago. I've always felt a connection.) Share this post Link to post Share on other sites
stegman 3 Posted January 28, 2022 1 hour ago, Harzach said: if (getPosATL heli1#2 < 3) then # is shorthand for "select", so this says "if heli1's height above terrain level is less than 3 meters, then..." The problem is that "_this" is not defined. Huh....ok, cool. Yet it worked on the Huron. Odd. 🤔 anyway... Quote [this] spawn { params ["_this"]; while {alive _this} do { if (getPosATL _this#2 < 3) then { _this animateDoor ["Door_R", 1, false]; _this animateDoor ["Door_L", 1, false]; } else { _this animateDoor ["Door_R", 0, false]; _this animateDoor ["Door_L", 0, false]; }; sleep 1; } }; Now, this works fine! 😁 Thanks a lot mate. looks pretty good i think. Better than mushing yourself against a closed door anyway! 😆 1 hour ago, Harzach said: The forums are here for all to ask questions. Bring 'em! Your gonna regret that! 😉 I have a bunch! of questions, such as "Can i get a medic to drop used 'medical Garbage' when healing?" and a more involved Logistics "Hump and Dump" project im making zero progress on! Quote (btw, I'm not Welsh per se, but it's in my blood from several generations ago. I've always felt a connection.) ( I've had a chat with the the Senedd, and that makes you welsh, butty 😉 ) again, thanks for your help dude. You definitely seem to know your stuff. Share this post Link to post Share on other sites
Harzach 2517 Posted January 28, 2022 24 minutes ago, stegman said: Yet it worked on the Huron. Nope! We used its variable name "heli1" throughout. 24 minutes ago, stegman said: You definitely seem to know your stuff. Hah, thanks, but make no mistake, I'm low-mid level. But there are a bunch of folks around here who will be able to answer pretty much any question you might have. 1 Share this post Link to post Share on other sites
stegman 3 Posted January 28, 2022 3 minutes ago, Harzach said: Nope! We used its variable name "heli1" throughout. ..i see now. 😶 I'd butchered another script and merged them. I completely see the issue. Thanks mate. 1 Share this post Link to post Share on other sites