View Single Post
  #37  
Old 09-24-2011, 12:24 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Mington View Post

Adding the trigger in a script rather than via the FMB, to make it universal. Does the FMB write trigger code into the dot cs I wonder. I know that airfields have one radius and then another radius
Trigger has its own radius. It is set in FMB and is stored in a mission file, not in script file.

According to the devs to make FMB triggers work together with any script you can add this code to script. Action and trigger must have the same name in this case.
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();
    }
There are other more advanced and complex possibilities. Check out the _Triggers and actions folder in my archive or search forums for trigger script.

ps. BTW are you one of simhq admins by chance? I have trouble registering at simhq forums somehow. Same nickname.

Last edited by Ataros; 09-24-2011 at 12:31 PM.
Reply With Quote