View Single Post
  #7  
Old 10-15-2011, 11:47 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

I've tested your mission, the problem is that the trigger is never triggered (testet it with different numbers of planes and plane types), then remove the trigger and made a new one but no effect, may be a bug in the Beta. Normaly your code should work.

So I made a workaroung without trigger.

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


public class Mission : AMission
{

    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)
        {
            if (actor.Name().Contains("BoB_RAF_F_FatCat_Early.000"))
            {

                MakeNewAircraft.Do();
                GamePlay.gpHUDLogCenter("New Enemy spawned!");
            }
        }
    }
}
What you need:
The script, a action in your Mission (i labled it "SpawnAircraft"), the name of the plane to destroy.
A new Airplane spawns after the previous is shoot down, you can improve it by adding a Planecount, etc.
Attached Files
File Type: zip SpawnAircraft.zip (1.2 KB, 19 views)

Last edited by FG28_Kodiak; 10-15-2011 at 01:03 PM.
Reply With Quote