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 03-28-2012, 06:44 PM
melasuda melasuda is offline
Approved Member
 
Join Date: Feb 2012
Posts: 44
Default

I solved it, and add a new condition to red won message.

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;

public class Mission : AMission
{

    const int MinSubMissionsforBlueSuccess = 2; //two Objectives successfull to win this Battle
    int BlueMissionSuccesses = 0;
    

    public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);
        
        AiAction Action = GamePlay.gpGetAction(shortName);

        if (Action != null)
            Action.Do();


        if ("centro".Equals(shortName) && active)
        {
            GamePlay.gpHUDLogCenter("centro completado");
            GamePlay.gpGetTrigger(shortName).Enable = false;
            
            BlueMissionSuccesses++; // Added
        }
        if ("grupo2".Equals(shortName) && active)
        {
            GamePlay.gpHUDLogCenter("grupo2 completo");
            GamePlay.gpGetTrigger(shortName).Enable = false;
            

            BlueMissionSuccesses++;  // Added
        }

        if ("tiempo".Equals(shortName) && active) 
        { 
        		GamePlay.gpHUDLogCenter("red win");			
        		GamePlay.gpGetTrigger(shortName).Enable = false;	
        		GamePlay.gpGetTrigger("centro , grupo2").Enable = false;
}
        
        if (BlueMissionSuccesses >= MinSubMissionsforBlueSuccess)
        {
   
            GamePlay.gpHUDLogCenter("Blue Win");
        }
        
            GamePlay.gpGetTrigger(shortName).Enable = false;
		}

			
    }
And this is the mission to test

Code:
[PARTS]
  core.100
  bob.100
[MAIN]
  MAP Land$Online_Map
  BattleArea 0 0 40960 40960 10000
  TIME 12
  WeatherIndex 0
  CloudsHeight 1000
  BreezeActivity 10
  ThermalActivity 10
[GlobalWind_0]
  Power 3.000 0.000 0.000
  BottomBound 0.00
  TopBound 1500.00
  GustPower 5
  GustAngle 45
[splines]
[AirGroups]
  BoB_RAF_F_FatCat_Early.01
[BoB_RAF_F_FatCat_Early.01]
  Flight0  1
  Class Aircraft.SpitfireMkIIa
  Formation VIC3
  CallSign 26
  Fuel 100
  Weapons 1
  Scramble 1
  SpawnFromScript 1
  Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_RAF_F_FatCat_Early.01_Way]
  NORMFLY 19904.00 23573.33 500.00 300.00
  NORMFLY 24320.00 29823.10 500.00 250.00
  LANDING 25664.00 30143.10 500.00 250.00
[CustomChiefs]
[Stationary]
  Static5 Stationary.Austin_K2_Ambulance gb 19573.80 20469.03 0.00 
  Static4 Stationary.Austin_K2_Ambulance gb 19631.32 20529.08 0.00 
  Static3 Stationary.Austin_K2_Ambulance gb 19691.38 20571.60 0.00 
  Static2 Stationary.Austin_K2_Ambulance gb 20438.89 20873.56 0.00 
  Static1 Stationary.Austin_K2_Ambulance gb 20433.95 20898.26 0.00 
  Static0 Stationary.Austin_K2_Ambulance gb 20433.95 20922.96 0.00 
[Buildings]
[BuildingsLinks]
[Trigger]
  paso TPassThrough 5 2 24309 24881 1250
  grupo2 TGroundDestroyed 33 19641 20530 300
  tiempo TTime 300
  centro TGroundDestroyed 32 20431 20894 100
[Action]
  paso ASpawnGroup 1 BoB_RAF_F_FatCat_Early.01
[BirthPlace]
  BirthPlace_0 1 24000 24597 0 16 1 1 . . .
  BirthPlace_1 2 23023 21822 1000 5 1 1 . . .
[BirthPlace1]
  Aircraft.Bf-110C-7
  Aircraft.Bf-109E-1
  Aircraft.Ju-87B-2
  Aircraft.Bf-109E-4

Last edited by melasuda; 03-28-2012 at 06:49 PM.
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 02:52 AM.


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