zagor64bz 1225 Posted July 8, 2019 Ok..I'm trying to make a little snippet to order the pilot to increase altitude while I'm in the gunner seat. So far I have an add action tied to a trigger with the player in the gunner seat as the condition. Here is what I have so far (extracted from an old mission): private ["_curAlt","_reqAlt"]; _curAlt = (Round(((getPosATL CoPilot01 select 2))/10)*10); IF ((Gunner Viper01) == player) THEN { IF (isNil "VendAlt") THEN {VendAlt = _curAlt;}; sleep 0.01; _reqAlt = VendAlt + 50; sleep 0.01; _endAlt = _reqAlt; [format["<t size='.6'>Make Alt %1</t>",(_endAlt)],-1.09,-.19,10,0] spawn BIS_fnc_dynamicText; if ((speed (vehicle player)) <= 25) then { (vehicle CoPilot01) flyInHeight _endAlt;; CoPilot01 doMove (position player); } else { (vehicle CoPilot01) flyInHeight _endAlt;; }; sleep 0.01; VendAlt = _endAlt; } ELSE { [format["<t size='.6'>'Hold Position'<br />to break orbit first..</t>"],-1.01,-.19,10,0] spawn BIS_fnc_dynamicText; }; As it is, it is working as intended. What I really want is to get rid of the "CoPilot01" variable name and get "Driver" instead. The reason is the co-pilot is spawned with a recruiting script. I tried with : -(driver (vehicle player)) -(driver Viper01) but no luck...any suggestion? Share this post Link to post Share on other sites
pierremgi 4822 Posted July 8, 2019 First of all, you can easily replace getPosATL CoPilot01 select 2 by the altitude of the vehicle itself: getPosATL viper01 select 2 same for (vehicle CoPilot01) flyInHeight _endAlt, Then, are you sure you are in the gunner seat as copilot? Depending on helo, the gunners are sometimes at doors, and the copilot is (always) at turret [0] see Viper01 turretUnit [0] instead of gunner Viper01 For driver, less problem. Just in case the turret is [-1] Share this post Link to post Share on other sites
zagor64bz 1225 Posted July 8, 2019 5 1 minute ago, pierremgi said: First of all, you can easily replace getPosATL CoPilot01 select 2 by the altitude of the vehicle itself: getPosATL viper01 select 2 same for (vehicle CoPilot01) flyInHeight _endAlt, Then, are you sure you are in the gunner seat as copilot? Depending on helo, the gunners are sometimes at doors, and the copilot is (always) at turret [0] see Viper01 turretUnit [0] instead of gunner Viper01 For driver, less problem. Just in case the turret is [-1] I was in the gunner seat of a AH64D. I did replace the getPosATL CoPilot01 select 2 WITH getPosATL viper01 select 2 ...and it worked.... ...so if I understand it should do like this? if ((speed (vehicle player)) <= 25) then { Viper01 flyInHeight _endAlt;; Viper01 doMove (position player); } else { Viper01 flyInHeight _endAlt;; }; Thank you mate! Share this post Link to post Share on other sites
pierremgi 4822 Posted July 8, 2019 yes. I guess viper01 is also the vehicle player. So no problem for writing what you want as far as you're in vehicle... But I don't really understand the viper01 doMove position player in this case... Perhaps needed to fly at a new altitude. That doesn't hurt. Share this post Link to post Share on other sites
zagor64bz 1225 Posted July 8, 2019 1 minute ago, pierremgi said: Perhaps needed to fly at a new altitude. That doesn't hurt. ..again thank you, man. Share this post Link to post Share on other sites