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

Ok now I am going to jump to objective missions which is blocked region after the AI despawner.

Here I have modified an Onplace enter piece of code, original from the collection at 1C, but when the player enters a plane an objective is created, I trigger the TrigMis(), again this triggers the list of objectives in the objective mission list and randomly selects an objective. The selection times out after 30 minutes (period for testing) before objective reset and another objective mission could be loaded. Every player who enters an aircraft wll get a message of the current objective, the opposing team gets a warning a player enters and gets the message to defend that objective, or they could go after their objective. Again as other random lists of missions sets you can have nulls, (there is plenty to play with anyway), currently even though I have a number of objective missions in the lists for each side there is only one objective mission, I’ve yet to create some more, maybe some users can create some! The time reset is still under consideration, deciding on reset on completion or time reset, or both. At the moment objectives do reset on completion and time resets, but not in the case of non completion.


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

    #region OnPlaceEnter Welcome Tx, objective creation

    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);
        AiAircraft aircraft = actor as AiAircraft;
        if (aircraft != null)            
            switch (aircraft.Army())
            {
                case 1:
                    if (aircraft.Type() == AircraftType.Bomber)
                    {
                        { GamePlay.gpHUDLogCenter(new Player[] { player }, "Bombers, Check your maps for targets!"); }                        
                    }
                    else { GamePlay.gpHUDLogCenter(new Player[] { player }, "Fighters, Escort Bombers or Patrol the lines!"); }                    
                    pUK4 = true;// set main mission objective group activation true/false
                    TrigMis();// apply the truth
                    break;
                case 2:
                    if (aircraft.Type() == AircraftType.Bomber)
                    {
                        { GamePlay.gpHUDLogCenter(new Player[] { player }, "Bombers, uberprüfen Sie Ihre Karten fur Ziele!"); }                        
                    }
                    else { GamePlay.gpHUDLogCenter(new Player[] { player }, "Fighters, Escort Bombers oder Patrol den Zeilen!"); }                    
                    pDE4 = true;
                    TrigMis();
                break;
            }           
    }

    #endregion

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

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