Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > CoD Multiplayer

CoD Multiplayer Everything about multiplayer in IL-2 CoD

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #31  
Old 04-28-2011, 04:52 PM
mcler002 mcler002 is offline
Approved Member
 
Join Date: Mar 2011
Location: UK
Posts: 277
Smile My mission update

Update for my online map

not sure if the script for disabling ai controls works though :S

Ross

Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;

public class Mission : AMission
{


    public override void OnTickGame()
    {

            if (Time.tickCounter() %  54000 == 18000)
            {
                
                GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/Ross/OnlineBOBb1.mis");
				GamePlay.gpHUDLogCenter("Intel: 4x He115's, Heading for Convoy!");
			}
		        
            if (Time.tickCounter() %  99000 == 36000)
            {
                
                GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/Ross/OnlineBOBb2.mis");
				GamePlay.gpHUDLogCenter("Intel: 8x He111's, Heading for Lympne!"); 
			}

            if (Time.tickCounter() %  108000 == 27000)
            {
                
                GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/Ross/OnlineBOBr1.mis");
				GamePlay.gpHUDLogCenter("Intel: 12xBlenheim, Heading for Calais Marck!"); 
			}
	}


// destroys aircraft abandoned by a player
    public void _DespawnEmptyPlane(AiActor actor)
    {
        if (actor == null)
        { return; }

        Player[] Players = GamePlay.gpRemotePlayers();

        bool PlaneIsEmpty = true;

        foreach (Player i in Players)
        {
            if ((i.Place() as AiAircraft) == (actor as AiAircraft))
            {
                PlaneIsEmpty = false;
                break;
            }
        }

        if ((PlaneIsEmpty) && (actor as AiAircraft).IsAirborne())
        {

            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsElevatorDisabled);
            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsAileronsDisabled);
            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsRudderDisabled);
            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng0TotalFailure);
            //for 2mots
            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng1TotalFailure);

            //then wait 1sec?
            Timeout(1.0, () =>
            {
                (actor as AiAircraft).Destroy();
            });

        }
        else if (PlaneIsEmpty)
        {
            (actor as AiAircraft).Destroy();
        }
    }

    public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceLeave(player, actor, placeIndex);
        _DespawnEmptyPlane(actor);
    }
    // destroys crushlanded aircraft in 10 minutes
    public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftCrashLanded(missionNumber, shortName, aircraft);
        Timeout(600, () =>
        {
            aircraft.Destroy();
        });
    }
}
Please make sure you change the file directory to your "set-up"
Attached Files
File Type: zip OnlineBOB UPD 280411.zip (8.5 KB, 26 views)

Last edited by mcler002; 04-28-2011 at 04:56 PM.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:32 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.