Jump to content
Sign in to follow this  
laverniusregalis

BIS_fnc_unitPlay on aircraft?

Recommended Posts

Would it be possible to actually do this? I'm trying to get an ally to take off from a position at a hangar but when he taxis to the runway instead of using the taxiway he just crashes into the control tower. The two problems with using unitPlay instead of the AI so far: 1. The jet floats when my recording is being played. 2. It seems all velocity is killed after unitPlay stops. Any help?

Share this post


Link to post
Share on other sites

Haven't tested with jets (or even cars), but it sure works in local and host with choppers. I've used this:

.sqf

//[color="#FF0000"]executed [heli, _Path1,[bIS_object, "doneflying"]] spawn BIS_fnc_UnitPlay; [/color]

waitUntil {(BIS_Object getVariable "doneflying")};

_code = {
	while {([color="#FF0000"]YOUR CONDITION(S)[/color])} do
	{		   
	   heli setBehaviour "CARELESS";
	   heli setPosASL [3847.1,11216,4.45914]; //[color="#FF0000"]position where UnitPlay stops[/color]
          	   heli setVelocity [0, 0, -0.1]; //[color="#FF0000"]should keep the chopper from taking off, not sure how it applies to your case -- jets[/color]

		sleep 0.01;
	};
};
[objNull, objNull, rSPAWN, [], _code] call RE;

waitUntil {([color="#FF0000"]LATER CONDITION(S)[/color])};

//[color="#FF0000"]then you do whatever with the chopper after UnitPlay is done and your conditions met[/color] 

heli doMove getMarkerPos "wp4";

_Way4 = mygroup addWaypoint [wp4,3]; 
_Way4 setWaypointSpeed "FULL";

sleep 0.1;

If the jet's floating, maybe its engine is not on? Try calling the recording and using "jet engineOn true", maybe? Hope it's any help!

Unfortunately, as posted here (http://forums.bistudio.com/showthread.php?167714-BSI_fnc_UnitPlay-not-working-on-dedicated-server) before, it won't work in dedicated. Which is frustrating, since it's a great solution for AI to handle aircraft.

Share this post


Link to post
Share on other sites

That code is to keep a chopper from taking off after a unitPlay is done. Also the RE framework doesn't exist in A3.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×