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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2012, 09:53 AM
melasuda melasuda is offline
Approved Member
 
Join Date: Feb 2012
Posts: 44
Default blue won message

Hi, there is my cuestion.

I create a scrip to launch message wen a 1 objetive is destroy.
But how can i launch test message if all target all destroyed?.

There is my scrip

Quote:
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();

GamePlay.gpGetTrigger(shortName).Enable = false;




if ("calaiscompleto".Equals(shortName) && active)
{
GamePlay.gpHUDLogCenter("objetivo este de calais completado");
GamePlay.gpGetTrigger(shortName).Enable = false;
GamePlay.gpGetTrigger("dunkerkecompleto").Enable = false;
}
if ("dunkerkecompleto".Equals(shortName) && active)
{
GamePlay.gpHUDLogCenter("objetivos este de dunkerke completado");
GamePlay.gpGetTrigger(shortName).Enable = false;
GamePlay.gpGetTrigger("calaiscompleto").Enable = false;
}


}
Thx
Reply With Quote
  #2  
Old 03-27-2012, 10:17 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

There are different approches to this problem, in these i use a counter

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 ("calaiscompleto".Equals(shortName) && active)
        {
            GamePlay.gpHUDLogCenter("objetivo este de calais completado");
            GamePlay.gpGetTrigger(shortName).Enable = false;
            GamePlay.gpGetTrigger("dunkerkecompleto").Enable = false;

            BlueMissionSuccesses++; // Added
        }
        if ("dunkerkecompleto".Equals(shortName) && active)
        {
            GamePlay.gpHUDLogCenter("objetivos este de dunkerke completado");
            GamePlay.gpGetTrigger(shortName).Enable = false;
            GamePlay.gpGetTrigger("calaiscompleto").Enable = false;

            BlueMissionSuccesses++;  // Added
        }
        
        
        if (BlueMissionSuccesses >= MinSubMissionsforBlueSuccess)
        {
   
            GamePlay.gpHUDLogCenter("Blue Win!");
        }
        
            GamePlay.gpGetTrigger(shortName).Enable = false;
    } 
}
Reply With Quote
  #3  
Old 03-27-2012, 11:35 AM
melasuda melasuda is offline
Approved Member
 
Join Date: Feb 2012
Posts: 44
Default

Thank.

I go to test it this afternoon.
Reply With Quote
  #4  
Old 03-28-2012, 05:03 PM
melasuda melasuda is offline
Approved Member
 
Join Date: Feb 2012
Posts: 44
Default

Hi Kodiak.

Frist thx for the scrip
Second.
I have a problem. When I destroy frist target, message target destroy run well, but wen i destroy second target, no appears message on screen and not show blue won.
Reply With Quote
  #5  
Old 03-28-2012, 05:15 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Hm seems a it's a problem with the trigger, can you show me your mission please?
Reply With Quote
  #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
Reply


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 06:46 AM.


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