Jump to content
LastNerve

Spawn AI or fix parachute

Recommended Posts

Hey guys Im making a MP killstreak mission. Everything works but have one problem. The AI unit dies after ejecting and parachutes down dead. So could someone either edit my script to stop the AI from dying or know how to get the AI character to spawn on your position without parachuting / use of triggers since players could be anywhere on the map. Either one will work I just did this Parachute because its what I knew how to do! Thanks in advance.

Spoiler

_killer = _this select 1;
_killed = _this select 0;
    if (isPlayer _killed) then
        {
        killstreak = 0; //if the player is killed his killstreak is reset to 0
    };
    
        if ((isplayer _killer) && (!isplayer _killed)) then
     {
        killstreak = killstreak + 1;
        if (killstreak == neededKillsForAI) then
     {
        killstreak = 0;
        drop_Action = player addAction ["call AI", 
         {
         _unit = _this select 0; //*caller of the action*//
                
         _dropMark =  createMarkerLocal ["Marker1", position _unit]; /////*Use Marker as player may move*////
                
        _dropPosition = getMarkerPos "Marker1";
            
        removeallActions _unit;
                
        _dropitem = selectRandom ["B_Soldier_F","B_Soldier_GL_F","B_Soldier_lite_F"];//*add items needed*//

                
                
        _DeliveryVeh = createVehicle ["C_Plane_Civil_01_racing_F",[(_dropPosition select 0)+600,(_dropPosition select 1),(_dropPosition select 2)],[], 0, "FLY"];
                
        _DeliveryVeh flyinHeight 250;
                
        _pilotGrp = createGroup independent;
                
        _dropPilot =_pilotGrp createUnit ["C_Marshal_F", position _DeliveryVeh,[],5,"NONE"];
                
        _dropPilot moveInDriver _DeliveryVeh;
                
        _DeliveryVeh move  _dropPosition;
                
        WaitUntil {(_DeliveryVeh distance2D _dropPosition) < 30};
                
        hint "Delivery Inbound";
                
        _releasePos = getPosATL _DeliveryVeh;
         
                
        _itemToDrop = createVehicle [_dropItem,[(_releasePos select 0),(_releasePos select 1),(_releasePos select 2)-10],[], 0, "FLY"];
                
        _dropParachute = "B_Parachute_02_F" createVehicle getPosATL _itemToDrop;
                
        _dropParachute attachTo [_itemToDrop, [0,0,1]]; //at value of 1 to prevent para from collapsing
            sleep 0.5; 
        while{alive _dropParachute}do{
                
                
                _itemToDrop setVelocity [0,0,-15];
                
                    if ((((position _itemToDrop)select 2)<1))exitWith{
                
                        _itemToDrop setVelocity [0,0,0];
                        detach _dropParachute;
                        deleteVehicle _dropParachute;
                
                        sleep 5;
                        _DeliveryVeh deleteVehiclecrew driver _DeliveryVeh;
                        deleteVehicle _DeliveryVeh;
                        deleteGroup _pilotGrp;
                        deleteMarkerLocal "Marker1";
                
                
                        };
                
                };
                
                
                
            }];
        };
    };


            

 

Share this post


Link to post
Share on other sites

Just make the unit invincible after you create it. _unit allowDamage false;

then wait for something else to make it  vulnerable again ;  _unit allowDamage true.

But your best bet is to drop these old lines with createVehicle, createGroup, createUnit (you should use createVehicleCrew), for something working fine at once:

_grp = [[(_dropPosition select 0)+250,(_dropPosition select 1),600], INDEPENDENT, ["C_Plane_Civil_01_racing_F"],[],[],[],[],[],270] call BIS_fnc_spawnGroup; _leader = leader _grp; _veh = vehicle _leader;

Share this post


Link to post
Share on other sites
22 minutes ago, Midnighters said:

isTouchingGround

is cool too.

isTouchingGround

 

Except for the remark i wrote in BIKI for this command :f:

  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, pierremgi said:

 

Except for the remark i wrote in BIKI for this command :f:

*shakes head in disappointment*  NOOOOOOOOO!!

  • Like 1

Share this post


Link to post
Share on other sites

That's Arma, and script writers' feeling btw. "Never mind if it works!"  :hehe:

  • Like 1

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

×