View Single Post
  #2  
Old 02-27-2012, 12:24 AM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

Next block is all the mission lists; here I am using a part of C# “lists”. Here I am making life easier for a user by a simple layout to add user missions, the syntax is quite simple. Also note I have places for mission and messages. To add missions just add a new line within code block brackets and add a coma for each new line, noting the last list line does not have a coma.

new SubM (mission, Message all, Message Red, Message Blue)

Code:
/*=========================================*/

    #region Inputs  for Missions, Triggered Missions & Messages

    //NOTE: place sub missions into "sub" folder
    //NOTE: sub mis 0~99 series nums
    //If you add sub missions to input region, add new lines to list below(index numbering)
    //Mis Input layout: new SubM(Mission, Message all, Message Red, Message Blue)    

    List<SubM> SubMs = new List<SubM>
    {       
        new SubM ("Sub00.mis", "Hurricanes on Patrol", "Hun Patrol !!", "Auctung Hurricanes !"),
        new SubM ("Sub01.mis", "Messers on Patrol", "JG on Patrol", "RAF Search !!"),
        new SubM ("Sub02.mis", "Bomber Command", "Bomber Escort required", "Auctung Englander Bombers"),
        new SubM ("Sub03.mis", "KG Forming up", "Scramble Bombers inbound", "Angels 8"), 
        new SubM ("Subnull.mis", "random null Sub4", null, null),
        new SubM ("Subnull.mis", "random null Sub5", null, null),
        new SubM ("Subnull.mis", "random null Sub6", null, null),
        new SubM ("Subnull.mis", "random null Sub7", null, null),
        new SubM ("Subnull.mis", "random null Sub8", null, null),
        new SubM ("Subnull.mis", "random null Sub9", null, null),
        new SubM ("Subnull.mis", "random null Sub10", null, null) 
    };
  
    /*=========================================*/

    // Triggered Mission inputs and setup
    //NOTE: place triggered missions into "tm" folder

    /*=========================================*/

    //Triggered Mission lists for UK
    //NOTE: UK = 100~149 series num    
    //If you add missions to input region, add new lines to list below(index numbering)

    List<TM100> TM100s = new List<TM100>
    { 
        new TM100 ("t100.mis", "Triggered mission 100", "Intercept the blue hound", "Intercepters are coming Blue"),
        new TM100 ("t101.mis", "Triggered mission 101", "Intercept the blue hound", "Intercepters are coming Blue"),
        new TM100 ("t102.mis", "Triggered mission 102", "Intercept the blue hound", "Intercepters are coming Blue"),
        new TM100 ("t103.mis", "Triggered mission 103", "Intercept the blue hound", "Intercepters are coming Blue"),// add comma for each new line
        new TM100 ("t104.mis", "Triggered mission 104", "Intercept the blue hound", "Intercepters are coming Blue"),
        new TM100 ("tnull.mis", "random null TM5", null, null),
        new TM100 ("tnull.mis", "random null TM6", null, null),
        new TM100 ("tnull.mis", "random null TM7", null, null),
        new TM100 ("tnull.mis", "random null TM8", null, null),
        new TM100 ("tnull.mis", "random null TM9", null, null),
        new TM100 ("tnull.mis", "random null TM10", null, null)
    };

    /*=========================================*/

    //Objective Triggered Mission lists for UK
    //NOTE: UK = 150~199 series num    
    //If you add missions to input region, add new lines to list below(index numbering)

    List<TM150> TM150s = new List<TM150>
    { 
        new TM150 ("t150.mis", "Objective mission 150 KILL BILL", "Bill has fled the building fire, get him!", "Save Bill!"),
        new TM150 ("t151.mis", "Objective mission 151 KILL BILL", "Bill has fled the building fire, get him!", "Save Bill!"),
        new TM150 ("t152.mis", "Objective mission 152 KILL BILL", "Bill has fled the building fire, get him!", "Save Bill!"),
        new TM150 ("t153.mis", "Objective mission 153 KILL BILL", "Bill has fled the building fire, get him!", "Save Bill!"),// add comma for each new line
        new TM150 ("t154.mis", "Objective mission 154 KILL BILL", "Bill has fled the building fire, get him!", "Save Bill!")        
    };

    /*=========================================*/
    
    // Triggered Mission lists for DE
    //NOTE: DE = 200~249 series num 
    //If you add missions to input region, add new lines to list below(index numbering)
    
    List<TM200> TM200s = new List<TM200>
    { 
        new TM200 ("t200.mis", "Triggered mission 200", "Interceptors coming RED", "Intercept the Red devil"),
        new TM200 ("t201.mis", "Triggered mission 201", "Interceptors coming RED", "Intercept the Red devil"),
        new TM200 ("t202.mis", "Triggered mission 202", "Interceptors coming RED", "Intercept the Red devil"),
        new TM200 ("t203.mis", "Triggered mission 203", "Interceptors coming RED", "Intercept the Red devil"),// add comma for each new line
        new TM200 ("t204.mis", "Triggered mission 204", "Interceptors coming RED", "Intercept the Red devil"),
        new TM200 ("tnull.mis", "random null TM5", null, null),
        new TM200 ("tnull.mis", "random null TM6", null, null),
        new TM200 ("tnull.mis", "random null TM7", null, null),
        new TM200 ("tnull.mis", "random null TM8", null, null),
        new TM200 ("tnull.mis", "random null TM9", null, null),
        new TM200 ("tnull.mis", "random null TM10", null, null)

    };

    /*=========================================*/

    // Triggered Objective missions lists for DE uk
    //NOTE: DE = 250~299 series num 
    //If you add missions to input region, add new lines to list below(index numbering)

    List<TM250> TM250s = new List<TM250>
    { 
        new TM250 ("t250.mis", "Objective mission 250 KILL BOB", "Save BOB!", "BOB has fled the building fire, get him!"),
        new TM250 ("t251.mis", "Objective mission 251 KILL BOB", "Save BOB!", "BOB has fled the building fire, get him!"),
        new TM250 ("t252.mis", "Objective mission 252 KILL BOB", "Save BOB!", "BOB has fled the building fire, get him!"),
        new TM250 ("t253.mis", "Objective mission 253 KILL BOB", "Save BOB!", "BOB has fled the building fire, get him!"),// add comma for each new line
        new TM250 ("t254.mis", "Objective mission 254 KILL BOB", "Save BOB!", "BOB has fled the building fire, get him!")
    };

    #endregion

    /*=========================================*/
The observant will have noticed I have some null missions aswell, this is the neat bit of random dynamic play. Note I have in the sub missions folder a null mission of the map in use, but nothing else. If you call a mission even a null you need to load something or the server will create an error, so hence we load just the map name.

Why? You may ask; this is about chance, there will be a chance that on the time period nothing happens. Lists actually numbers missions by their input location, their actual name is irrelevant, and so you can actually list the same mission several times as I have done with the null mission.

Example of chance, if you are calling the listed missions by random chance and you had 100 missions where 50 were nulls, 10 were mission x and the rest were single missions. There is 50% chance nothing will happen on the selection time period, there is also 10% chance mission x will load and 1% chance any of the others will load. Basically you can weight the chances of what mission will load by having more of the same mission in the list, but note keeping null missions where nothing happens is important as well. The reason is this allows the frequency of the main timers to run faster, but then not overload the map with too many missions running at once.

All missions in the script are randomised selection, I have lists for, Sub missions (SubM), Triggered missions UK (TM100), DE (TM200) and objective lists UK(TM150) and DE(TM250).

Note, I use fairly generic naming for all subs, triggered and objective missions and only name the main mission for the title name. Long names in code just wastes space, also makes editing harder.

Last edited by Smokeynz; 02-27-2012 at 12:32 AM.
Reply With Quote