View Single Post
  #2  
Old 12-22-2011, 10:07 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

If you want to observer the individual ground actors use this:
Code:
public override void OnActorDestroyed(int missionNumber, string shortName, maddox.game.world.AiActor actor)
{
    if (actor is AiGroundActor)
    {
        AiGroundActor groundActor = actor as AiGroundActor;
        if (groundActor.Type() == AiGroundActorType.ShipTransport /* || groundActor.Type() == AiGroundActorType.ShipDestroyer || ... */)
        {
            GamePlay.gpHUDLogCenter("Ship destroyed");
        }
    }
}
If you are interested in the complete ground group (e.g. a column or tank group) use this:
Code:
public override void OnActorDestroyed(int missionNumber, string shortName, maddox.game.world.AiActor actor)
{
    if (actor is AiGroundGroup)
    {
        AiGroundGroup groundGroup = actor as AiGroundGroup;
        if (groundGroup.GroupType() == AiGroundGroupType.Ship)
        {
            GamePlay.gpHUDLogCenter("Ship destroyed");
        }
    }
}
Reply With Quote