Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #21  
Old 10-16-2011, 04:38 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Quote:
Originally Posted by David198502 View Post
i tried the script with the planecounter command.but when i fly the mission, the second group spawns after i shot down only one plane...it will spawn a new group everytime i shoot a single plane.
Yes the script is not complete , there are two problems unsolved in it, i always hope the "students" find the problems and eliminate them.
"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!");
                }
            }
        }
    }
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:59 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.