View Single Post
  #15  
Old 05-22-2011, 11:07 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Ataros View Post
It seems like this script I use does not destroy ships loaded by a submission. Other ground units are destroyed as intended. What can be wrong? IIRC ships belong to AiGroundActor

Code:
    //Ground objects (except AA Guns) will die after 55 min when counted from their birth

    public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
    {
        base.OnActorCreated(missionNumber, shortName, actor);
        //Ground objects (except AA Guns) will die after 55 min when counted from their birth
        if (actor is AiGroundActor)
            if ((actor as AiGroundActor).Type() != maddox.game.world.AiGroundActorType.AAGun)
                Timeout(3300, () =>
                {
                    if (actor != null)
                    { (actor as AiGroundActor).Destroy(); }
                }
                        );
    }
Complete code here http://forum.1cpublishing.eu/showpos...5&postcount=41
Confirmed, the script does not destroy ships. What can be the reason?
This is what happens in 3-4 hours after starting a mission.
https://lh4.googleusercontent.com/_S...5-21_00016.jpg
Reply With Quote