View Single Post
  #1  
Old 10-31-2012, 12:01 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

the orginal OnTrigger is defined in the Battle-Script:
Code:
public virtual void OnTrigger(int missionNumber, string shortName, bool active)
{
    if (this.missions.Count > 0)
    {
        foreach (AMission mission in this.missions)
        {
            if (mission.IsMissionListener(missionNumber))
            {
                mission.OnTrigger(missionNumber, shortName, active);
            }
        }
    }
    else if (active)
    {
        AiAction action = this.GamePlay.gpGetAction(ActorName.Full(missionNumber, shortName));
        if (action != null)
        {
            action.Do();
        }
    }
}
If you override the OnTrigger - Method, you create a empty new method so the ability to spawn Airgroups etc is lost, this is nessesary to avoid side-effects.
So to get the old behavior you must insert code to spawn the Actors again for example with:
Code:
    public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);


        AiAction action = GamePlay.gpGetAction(ActorName.Full(missionNumber, shortName));
        if (action != null)
        {
            action.Do();
        }
    }

Last edited by FG28_Kodiak; 10-31-2012 at 12:10 PM.
Reply With Quote