View Single Post
  #7  
Old 10-17-2011, 05:30 PM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

ok tried it, but i still dont know when and how i use those parts....
this is what i have so far....

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

public class 
Mission AMission
{

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

        
MissionNumberListener = -1;
    }

    public 
override void OnActorCreated(int missionNumberstring shortNameAiActor actor)
    {
        
base.OnActorCreated(missionNumbershortNameactor);

        if (
actor is AiAircraft)
        {
            switch ((
actor as AiAircraft).InternalTypeName())
            {

                case 
"bob:Aircraft.He-111P-2":

                    
Timeout(420, () =>    // Time in Seconds
                         
{
                             (
actor as AiAircraft).Destroy();
                         });
                    break;
            }
        }
    }


 
public 
override void OnTickGame()
{
Random ZufaelligeMission = new Random();
       
            switch (
ZufaelligeMission.Next(1,5))
            {
                case 
1:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\mission1.mis");
                break;
                case 
2:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission2.mis");
                break;
                case 
3:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission3.mis");
                break;
                case 
4:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission4.mis");
                break;
                
            }

}
}
}

there is a main mission, with a bf109 and 9He's(which should be destroyed after xx seconds)

after xx seconds i want the game to load one mission ,selected randomly out of 4 submissions.
i also want the He's loaded with the submission to be destroyed after the xx seconds, like the ones from the main mission.
and i want the game to repeat that process, so that every xx seconds a new mission is loaded randomly.....so that the mission can run forever
__________________

Last edited by David198502; 10-17-2011 at 05:33 PM.
Reply With Quote