I've got the script working from here:
https://theairtacticalassaultgroup.c...ad.php?t=13953
Using this to insert one mission at the start:
But I'd like it to insert missions at a Random time interval between 1-10 minutes or so after mission start. And for the life of my I can't figure out how to make that happen.Code:using System; using System.Collections; using maddox.game; using maddox.game.world; using part; using System.Collections.Generic; using System.IO; public class Mission : AMission { // global variables private static string userdocpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); // DO NOT CHANGE private static string CLOD_PATH = userdocpath + @"/1C SoftClub/il-2 sturmovik cliffs of dover/"; // DO NOT CHANGE private static string FILE_PATH = @"missions/Single/BoF1/"; // mission install directory (CHANGE AS NEEDED) Random RandomIncident = new Random(); public override void OnBattleStarted() { base.OnBattleStarted(); List<string> RandomMissions = GetFilenamesFromDirectory(CLOD_PATH + FILE_PATH + "/mis", "BoF"); // bomber missions from the red directory if (RandomMissions.Count > 0) { string RandomMission = RandomMissions[RandomIncident.Next(RandomMissions.Count)]; GamePlay.gpPostMissionLoad(RandomMission); } } public List<string> GetFilenamesFromDirectory(string dirPath, string mask = null) { List<string> list = new List<string>(); string[] filenames = Directory.GetFiles(dirPath, "*" + mask + "*.mis"); list = new List<string>(filenames); return list; } }
If anyone's curious, I'm trying to replicate the "Phony War" a bit by having a Hurricane squadron patrol France with the chance of only running into 1 or 2 German aircraft. Each MIS file in my folder has maybe 1 or 2 Recon planes on different paths, with a few missions that have a larger force to shake things up a bit. Really just a way for my to practice my gunnery.
Any clues?
Also was trying to add a "random weather" script from another post, but I think that's WAY beyond my capabilities.
Bookmarks