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 10-18-2011, 08:40 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Thank you very much for great explanation! I will be using it in the future.

Currently I am struggling with triggers for my R2 and R3 mission and hope you can advise what I should look at.

I am loading 2 submissions 1_E3_air0.mis , 1_E3_air1.mis randomly.
2nd one is a copied 1st one with aircraft changed from Wellington to Blenheim. Name of airgroup remained the same.

Triggers in submissions are called 1_E3_air and 1_E3_air. Same name now but I tried also checking 1_E3_air0 and 1_E3_air1 in a loop with the same result. The trigger was created in the 1st submission and copied to the 2nd in a notepad.
1_E3_air TPassThrough 1 gb02.07 53073 33421 2000
1_E3_air TPassThrough 1 gb02.07 53073 33421 2000

As a result, the 1st submission trigger does not work at all. The second submission trigger works 2 or 5 times (maybe depending on number of aircraft in the group?)

Questions:
Why the trigger in 1st submission may not wark?
In which cases && active) check must be added?
When GamePlay.gpGetTrigger(shortName).Enable = false; must be edded? Naryv does not use it in some of his examples.
How to make 2nd trigger "work" only once per mission?
Can all triggers have the same name?
When I copy a mission file should I change a name of an airgroup in it by hand?
If I include all the triggers into the host-mission only would they trigger when submission airgroups pass-through?


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


        string[] attackSector = { "C5", "D4", "E3" };           // sectors attacked 

        // air missions
        #region air missions 
        
       string currMissType = "air";

            for (int j = 1; j < 3 ; j++) // Army
            {   
                for (int i = 0; i < attackSector.Length ; i++)
                {
                    string str = (j).ToString() + "_" + attackSector[i].ToString() + "_" + currMissType; // +k.ToString(); // + missionType[1].ToString() //string str = i.ToString() + "_" + (j).ToString() + "_gg";
// && active) is this needed?
                        if (str.Equals(shortName)) // && active)    is this needed?      // test      
                        {                      
                           sendChatMessageTo(-1, str , null);                   // test msg
                        
                           if (j == 1) // red win
                            {
                               currBonusLoss = allowed109s - min109s;
                               if (currBonusLoss < 1) currBonusLoss++;

                               allowed109s = min109s;
                               ScoreRed += 1;

                                sendScreenMessageTo(-1, new string[] { "ru" }, "The Allies bombed the Axis' airfield! Limit of available Bf-109E4 is reduced by {0}!", new object[] { currBonusLoss });
                               sendScreenMessageTo(-1, "Красные разбомбили синий аэродром! Лимит доступных Bf-109E4 снижен на {0}!", new object[] { currBonusLoss });
                               sendChatMessageTo(-1, new string[] { "ru" }, "The Allies bombed the Axis' airfield! Limit of available Bf-109E4 is reduced by {0}!", new object[] { currBonusLoss });
                               sendChatMessageTo(-1, "ru", "Красные разбомбили синий аэродром! Лимит доступных Bf-109E4 снижен на {0}!", new object[] { currBonusLoss });
  // testing                             
                               sendScreenAndChatMessageTo( -1, new object[] { currBonusLoss },
                                   "Testing! sendScreenAndChatMessageTo Bf-109E4 is reduced by {0}!",
                                   "Тест! sendScreenAndChatMessageTo Bf-109E4 is reduced by {0}!");


                            }

                            else // blue win
                            {

                               allowedSpit2s = minSpit2s;
                               ScoreBlue += 1;

                               sendScreenMessageTo(-1, new string[] { "ru" }, "The Axis bombed the Allies' airfield! Limit of available Spitfire IIa  is reduced by {0}!", new object[] { currBonusLoss });
                               sendScreenMessageTo(-1, "Синие разбомбили красный аэродром! Лимит доступных Spitfire IIa снижен на {0}!", new object[] { currBonusLoss });
                               sendChatMessageTo(-1, new string[] { "ru" }, "The Axis bombed the Allies' airfield! Limit of available Spitfire IIa  is reduced by {0}!", new object[] { currBonusLoss });
                               sendChatMessageTo(-1, "ru", "Синие разбомбили красный аэродром! Лимит доступных Spitfire IIa снижен на {0}!", new object[] { currBonusLoss }); 

                            }
// do I need this?
                           //GamePlay.gpGetTrigger(shortName).Enable = false;   

                           break;
                        }

            }
        }
        #endregion    
}
If you would like to see the complete mission please let me know. But it is a mess now

Last edited by Ataros; 10-18-2011 at 09:32 AM.
Reply With Quote
  #2  
Old 10-18-2011, 09:16 AM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

thx Kodiak!you are really helpful and supportive not only for me, but i think for the whole community...i think with every question i ask, this thread gains worth...
this script works, and finally i have what i wanted to achieve, a infinite bomb raid on london...i have 50 submissions, each with 18 He's, and in every mission they bomb another area of the city...so after playing an hour, the center of london resembles Dresden in 45.combined with massive AAA this mission really looks nice...

however now i want to have british fighters as well in that mission... but i will try that for myself first, and if i run into trouble, i'm sure your knowledge will once again be useful...thx again Kodiak.....if this thread was more structured, it could serve as a knowledge-base.
__________________

Last edited by David198502; 10-18-2011 at 11:50 AM.
Reply With Quote
  #3  
Old 10-18-2011, 11:21 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

@Ataros:
Quote:
Why the trigger in 1st submission may not wark?
Could i have the complete script please?
Quote:
In which cases && active) check must be added?
active shows if a trigger is enabled (true) or (disabled), normaly its not needed if a trigger is not active OnTrigger(..) is not called, but may be changes in future
Quote:
When GamePlay.gpGetTrigger(shortName).Enable = false; must be edded? Naryv does not use it in some of his examples.
Depends on trigger type you use, by time there is no need but by others there can be, you should use it if there is a chance that the trigger can be activated a second time, by passthru for example it could happen
Quote:
How to make 2nd trigger "work" only once per mission?
I need to see the complete script, but normaly disable it with ActorName.Full().
Quote:
Can all triggers have the same name?
Yes. If the missionNumber is different.
Quote:
When I copy a mission file should I change a name of an airgroup in it by hand?
Not nessesary, depens on our code.
Quote:
If I include all the triggers into the host-mission only would they trigger when submission airgroups pass-through?
If MissionNumberListener = -1 they should.

Last edited by FG28_Kodiak; 10-18-2011 at 11:37 AM.
Reply With Quote
  #4  
Old 10-18-2011, 11:41 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by FG28_Kodiak View Post
@Ataros:

Could i have the complete script please?
Thank you very much! This is a very WIP version. Many things changed for testing. Please find it attached.
Attached Files
File Type: zip r_steppe.zip (25.2 KB, 9 views)
Reply With Quote
  #5  
Old 10-18-2011, 06:50 PM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

ok i tried to combine your last script with the one where the same airgroup gets respawned everytime you shot a certain amount down....

doesnt work...


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


public class 
Mission AMission
{
    
Stopwatch MissionTimer = new Stopwatch();

    public 
override void OnBattleStarted()
    {
        
base.OnBattleStarted();
        
MissionTimer.Start();
        
MissionNumberListener = -1;
    }


    public 
override void OnActorCreated(int missionNumberstring shortNameAiActor actor)
    {
        
base.OnActorCreated(missionNumbershortNameactor);

        if (
actor is AiAircraft)
        {
            switch ((
actor as AiAircraft).InternalTypeName())
            {

                case 
"bob:Aircraft.He-111P-2":

                    
Timeout(240, () =>    // Time in Seconds
                         
{
                             (
actor as AiAircraft).Destroy();
                         });
                    break;
            }
        }
    }
    
int planecounter 0;

    
    public 
override void OnActorDead(int missionNumberstring shortNameAiActor actor, List<DamagerScoredamages)
    {
        
base.OnActorDead(missionNumbershortNameactordamages);

        
AiAction MakeNewAircraft GamePlay.gpGetAction("SpawnAircraft");

        if (
actor != null && MakeNewAircraft != null && actor is AiAircraft)
        {
            if (
actor.Name().Contains("BoB_RAF_F_FatCat_Early"))
            {
                
planecounter++;

                if (
planecounter == 2)
                {
                    
MakeNewAircraft.Do();
                    
GamePlay.gpHUDLogCenter("New Enemy spawned!");
                }
            }
        }
    }
 
    public 
override void OnTickGame()
    {
    
        if(
MissionTimer.Elapsed.TotalSeconds >= 180)  //Loads a mission every 180s
        
{
            
Random ZufaelligeMission = new Random();

            
MissionTimer.Restart(); // Sets timer to 0 and start again
    
            
switch (ZufaelligeMission.Next(1,65))
            {
                case 
1:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission1.mis");
                    break;
                case 
2:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission2.mis");
                    break;
                case 
3:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission3.mis");
                    break;
                case 
4:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission4.mis");
                    break;
                case 
5:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission5.mis");
                    break;
                case 
6:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission6.mis");
                    break;
                case 
7:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission7.mis");
                    break;
                case 
8:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission8.mis");
                    break;
                case 
9:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission9.mis");
                    break;
                case 
10:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission10.mis");
                    break;
                case 
11:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission11.mis");
                    break;
                case 
12:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission12.mis");
                    break;
                case 
13:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission13.mis");
                    break;
                case 
14:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission14.mis");
                    break;
                case 
15:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission15.mis");
                    break;
                case 
16:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission16.mis");
                    break;
                case 
17:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission17.mis");
                    break;
                case 
18:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission18.mis");
                    break;
                case 
19:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission19.mis");
                    break;
                case 
20:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission20.mis");
                    break;
                case 
21:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission21.mis");
                    break;
                case 
22:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission22.mis");
                    break;
                case 
23:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission23.mis");
                    break;
                case 
24:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission24.mis");
                    break;
                case 
25:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission25.mis");
                    break;
                case 
26:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission26.mis");
                    break;
                case 
27:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission27.mis");
                    break;
                case 
28:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission28.mis");
                    break;
                case 
29:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission29.mis");
                    break;
                case 
30:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission30.mis");
                    break;
                case 
31:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission31.mis");
                    break;
                case 
32:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission32.mis");
                    break;
                case 
33:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission33.mis");
                    break;
                case 
34:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission34.mis");
                    break;
                case 
35:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission35.mis");
                    break;
                case 
36:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission36.mis");
                    break;
                case 
37:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission37.mis");
                    break;
                case 
38:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission38.mis");
                    break;
                case 
39:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission39.mis");
                    break;
                case 
40:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission40.mis");
                    break;
                case 
41:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission41.mis");
                    break;
                case 
42:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission42.mis");
                    break;
                case 
43:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission43.mis");
                    break;
                case 
44:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission44.mis");
                    break;
                case 
45:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission45.mis");
                    break;
                case 
46:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission46.mis");
                    break;
                case 
47:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission47.mis");
                    break;
                case 
48:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission48.mis");
                    break;
                case 
49:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission49.mis");
                    break;
                case 
50:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission50.mis");
                    break;
                case 
51:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission51.mis");
                    break;
                case 
52:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission52.mis");
                    break;
                case 
53:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission53.mis");
                    break;
                case 
54:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission54.mis");
                    break;
                case 
55:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission55.mis");
                    break;
                case 
56:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission56.mis");
                    break;
                case 
57:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission57.mis");
                    break;
                case 
58:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission58.mis");
                    break;
                case 
59:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission59.mis");
                    break;
                case 
60:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission60.mis");
                    break;
                case 
61:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission61.mis");
                    break;
                case 
62:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission62.mis");
                    break;
                case 
63:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission63.mis");
                    break;
                case 
64:
                    
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission64.mis");
                    break;
               
            }
        }
    }


__________________

Last edited by David198502; 10-18-2011 at 06:54 PM.
Reply With Quote
  #6  
Old 10-18-2011, 07:01 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Can i have the complete mission please?
Reply With Quote
  #7  
Old 10-18-2011, 08:18 PM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

here it is...

it also would be great if the hurris of the main mission-could be destroyed after a while as well, but they should remain longer on the map then the He's...tried that by myself, but without luck, so i deleted the part again from the script.
Attached Files
File Type: zip London.zip (41.7 KB, 17 views)
__________________
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 08:11 AM.


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