Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   CoD Multiplayer (http://forum.fulqrumpublishing.com/forumdisplay.php?f=192)
-   -   Online / multiplayer missions go here (http://forum.fulqrumpublishing.com/showthread.php?t=21602)

Ataros 05-16-2011 05:42 AM

Current version of script from Repka server. Works like magic )
Feel free to use.

Code:

// v.1_17_04. script by oreva, zaltys, small_bee

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

public class Mission : AMission
{
   
// loading sub-missions
public override void OnTickGame()
{
    if (Time.tickCounter() % 216000 == 108000) // 216000=120 min repeat. 108000=60 min delay.
    {
        GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_small01.mis");
    }

    if (Time.tickCounter() % 216000 == 215999) // 216000=120 min repeat. 215999=120 min delay.
    {
        GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_small02.mis");
    }

    ///////////////////////

    if (Time.tickCounter() % 162000 == 9000) // 162000=90 min repeat. 9000=5 min delay.
  {
      GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_air01.mis");
      // GamePlay.gpHUDLogCenter("mis1 loaded!");

      double initTime = 0.0;
      Timeout(initTime += 600, () =>
      {
          GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E3!");
      });
      Timeout(initTime += 600, () =>
      {
          GamePlay.gpHUDLogCenter("Attention! Help is needed at E3/D4!");
      });

  }

    if (Time.tickCounter() % 162000 == 63000) //  ; 162000=90 min repeat, 63000 - 35 min delay.
    {
      GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_sea01.mis");
      // GamePlay.gpHUDLogCenter("mis2 loaded");

      double initTime = 0.0;
      Timeout(initTime += 500, () =>
      {
          GamePlay.gpHUDLogCenter("Attention! Cover your shipping at C4!");
      });
           
      Timeout(initTime += 300, () =>
        {
            GamePlay.gpHUDLogCenter("Attention! Friendly ships are under attack at C4!");
        });
    }

    if (Time.tickCounter() % 162000 == 117000) // 162000 == 117000 = 90 min repeat, 65 min delay
      {
          GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_air02.mis");
          // GamePlay.gpHUDLogCenter("mis3 loaded!");

          double initTime = 0.0;
          Timeout(initTime += 600, () =>
          {
              GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E3!");
          });
          Timeout(initTime += 300, () =>
          {
              GamePlay.gpHUDLogCenter("Attention! All airgroups please proceed to D2!");
          });
      }
}
////////////////////////////////////////////////////////////////////////////////////////////////////

// destroys aircraft abandoned by a player.
    private bool isAiControlledPlane (AiAircraft aircraft)
    {
                if (aircraft == null)
        {
                        return false;
                }

                Player [] players = GamePlay.gpRemotePlayers ();
                foreach (Player p in players)
        {   
                        if (p != null && (p.Place () is AiAircraft) && (p.Place () as AiAircraft) == aircraft)
            {
                                return false;
                        }
                }

                return true;
        }

        private void destroyPlane (AiAircraft aircraft) {
                if (aircraft != null) {
                        aircraft.Destroy ();
                }
        }

        private void explodeFuelTank (AiAircraft aircraft)
    {
                if (aircraft != null)
        {
                        aircraft.hitNamed (part.NamedDamageTypes.FuelTank0Exploded);
                }
        }

        private void destroyAiControlledPlane (AiAircraft aircraft) {
                if (isAiControlledPlane (aircraft)) {
                        destroyPlane (aircraft);
                }
        }

        private void damageAiControlledPlane (AiActor actor) {
                if (actor == null || !(actor is AiAircraft)) {
                        return;
                }

                AiAircraft aircraft = (actor as AiAircraft);

                if (!isAiControlledPlane (aircraft)) {
                        return;
                }

                if (aircraft == null) {
                        return;
                }

                aircraft.hitNamed (part.NamedDamageTypes.ControlsElevatorDisabled);
                aircraft.hitNamed (part.NamedDamageTypes.ControlsAileronsDisabled);
                aircraft.hitNamed (part.NamedDamageTypes.ControlsRudderDisabled);
                aircraft.hitNamed (part.NamedDamageTypes.FuelPumpFailure);

        int iNumOfEngines = (aircraft.Group() as AiAirGroup).aircraftEnginesNum();
        for (int i = 0; i < iNumOfEngines; i++)
        {
            aircraft.hitNamed((part.NamedDamageTypes)Enum.Parse(typeof(part.NamedDamageTypes), "Eng" + i.ToString() + "TotalFailure"));
        }

        /***Timeout (240, () =>
                {explodeFuelTank (aircraft);}
            );
        * ***/

        Timeout (300, () =>
                                {destroyPlane (aircraft);}
                        );
        }

    //////////////////////////////////////////

        public override void OnPlaceLeave (Player player, AiActor actor, int placeIndex)
    {
                base.OnPlaceLeave (player, actor, placeIndex);
                Timeout (1, () =>
                                {damageAiControlledPlane (actor);}
                        );
        }

        public override void OnAircraftCrashLanded (int missionNumber, string shortName, AiAircraft aircraft)
    {
                base.OnAircraftCrashLanded (missionNumber, shortName, aircraft);
                Timeout (300, () =>
            { destroyPlane(aircraft); }
                        );
        }
    public override void OnAircraftLanded (int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftLanded(missionNumber, shortName, aircraft);
        Timeout(300, () =>
            { destroyPlane(aircraft); }
            );
    }
   
   
//////////////////////////////////////////////////////////////////////////////////////////////////

    //Listen to events of every mission
    public override void Init(maddox.game.ABattle battle, int missionNumber)
    {
        base.Init(battle, missionNumber);
        MissionNumberListener = -1; //Listen to events of every mission
    }

 //////////////////////////////////////////////////////////////////////////////////////////////////

    //Ground objects (except AA Guns) will die after 55 min when counted from their birth

    public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
    {
        base.OnActorCreated(missionNumber, shortName, actor);
        //Ground objects (except AA Guns) will die after 55 min when counted from their birth
        if (actor is AiGroundActor)
            if ((actor as AiGroundActor).Type() != maddox.game.world.AiGroundActorType.AAGun)
                Timeout(3300, () =>
                {
                    if (actor != null)
                    { (actor as AiGroundActor).Destroy(); }
                }
                        );
    }

    /****
    //Ground objects will die after 55 min when counted from their birth
   
    public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
    {
        base.OnActorCreated(missionNumber, shortName, actor);

        //Ground objects will die after 55 min when counted from their birth
        if (actor is AiGroundActor)
            Timeout(3300, () =>
            {
                if (actor != null)
                { (actor as AiGroundActor).Destroy(); }
            }
                    );
    }
    ****/
}


Ataros 05-17-2011 12:40 PM

Quote:

Originally Posted by Groundhog (Post 283625)
Glad to help!

GH

I can not get the randomization part to work as I wrote here
http://forum.1cpublishing.eu/showpos...&postcount=109
and here
http://forum.1cpublishing.eu/showpos...&postcount=111

Could you have a look please.

UPD. fixed.

Why do you need the first part in your script with a trigger?
Did you check if it works without the first part? May it be the case that the 1st part is working but the 2nd does not as I included only the 2nd part in my script?

335th_GRAthos 06-15-2011 09:08 AM

Hallo Ataros,

I do not know if it is too much asking, can you post the missions you have running on the REPKA Server #(I do not know the number) the one with English Channel and the many objects moving around.

I could not find the server yesterday and I would ike to play around with my GPU settings (I only get 30fps with this gameset while the other REPKA English chanel map gives me 85fps and the islands map 110 with grass, shadows, roads off)...

~S~

Ataros 06-15-2011 09:15 AM

1 Attachment(s)
Hi GRAthos!

Please find Repka #1 mission attached. Repka #2 runs a mission by cFobos and I do not have it on my PC.

335th_GRAthos 06-15-2011 10:30 AM

Many Thanks !

:)


~S~

jojovtx 08-12-2011 01:08 PM

On Repka 2 is there any chance you can add the 110C4? I understand not having the C7 because it almost give an unfair balance in ground attack to blue. I cannot in good conscious fly on a server that does not have the 110C4 available though. :(

Thanks.

Ataros 08-12-2011 04:57 PM

rgr, asked BigRepa

Dangerousdave26 09-07-2011 08:37 PM

Quote:

Originally Posted by Ataros (Post 273758)
New version of "Battle of France"

Added guns to tankers.
Spawns assigned to runways on some airfields.
etc.


Ataros we are running this mission on our server (128BoFv1_6.mis). What is the suggested time frame to rotate maps?

Thanks

Richie 09-07-2011 11:25 PM

Where are the mission files stored once you build them. How do you get rid of them and how do you make them work? How come I can't select a plane in a coop mission like I could in IL-2? My dogfight mission bases don't show up at all. I sure liked Simple Simon IL-2. This thing is great but mission building...playing has me stumped :(

Richie 09-08-2011 02:04 AM

3 Attachment(s)
I just did get a coop to work and for some reason the missions are in the folder now. They weren't in there before the patch...weird. Now I'll see if I can make a Dogfight mission work. It's got to be something stupid that I'm not doing...me being the stupid part of it.

I've got to say sitting back and letting that mission play and listening to those 109s and Spitfires roar up and down this river on the new mid size map witch I like was a blast. The sound is fantastic :)


All times are GMT. The time now is 02:37 PM.

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