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
  #9  
Old 03-14-2012, 08:29 PM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

I thought about this a bit more, I think you can solve this by creating a separate void

The trick is keep the 2 triggers separate, but instead of calling the action or text from the trigger call a void
You need a bool or interger count in the trigger to act as a reference that the condition has been met then call the void

within the void have conditional if statement or switch, in the case of each bool or interger count being this state or value then call the result if it hasnt had both triggers call yet nothing happens, or you could call a text message "half the column destroyed" .

the following might work, it is something I use for other things, but no real reason this wont work here for this.
code itself may require tweaking a little, but you get the idea

Code:


private int column;

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

if ("Target1".Equals(shortName) && active)       
{
column = column + 1;   
callcolumn();
GamePlay.gpGetTrigger(shortName).Enable = false;
}

if ("Target1_1".Equals(shortName) && active)       
{
column = column + 1;  
callcolumn();
GamePlay.gpGetTrigger(shortName).Enable = false;
}

}

private void callcolumn()
{

switch (column)
{
case 1
GamePlay.gpHUDLogCenter(" Half the Column destroyed!!!");

break;
case 2
column = 0;
GamePlay.gpHUDLogCenter("Column destroyed!!!");

break;
}

}
updated with minor corrections

Last edited by Smokeynz; 03-15-2012 at 06:12 AM.
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 02:17 PM.


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