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-12-2012, 07:05 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

You Wizzards of Code! Ok will put this together and test. let you know in a little while
__________________
__________________
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
  #2  
Old 03-12-2012, 08:51 AM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

Isnt he sneaky
Reply With Quote
  #3  
Old 03-14-2012, 05:29 PM
wildwillie wildwillie is offline
Approved Member
 
Join Date: Aug 2010
Posts: 111
Default

Quote:
When you spawn a Group via action its the same as you load a submission. The 1: is the number of this submission (you can get the next Missionnumber with GamePlay.gpNextMissionNumber())
From my testing, the 1: occurs when there are duplicate Objects created with the same name. If you spawn in your plane name will be something like:

0:BoB_LW_StG77_Stab.000

after you land/crash/etc and create a new plane this one will be named:

1:BoB_LW_StG77_Stab.000
then next time
2:BoB_LW_StG77_Stab.000
etc.


This also occurs with AI planes created using sub missions.

WildWillie
Reply With Quote
  #4  
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
  #5  
Old 03-14-2012, 09:14 PM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

Hey Smokeynz,

I got the full script working based on Kodiak's script above with a little tweaking, but was only working if the chiefs spawned from the beginning of the battle. If the Chiefs were flagged to 'spawn on sctipt' the triggers would not activate.

So I have it all working great with the "bool Target1_1triggered = false;" script above.

Kodiak came back to me with a possible fix to make the triggers activate if chiefs 'Spawn from script'. I gave it a quick go this morning before work but did not activate triggers, will test properly tonight.

I will also give yours a shot as it is a different approach and would be interesting to see if "on the whole" it is a neater script or not. Will keep you both informed and send you the test mission tonight if I am stuck.
__________________
__________________
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
  #6  
Old 03-14-2012, 09:57 PM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

yes both work, the difference notwithstanding a little more complex with a void and switch, is it catches the half completed case for your outcome, and also you could add more triggers, like switch(column) for cases of 3, 4, 5, 6 and so on then do different things at different levels.

In this way you can also have other trigger results interact with main counter.
Case selection can be more useful when you want it more flexible for different outcomes.

A bool is true or false, so you really have only 2 states or maybe an elseif as a third. bool true and falses can end up in sequential if statements and you can trap yourself

Last edited by Smokeynz; 03-14-2012 at 10:42 PM.
Reply With Quote
  #7  
Old 03-14-2012, 10:03 PM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

Awesome I understand, I am keen to put your code together and see how it works. Will try tonight thanks Smokeynz
__________________
__________________
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
Reply

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:04 AM.


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