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 > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-13-2011, 04:31 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Removes abandoned planes.

Below is a small script that will load random missions at a specified interval. Change the strings "DEMissionPath" and "UKMissionPath" to wherever you're keeping your missions, then add the names of the missions to the List below that. Change the int below that to the interval you want them to be loaded in minutes.

Right now, the strings and Lists are populated with the values I'm using in my mission. You will have to change them

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

using System.Diagnostics;

public class Mission : AMission
{
    //paths to missions
    string DEMissionPath = "missions/Multi/Dogfight/OpDynamo/DEMissions/";
    string UKMissionPath = "missions/Multi/Dogfight/OpDynamo/UKMissions/";

    //missions to randomly select from
    List<string> DEMissions = new List<string> { "110_1.mis", "111_1.mis", "111_2.mis", "111_3.mis", "88_1.mis", "88_2.mis",
                                                    "88_3.mis"};
    List<string> UKMissions = new List<string> { "Hurri_1.mis", "Defiant_1.mis", "Hurri_2.mis" };

    //interval to load random missions. In minutes.
    int randInterval = 30;

    //timers for missions
    Stopwatch randTimer = new Stopwatch();

    public override void OnTickGame()
    {
        base.OnTickGame();

        //check mission timers
        if (randTimer.Elapsed.Minutes >= randInterval)
        {
            randTimer.Restart();
            Random rand = new Random();
            if (DEMissions.Count > 0)
                GamePlay.gpPostMissionLoad(DEMissionPath + DEMissions[rand.Next(0, DEMissions.Count)]);
            if (UKMissions.Count > 0)
                Timeout(5, () => { GamePlay.gpPostMissionLoad(UKMissionPath + UKMissions[rand.Next(0, UKMissions.Count)]); });
        }
    }
}
Reply With Quote
 


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 08:54 PM.


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