![]() |
#21
|
|||
|
|||
![]() Quote:
![]() ![]() "I've a dream" ![]() OK what are the Problems. The first, not only the plane itself has a name which contains "BoB_RAF_F_FatCat_Early", the pilot (and gunners) also contains it. We need something that checked if it is a plane. For this we need a if-clause that check: if (actor is AiAircraft) so we only get the plane. If we want examine the crew extra we could use: if (actor is AiPerson) So now we only get the plane, but an other problem still exist. i use the if - clause: if (planecounter >= 2) but whats the problem, with this if-clause the planes spawn after shooting down two, but also after three , four .... so it should changed in if (planecounter == 2) so the script should now look like: Code:
using System; using System.Collections.Generic; using maddox.game; using maddox.game.world; public class Mission : AMission { int planecounter = 0; public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages) { base.OnActorDead(missionNumber, shortName, actor, damages); AiAction MakeNewAircraft = GamePlay.gpGetAction("SpawnAircraft"); if (actor != null && MakeNewAircraft != null && actor is AiAircraft) { if (actor.Name().Contains("BoB_RAF_F_FatCat_Early")) { planecounter++; if (planecounter == 2) { MakeNewAircraft.Do(); GamePlay.gpHUDLogCenter("New Enemy spawned!"); } } } } } ![]() |
|
|