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
  #16  
Old 05-28-2012, 04:49 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

Freyhay, this should give you a head start with multiple grouped trigger objective.

All 3 ships must be destroyed before the objective is complete.
Use it for just about anything. Your Triggers are called Ship1, ship2 etc.


Code:
    int TotalRedShipsDestroyed = 0;
	const string Objective_Ships = "  English Supply Tankers 3 of 3,";	//BlueObjective  RedShips Destroyed

	bool ship1 = false; 	//English Supply Tanker 1 of 3	ship1
    bool ship2 = false; 	//English Supply Tanker 2 of 3	ship2	
    bool ship3 = false; 	//English Supply Tanker 3 of 3	ship3



  public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);

            if ("ship1".Equals(shortName) && active)
                {
                    TotalRedShipsDestroyed++;
                    GamePlay.gpLogServer(null, "British Ship " + TotalRedShipsDestroyed.ToString() + " of 10 destroyed!!!", new object[] { });
                    ship1 = true;
                }

                if ("ship2".Equals(shortName) && active)
                {
                    TotalRedShipsDestroyed++;
                    GamePlay.gpLogServer(null, "British Ship " + TotalRedShipsDestroyed.ToString() + " of 10 destroyed!!!", new object[] { });
                    ship2 = true;
                }

                if ("ship3".Equals(shortName) && active)
                {
                    TotalRedShipsDestroyed++;
                    GamePlay.gpLogServer(null, "British Ship " + TotalRedShipsDestroyed.ToString() + " of 10 destroyed!!!", new object[] { });
                    ship3 = true;
                }
				
				
				 if (ship1 && ship2 && ship3)
                {
                    GamePlay.gpHUDLogCenter("English Supply ships headding North have been destroyed!!!");
                    GamePlay.gpGetTrigger(shortName).Enable = false;
                    Timeout(10, () =>
                    {
                        GamePlay.gpLogServer(null, "Blue Objective  Completed!!!", new object[] { });
                        GamePlay.gpHUDLogCenter("Blue Objective  Completed!!!");
						Objective_Total_Blue += (Objective_Ships);
                    });
                }
	}
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
 


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 09:57 AM.


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