theregurgitator 10 Posted September 25, 2014 I am trying to make a mission with a sniper on a helicopter trying to take out a vehicle (using Firing From Vehicles) and I recorded the helicopter's movement so the mission could be played solo as the sniper. I have already figured out how to get the vehicle being chased to stop (using 'waitUntil {targetTruck getHit "<part>" > 0.2}' to detect if <part> was hit). I was wondering if there was any particularly easy way to stop the unitPlay so I could seamlessly have the helicopter react to the vehicle being disabled. Code so far: _movementdata1 = //a good 1-2 minutes of positional data _sequence1 = [sniperHelo, _movementdata1] spawn BIS_fnc_UnitPlay; waitUntil {targetTruck getHit "motor" > 0.1} || {targetTruck getHit "fuel" > 0.4} || {targetTruck getHit "hull" > 0.5} || {targetTruck getHit "tire" > 0.1}; //still tweaking values here hint "vehicle disabled"; //for testing targetTruck setHit ["motor", 0.95]; targetTruck setHit ["fuel", 0.0]; targetTruck setHit ["hull", 0.6]; //code to make helicopter react would go here I plan to release this mission on Steam Workshop when I get all the problems/gameplay flow worked out and the production value is high enough. ---------- Post added at 04:51 ---------- Previous post was at 04:27 ---------- I have found a way to stop it, but it isn't "seamless": sniperHelo setFuel 0; sleep 0.01; sniperHelo setFuel 1; This stops the helicopter where it is (stationary), and plays a bit of the engine failure/engine relight sound effects. Share this post Link to post Share on other sites
theregurgitator 10 Posted September 29, 2014 I did it ... mostly. This makes the vehicle hitch in place for a bit but does the hitching does not kill immersion or cinematic qualities. Here is my release version. All I ask is for users to keep the "by TheRegurgitator" part in and credit me for the code somewhere visible (in case you binarized the mission files or something). // --- get vehicle out of unitPlay V1.1 --- by TheRegurgitator //out of fuel method stops vehicle momentarily, but it retains its velocity when it is set back to _vel //get velocity _vel = velocity _vehicle; //stop unitPlay _vehicle setFuel 0; sleep 0.001; _vehicle setFuel 1; // you can change this value to have it get the fuel from beforehand, but usually fuel is not an issue when using unitPlay //set velocity back to previous _vehicle setVelocity [ (_vel select 0), (_vel select 1), (_vel select 2) ]; Ask me any questions you have about how to implement this. Share this post Link to post Share on other sites
theregurgitator 10 Posted October 2, 2014 If anybody finds a way to eliminate the "hitch" inherent in this, that would be awesome. Also, I have only tried this with the MH6, so I am not quite sure about land vehicles being able to use this. The setVelocity might phase the vehicle into the ground a bit, which might provoke ARMA PHYSICSTM. Other helicopters should be fine. Share this post Link to post Share on other sites
hansen111 12 Posted December 15, 2014 Functions viewer in your editor is your friend, stop playback any time by: _vehicle setvariable ["BIS_fnc_unitPlay_terminate",true]; Share this post Link to post Share on other sites
theregurgitator 10 Posted December 18, 2014 Thanks, that's just what I needed! Share this post Link to post Share on other sites