Quote:
Originally Posted by klem
Ataros has suggested loading a second FMB mission at the appropriate time but I don't see how I can tie that to an existing mission i.e. an existing Convoy route that receives a second attack later on. It seems I would have to show the convoy route in the new mission to include the Attack and that would duplicate the one in the first misson.
|
Hi klem, I think the best way to accomplish that would be to use a trigger, action, and a script. You would set a trigger to fire off after how ever many seconds you want, then create an airgroup to attack the convoy. In the airgroup's properties I believe you have to click a check box that says something like "script spawn only".
After that, create an action that will spawn the airgroup you just created. You could even make the action spawn the original airgroup if you want the second attack force to be exactly the same as the first. Just remember to uncheck "script spawn only" so that the airgroup spawns at the start of the mission like normal.
The script will look like this:
Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;
public class Mission : AMission
{
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("attackConvoyDelay") && active)
{
AiAction action = GamePlay.gpGetAction("attackConvoy"));
if (action != null)
action.Do();
}
}
So if you put this code into the mission's script file, it will trigger your action whenever your trigger... triggers.
Note that I've named the trigger "attackConvoyDelay" and the action "attackConvoy". You can change them to whatever you want, just make sure they are the same in both the mission and the script.
I hope this helps.