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
  #6  
Old 08-09-2012, 03:43 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

There are different ways to spawn a new aircraft. Via action is the simplest .

To do so, create a new mission, place the Airgroup on the map, enable only script spawn in the Object Options (if you don't do that your Airgroup spawns at beginning of the mission and than again if you call it via action.Do()). Create an action for it in the script -> action tab, give a simple name for example SpawnEnemyPlane, select the airgroup to spawn. Then save and save the mission.


Add a flag to the cs file, to avoid multiple spawning of the airgroup
Code:
    bool Spawned = false;

Then in your OnTickGame
Code:
if (I_Altitude > 400 && !Spawned)
{
    Spawned = true;
    GamePlay.gpHUDLogCenter("above 400");
    AiAction action = GamePlay.gpGetAction("SpawnEnemyPlane"));
    if (action != null)
    {
        action.Do();
    }
}
Reply With Quote
 

Thread Tools
Display Modes

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 06:03 PM.


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