View Single Post
  #2  
Old 05-18-2011, 10:22 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

The method I used to delay the start of a flight is as follows. There could very well (and probably is) be a better way.

1. Create a trigger that fires after the desired amount of time in the FMB.

2. Create an action that spawns the aircraft you want in the FMB.

3. Put code like this in the script file. Specifically in the OnTrigger() method.

Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        //call base classes OnTrigger method.
        base.OnTrigger(missionNumber, shortName, active);

        //if the trigger that was called is the trigger that we're looking for
        if (shortName.Equals("triggerName") && active)
        {
            AiAction action = GamePlay.gpGetAction("actionName"));
            if (action != null)
                 action.Do();

        }
"triggerName" and "actionName" are the names that you gave the trigger and action in the FMB.
Reply With Quote