![]() |
|
#38
|
|||
|
|||
|
@David:
I use the InternalTypeName of the plane, here others for the flyable planes: bob:Aircraft.Bf-109E-3 bob:Aircraft.Bf-109E-3B bob:Aircraft.Bf-109E-1 bob:Aircraft.Bf-109E-4 bob:Aircraft.Bf-109E-4B bob:Aircraft.Bf-110C-4 bob:Aircraft.Bf-110C-7 bob:Aircraft.Ju-87B-2 bob:Aircraft.Ju-88A-1 bob:Aircraft.He-111H-2 bob:Aircraft.He-111P-2 bob:Aircraft.SpitfireMkIa bob:Aircraft.SpitfireMkI bob:Aircraft.HurricaneMkI bob:Aircraft.HurricaneMkI_dH5-20 bob:Aircraft.BlenheimMkIV bob:Aircraft.SpitfireMkIIa to figure this out the KI-Only Planes you can add: Code:
GamePlay.gpLogServer(null, "InternalTypeName: {0}", new object[]{(actor as AiAircraft).InternalTypeName()});
To destroy the planes from a specific Airgroup is not possible in OnActorCreated(..) at the time of creation there is no Airgroup. But you can use the ActorName Code:
GamePlay.gpLogServer(null, "ActorName: {0}", new object[] { (actor as AiAircraft).Name() });
Code:
public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
{
base.OnActorCreated(missionNumber, shortName, actor);
if (actor != null && actor is AiAircraft)
{
GamePlay.gpLogServer(null, "InternalTypeName: {0}", new object[] { (actor as AiAircraft).InternalTypeName() });
GamePlay.gpLogServer(null, "ActorName: {0}", new object[] { (actor as AiAircraft).Name() });
}
}
Server: InternalTypeName: bob:Aircraft.Bf-109E-4 Server: ActorName: 0:BoB_LW_LG2_I.000 Server: InternalTypeName: bob:Aircraft.He-111H-2 Server: ActorName: 0:BoB_LW_KuFlGr_706.000 Server: InternalTypeName: bob:Aircraft.He-111H-2 Server: ActorName: 0:BoB_LW_KuFlGr_706.001 Server: InternalTypeName: bob:Aircraft.He-111H-2 Server: ActorName: 0:BoB_LW_KuFlGr_706.002 Server: InternalTypeName: bob:Aircraft.He-111H-2 Server: ActorName: 0:BoB_LW_KuFlGr_706.010 Server: InternalTypeName: bob:Aircraft.He-111H-2 Server: ActorName: 0:BoB_LW_KuFlGr_706.011 Server: InternalTypeName: bob:Aircraft.He-111H-2 Server: ActorName: 0:BoB_LW_KuFlGr_706.012 so if you like to destroy planes from a Airgroup you could use: Code:
if (actor is AiAircraft && actor.Name().Contains("BoB_LW_KuFlGr_706"))
{
Timeout(60, () => // Time in Seconds
{
(actor as AiAircraft).Destroy();
});
}
Code:
if (actor is AiAircraft && actor.Name().Contains("BoB_LW_KuFlGr_706.010"))
{
Timeout(60, () => // Time in Seconds
{
(actor as AiAircraft).Destroy();
});
}
|
| Thread Tools | |
| Display Modes | |
|
|