Results 1 to 30 of 33

Thread: Campaign progress script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ace 1lokos's Avatar
    Join Date
    Jan 2012
    Posts
    5,323
    Post Thanks / Like
    Total Downloaded
    1.04 GB

    Campaign progress script

    One of (many) complains of SP players is the lack of visible progress through campaigns.

    For "oficial" and third part campaigns at end of mission is show the default "Statistics" with player air kills (only) and squadron loses, and after a pre-made debriefing screen for success or failure, with the button for fly next mission or restart...

    Statistics.jpg

    Desastersoft campaigns improve this a bit, though use of custom DLL, showing more details of the mission, over a custom created interface:

    http://yoyosims.pl/sites/default/fil...tersoft_15.jpg

    REDUX campaign's use an script in a way I don't like, time from time a "score board" is show on screen... like in a football match.

    The "Geniok" template from 09/2011 used in "Cliffs of Dover" campaign and other 3rd part has a "parser" for supposed track player kills and show this in next mission briefing, but I an not able to make this work, probable some changes in patches affect that old code.

    Digging in "oldSukhoi leftovers of war" I find an old (06/2011) Russian made campaign that include a script that partially "band-aid" this lack.

    The script track:

    Enemy losses
    Side looses
    Squadron looses
    Player victories


    Through:

    Code:
       int r  =  0;
    	bool cmpl = false;
    	int cEnemy = 0;
        int cFriendly = 0;
        int cPlayer = 0;
        int MySquad = 0;
       	string b, tx1;
    	string[] br = new string[100]; 
    	int cEnemyS, 	cFriendlyS, cPlayerS, MySquadS;
    - Question; is possible add track for ground kills, for use in bombers campaigns?

    So at end of mission, after "Statistics" page you have:

    Mission results.jpg

    But... an "It's CloD!" (script author point this issue*), notice at top/left of the screen: "Battle Failure", no mater if you/your side won the battle this is showed.

    *
    The result of the last mission will be displayed in the post-flight briefing; do not pay attention to the inscription on the top left "Battle Failure".
    Above text is my interpretation of Google translation from Russian (editable part).

    I notice this script has no reference for "Campaign.dll" at top, but have for "//-$debug"
    so I add, with the path in the format of 5.00x (third part campaigns in Documents\1C... \custom folder):
    //$reference parts/core/Campaign.dll (thanks Varrattu for show the new path).

    But this don't change the "Battle Failure" screen...

    The script - UPDATE - Fixed the Battle Failure/Success screen

    Spoiler: 

    Code:
    //$reference parts/core/Campaign.dll
    //-$debug
    using System;
    using System.IO;
    using maddox.game;
    using maddox.game.world;
    using System.Collections.Generic;
    
    public class Mission : maddox.game.campaign.Mission
    {
    
        int r  =  0;
    	bool cmpl = false;
    	int cEnemy = 0;
        int cFriendly = 0;
        int cPlayer = 0;
        int MySquad = 0;
       	string b, tx1;
    	string[] br = new string[100]; 
    	int cEnemyS, 	cFriendlyS, cPlayerS, MySquadS;	    
    
     public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> initiatorList) 
        {              
            if (actor is AiAircraft) 
            {
                if (!(actor is AiAircraft))
    			return; 
    		
    		if (shortName.IndexOf("92Sqn",0) > 0)  MySquad++;
    		
                if (actor.Army() == 2) cEnemy++;
                if (actor.Army() == 1) cFriendly++;
                if (actor.Army() == 2) {
                    if (GamePlay.gpPlayer().Place() != null) {
                        bool playerWin = false;
                        foreach (DamagerScore i in initiatorList) {
                            if (i.initiator != null && i.initiator.Actor == GamePlay.gpPlayer().Place()) {
                                playerWin = true;
                            }
                        }
                        if (playerWin) cPlayer++;
                    }
                }
               SaveRezult (cmpl); 
            }
        }
    
    private void SaveRezult (bool CComplite) 
    {
    int n1 = 1;
    	int j = 0;
    StreamReader f2 = new StreamReader(@"C:\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_over_Dunkik\m1.txt");
    b =  f2.ReadLine();
    cEnemyS = Int32.Parse(b) + cEnemy;
    b =  f2.ReadLine();
    cFriendlyS = Int32.Parse(b) + cFriendly;
    b =  f2.ReadLine();
    MySquadS = Int32.Parse(b) + MySquad;
    b =  f2.ReadLine();
    cPlayerS = Int32.Parse(b) + cPlayer;
    f2.Close();
    
    StreamWriter f3 = new StreamWriter(@"C:\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_over_Dunkik\m2.txt");
    f3.WriteLine(String.Format("{0}", cEnemyS));
    f3.WriteLine(String.Format("{0}", cFriendlyS));
    f3.WriteLine(String.Format("{0}", MySquadS));
    f3.WriteLine(String.Format("{0}", cPlayerS));
    f3.Close();
    	
    StreamReader f1 = new StreamReader(@"C:\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_over_Dunkik\m2.briefing");
    do 
    {
    b =  f1.ReadLine();
    br[n1++] = b;
    }				
     while (b  != "[2]") ;
    
    					f1.Close();		
    
    					StreamWriter f = new StreamWriter(@"C:\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_over_Dunkik\m2.briefing");
    					while (++j<n1)	 f.WriteLine(br[j]);
    					if (CComplite)
    					f.WriteLine("<Name>");
    					f.WriteLine("Success");
    					f.WriteLine("<Description>");
    					if (CComplite) f.WriteLine("Mission accomplished!");
    					else f.WriteLine("Mission tasks incomplete!");
    					if (MySquad >0) f.WriteLine("MISSION RESULTS");
    					else f.WriteLine("Overall, the squad performed well on the last mission.");
    
    					f.WriteLine(String.Format("RAF claims  -  {0} ", cEnemy));
    					f.WriteLine(String.Format("RAF losses  -  {0} ", cFriendly));
    					f.WriteLine(String.Format("Squadron claims  -  {0} ", MySquad));
    					f.WriteLine(String.Format("Personal claims  -  {0} ", cPlayer));
    
    					j = (cEnemy - cFriendly);
    				
    					if (j<0) f.WriteLine("The overall outcome of the mission was unsatisfactory. The RAF suffer heavy losses.");
    					if (j==0)
    						{
    						 if (cEnemy > 0) f.WriteLine("RAF's losses in the last battle were moderate. However, the overall performance needs to improve, the Luftwaffe has more aircraft.");
    						else 	 f.WriteLine("The squadron's performance needs to improve.");
    						}
    					if (j > 0)   f.WriteLine("The RAF it has performed well, the enemy's losses have been heavy.");
    
    					f.WriteLine(tx1);
    						
    					f.WriteLine("  ");
    					f.WriteLine("CAMPAIGN PROGRESS");
    					f.WriteLine(String.Format("RAF claims  -  {0} ", cEnemyS));
    					f.WriteLine(String.Format("RAF losses  -  {0} ", cFriendlyS));
    					f.WriteLine(String.Format("Squadron losses  -  {0} ", MySquadS));
    					f.WriteLine(String.Format("Personal claims  -  {0} ", cPlayerS));
    
    
    					f.WriteLine("[3]");
    					f.WriteLine("<Name>");
    					f.WriteLine("Failure");
    					f.WriteLine("<Description>");
    					if (CComplite) f.WriteLine("Mission accomplished!");
    					else f.WriteLine("Mission tasks incomplete!");
    							if (MySquad >0) f.WriteLine("Results of the last mission:");
    							else f.WriteLine("The squadron's performance needs to improve.");
    
    					f.WriteLine(String.Format("RAF claims  -  {0}, ", cEnemy));
    					f.WriteLine(String.Format("RAF losses  -  {0}, ", cFriendly));
    					f.WriteLine(String.Format("Squadron losses  -  {0}, ", MySquad));
    					f.WriteLine(String.Format("Personal claims  -  {0}, ", cPlayer));
    					
    					j = (cEnemy - cFriendly);
    				
    					if (j<0) f.WriteLine("The RAF's performance in the battle has been unsatisfactory, attrition favors the Luftwaffe.");
    					if (j==0)
    						{
    						 if (cEnemy > 0) f.WriteLine("RAF's losses in the last battle were moderate. However, the overall performance needs to improve, the Luftwaffe has more aircraft.");
    						else 	 f.WriteLine("The squadron's performance was unsatisfactory.");
    						}
    					if (j > 0)   f.WriteLine("The RAF has performed well, causing significant losses to the enemy.");
    
    					f.WriteLine(tx1);
    					if (MySquad>0)
    					f.WriteLine("The squadron's performance was remarkable.");  
    					else 
    					f.WriteLine("The squadron's performance increased. Very well, gentlemen.");  
    
    					f.WriteLine(" ");	
    					f.WriteLine("CAMPAIGN PROGRESS");
    					f.WriteLine(String.Format("RAF claims  -  {0} ", cEnemyS));
    					f.WriteLine(String.Format("RAF losses  -  {0} ", cFriendlyS));
    					f.WriteLine(String.Format("Squadron losses  -  {0} ", MySquadS));
    					f.WriteLine(String.Format("Personal claims  -  {0} ", cPlayerS));
    					f.WriteLine("<Slide>");
    					if (CComplite) 
    					f.WriteLine("CampaignSuccess2.jpg");
    					else f.WriteLine("CampaignFailure2.jpg");
    					f.WriteLine("<Caption>");
    					f.Close();
    
    }
    
    // --------------------------
    
    public override void OnBattleStarted() 
    {			
    
    					base.OnBattleStarted() ;
    					MissionNumberListener = -1;
    					tx1 = "The mission's tasks were not all completed. Replay is recommended.";
    					SaveRezult (false) ;
        }
    
        public override void OnTrigger(int missionNumber, string shortName, bool active) {
    		
            if ("trigger_3".Equals(shortName) && active) 
    		{
               	if (++r  == 4) 
    			{
    			GamePlay.gpHUDLogCenter("Waypoint reached.");
    			tx1 = "Task have been completed.";
    			
    cmpl = true;
    			SaveRezult (true) ;
    			}
    			else GamePlay.gpHUDLogCenter(String.Format("#  {0}", r));
    
                GamePlay.gpGetTrigger(shortName).Enable = false;
            }
    
    
    if ("trigger_1".Equals(shortName) && active) 
    		{
               
    				
                GamePlay.gpGetTrigger(shortName).Enable = false;
    			if (++r  == 4) 
    {
    			GamePlay.gpHUDLogCenter("Waypoint reached.");
    			tx1 = "Task have been completed.";
    cmpl = true;
    			SaveRezult (true) ;
    			}
    			else GamePlay.gpHUDLogCenter(String.Format("#  {0}", r));
    
    			AiAction action1 = GamePlay.gpGetAction("action_1");
                if (action1 != null)
    			{
                        action1.Do();					
    			}
    		  }
    
    if ("trigger_2".Equals(shortName) && active) 
    		{
               
    			GamePlay.gpGetTrigger(shortName).Enable = false;
    			if (++r == 4) 
    {
    			GamePlay.gpHUDLogCenter("Waypoint reached.");
    			tx1 = "Task have been completed.";
    cmpl = true;
    			SaveRezult (true) ;
    			}			
    			else GamePlay.gpHUDLogCenter(String.Format("#  {0}", r));
    		}
    
    if ("trigger_6".Equals(shortName) && active) 
    		{          
    			GamePlay.gpGetTrigger(shortName).Enable = false;
    			if (++r == 4) 
    {
    			GamePlay.gpHUDLogCenter("Waypoint reached.");
    			tx1 = "Task have been completed.";
    			cmpl = true;
    			SaveRezult (true) ;
    			}			
    			else GamePlay.gpHUDLogCenter(String.Format("#  {0}", r));
    		}
    
    		if ("trigger_7".Equals(shortName) && active) 
    		{
               
    			GamePlay.gpGetTrigger(shortName).Enable = false;
    			if (r < 4)
    			{ 
    			GamePlay.gpHUDLogCenter("Waypoint reached.");
    			tx1 = "Task have been completed.";
    			cmpl = true;
    			SaveRezult (true) ;
    			}
    		}
        }
    	
    	int countEnemyDead = 0;
        int countFriendDead = 0;	           
        private void checkLanded(AiAircraft aircraft) 
    	{		
            if (GamePlay.gpPlayer().Place() != aircraft)
                return;
    
            bool complete = ((countEnemyDead - countFriendDead) >= 0);
    
            if (Campaign != null) 
    		{
                if (Campaign.battleSuccess != null)
                    return;
                Campaign.battleSuccess = complete;
            }
            if (complete) 
    		{
                GamePlay.gpHUDLogCenter("MISSION COMPLETE");
            }
            Timeout(20.0, () => 
    		{
                GamePlay.gpHUDLogCenter("Press Esc to end mission.");
            });
        }
    
        public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft) 
    	{
            checkLanded(aircraft);
        }
        public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft) 
    	{
            checkLanded(aircraft);
        }
    }


    Besides the script is used 3 text files.

    ccc.txt EDIT - Can use m0.txt if want
    m#.txt (# number of mission in campaign, so each mission have his own)
    m#.briefing (# number of mission in campaign, so each mission have his own)

    ccc and m#.txt have this for mission 1
    Code:
    0
    0
    0
    0
    This files are updated by script and used to update the "m#.briefing"

    Briefing contains (text is my interpretation of Google translation from Russian):

    [1] Is show at start of mission

    [2] Is show at end of mission, in the "Mission Failure" (why?) screen

    Spoiler: 

    Code:
    [1]
    <Name>
    Intro
    <Description>
    May, 23rd. Early morning.
    Yesterday our squadron was transferred from the main airfield Hornchurch to Ramsgate, closer to the main events in which we will soon become participants. And events are clearly not unfolding in our favor. In Europe, the British expeditionary forces were recently cut off from the main forces of the Allies in France, and the continued rapid offensive of the Germans could lead to their complete surrender. Of course, unless a miracle happens.
    
    Beautiful sunrise. The morning spring sun distracts from gloomy thoughts about the war, thoughts go into pleasant memories of girls, pubs and other joys of a young gentleman.
    
    But the pre-flight briefing instantly reminds us of the reality. Our squadron starts fighting. 
    
    Objective: fly to the area south of Dunkirk, patrol over the coastal strip from Dunkirk harbor to the front line south of Dunkirk itself. 
    If you spot an enemy aircraft, shoot him down. 
    Considering that you will be patrolling over the front line, there is a high probability of encountering German bombers, whose activity in this area has been very high in recent days.
    
    <Slide>
    m1.jpg
    
    <Caption>
    
    PLAYER: Mission start in the air on the way to the first patrol checkpoint. The patrol tasks will be considered completed when all checkpoints have been passed and several German aircraft have been shot down, or after 15 minutes of patrolling.
    
    [2]
    <Name>
    Success
    <Description>
    Mission accomplished!
    Results of the last mission:
    RAF claims  -  13 
    RAF losses  -  10 
    Squadron losses  -  8 
    Personal claims  -  2 
    The RAF it has performed well, the enemy's losses have been heavy.
    All tasks of the mission have been completed.
      
    Campaign progress:
    RAF claims  -  13 
    RAF losses  -  10 
    Squadron losses  -  8 
    Personal claims  -  2 
    [3]
    <Name>
    Failure
    <Description>
    Mission accomplished!
    Results of the last mission:
    RAF claims  -  13 
    RAF losses  -  10 
    Squadron losses -  8 
    Personal claims  -  2 
    The RAF has performed well, causing losses to the enemy in greater numbers than its own.
    All tasks of the mission have been completed.
     
    Campaign progress:
    RAF claims  -  13 
    RAF losses  -  10 
    Squadron losses -  8 
    Personal claims -  2 
    <Slide>
    CampaignSuccess1.jpg
    <Caption>


    Update after play the second mission of campaign, all work as expected, but are a line in Cyrilics that I don't figure where is, and this pre made comments need be very neutral, because in the last mission Squad lost 2 planes, but the text say that have no losses.

    Statistics-3.jpg

    The script has a second part - that I remove; what check, through "passThru" triggers if player reach each mission checkpoint (waypoint) and show that... "football score board".

    But this part of script can be used for more useful things, for example, tell player the HDG for next waypoint. Latter I post this part (forum message has 20.000 characters limit).
    Last edited by 1lokos; Oct-04-2020 at 20:18.

  2. Likes Marcost, von Graf liked this post
  3. #2
    Ace 1lokos's Avatar
    Join Date
    Jan 2012
    Posts
    5,323
    Post Thanks / Like
    Total Downloaded
    1.04 GB

    Re: Campaign progress script

    I think the use of "Battle Failure" screen is because the script, made in CloD "stone-age" (06/2011), don't use:

    Code:
      if (GamePlay.gpPlayer().Place() == aircraft)
            {
                Campaign.battleSuccess = true;
    
                isComplete = true;
    How add this - without broken the rest?

    ...this pre made comments need be very neutral, because in the last mission Squad lost 2 planes, but the text say that have no losses.
    I think this misleading comments happens because the script use an "football match score" logic for trigger this comment:

    Code:
    j = (cEnemy - cFriendly);
    if (j==0)
     {
     if (cEnemy > 0) 			
     else
    In the last mission squadron 'j' ends equals to '0' (2-2), a draw, which in football can be a good result.

    BTW - This script is way more interesting and smaller than "Geniok" script, what just given 100 points for each successful mission, and show in next mission briefing "Your score: 100" (part that don't work).
    Last edited by 1lokos; Oct-06-2020 at 01:14.

  4. #3
    Combat pilot
    Join Date
    Oct 2021
    Posts
    114
    Post Thanks / Like
    Total Downloaded
    12.95 MB

    Re: Campaign progress script

    Deleted by GANIX.
    Last edited by GANIX; Apr-11-2023 at 13:45.

  5. #4
    Manual Creation Group fenbeiduo's Avatar
    Join Date
    May 2013
    Posts
    70
    Post Thanks / Like
    Total Downloaded
    282.61 MB

    Re: Campaign progress script

    Quote Originally Posted by 1lokos View Post
    Code:
    //$reference parts/core/Campaign.dll
    //-$debug
    using System;
    using System.IO;
    using maddox.game;
    using maddox.game.world;
    using System.Collections.Generic;
    
    public class Mission : maddox.game.campaign.Mission
    {
    
        int r  =  0;
    	bool cmpl = false;
    	int cEnemy = 0;
        int cFriendly = 0;
        int cPlayer = 0;
        int MySquad = 0;
       	string b, tx1;
    	string[] br = new string[100]; 
    	int cEnemyS, 	cFriendlyS, cPlayerS, MySquadS;	    
    ...
    Maybe add this line? :
    using maddox.game.campaign;

  6. #5
    Ace 1lokos's Avatar
    Join Date
    Jan 2012
    Posts
    5,323
    Post Thanks / Like
    Total Downloaded
    1.04 GB

    Re: Campaign progress script

    BATTLE SUCCESS

    Statitstics_4.jpg

    I add Fenbeduo suggestion and this check for campaign success, copied from other campaign, no clue about conditions, seems player return and landing.

    Code:
        int countEnemyDead = 0;
        int countFriendDead = 0;	           
        private void checkLanded(AiAircraft aircraft) 
    	{		
            if (GamePlay.gpPlayer().Place() != aircraft)
                return;
    
            bool complete = ((countEnemyDead - countFriendDead) >= 0);
    
            if (Campaign != null) 
    		{
                if (Campaign.battleSuccess != null)
                    return;
                Campaign.battleSuccess = complete;
            }
            if (complete) 
    		{
                GamePlay.gpHUDLogCenter("MISSION COMPLETE");
            }
            Timeout(20.0, () => 
    		{
                GamePlay.gpHUDLogCenter("Press Esc to end mission.");
            });
        }
    
        public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft) 
    	{
            checkLanded(aircraft);
        }
        public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft) 
    	{
            checkLanded(aircraft);
        }
    }
    Script updated in the first post.

    Bellow the part of the script that change for second mission and subsequent, is just the text files (m#.txt and m#.briefing) path:

    Code:
     public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> initiatorList) 
        {              
            if (actor is AiAircraft) 
            {
                if (!(actor is AiAircraft))
    			return; 
    		
    		if (shortName.IndexOf("92Sqn",0) > 0)  MySquad++;
    		
                if (actor.Army() == 2) cEnemy++;
                if (actor.Army() == 1) cFriendly++;
                if (actor.Army() == 2) {
                    if (GamePlay.gpPlayer().Place() != null) {
                        bool playerWin = false;
                        foreach (DamagerScore i in initiatorList) {
                            if (i.initiator != null && i.initiator.Actor == GamePlay.gpPlayer().Place()) {
                                playerWin = true;
                            }
                        }
                        if (playerWin) cPlayer++;
                    }
                }
               SaveRezult (cmpl); 
            }
        }
    
    private void SaveRezult (bool CComplite) 
    {
    int n1 = 1;
    	int j = 0;
    StreamReader f2 = new StreamReader(@"C:\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_over_Dunkik\m1.txt");
    b =  f2.ReadLine();
    cEnemyS = Int32.Parse(b) + cEnemy;
    b =  f2.ReadLine();
    cFriendlyS = Int32.Parse(b) + cFriendly;
    b =  f2.ReadLine();
    MySquadS = Int32.Parse(b) + MySquad;
    b =  f2.ReadLine();
    cPlayerS = Int32.Parse(b) + cPlayer;
    f2.Close();
    
    StreamWriter f3 = new StreamWriter(@"C:\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_over_Dunkik\m2.txt");
    f3.WriteLine(String.Format("{0}", cEnemyS));
    f3.WriteLine(String.Format("{0}", cFriendlyS));
    f3.WriteLine(String.Format("{0}", MySquadS));
    f3.WriteLine(String.Format("{0}", cPlayerS));
    f3.Close();
    	
    StreamReader f1 = new StreamReader(@"C\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_over_Dunkik\m2.briefing");
    do 
    {
    b =  f1.ReadLine();
    br[n1++] = b;
    }				
     while (b  != "[2]") ;
    
    					f1.Close();		
    
    					StreamWriter f = new StreamWriter(@"C:\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_over_Dunkik\m2.briefing");
    For the next, always add mission number (m#) in the 3 last paths.
    e.g.

    "C:\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_o ver_Dunkik\m2.briefing"

    The first path always refer to previous mission:

    "C:\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\custom\campaign_Spitfires_o ver_Dunkik\m1.txt"

    Note sure if this "C:\Documents" is needed. Will cause issues if player have Documents folder outside of C:\ (mine is in D:\)
    Last edited by 1lokos; Oct-04-2020 at 20:20.

  7. #6
    Manual Creation Group fenbeiduo's Avatar
    Join Date
    May 2013
    Posts
    70
    Post Thanks / Like
    Total Downloaded
    282.61 MB

    Re: Campaign progress script

    congrats!

    Code:
    using maddox.game.campaign;
    Saw this once in a post

  8. #7
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Campaign progress script

    Hi 1lokos,

    Thanks for for posting (and correcting!) this script.

    There is one part I don't understand - there are four triggers in the script. Are these part of the script for campaign progress tracking, or do they belong to the specific mission that this script is used with?

    Reason: I am interested in updating some other campaigns to use this script, but if these triggers are required for the campaign progress script then will I also need to edit each mission in FMB as well as adding the script as a missionname.cs file (and of course adding the three txt files m#)?

    Thank you

    M

  9. #8
    Ace 1lokos's Avatar
    Join Date
    Jan 2012
    Posts
    5,323
    Post Thanks / Like
    Total Downloaded
    1.04 GB

    Re: Campaign progress script

    MarcosT

    The trigger in the script give me a big headache.

    Since I have no clue about C# need do "trial and error" (many).

    Seems the triggers are not need for count the kills, but for check if player did the "mission tasks" - fly through missions waypoint's, when this happens you a #2, #3... in screen.

    Some waypoint's trigger a action (e.g. spawn an enemy group), and these instead show #2.. show a message, e.g. "Waypoint reached".
    E.g. waypoint number 3 trigger have "if (++r == 4)" so the condition for show the message is matched. Others have, e.g. "(r < 4) ".

    Seems that if player do some number of "tasks" (pass through a number of waypoint's) the results is saved, and a message "Mission tasks accomplished" is added in "score" page.

    Thing is that I don't figure the logic of this "r"...

    I see that waypoint 1 trigger #2...

    A attempts in modify use this trigger for other use, eg. show different messages result in errors "out of matrix" and broken the whole script.

    So as "band-aid" solution I remove the messages from triggers and leave the triggers doing their thing, just set a waypoint for the trigger that have the
    "if (++r == 4)" for results to be saved.

    And add others trigger with number after the last for other uses.

    Another question, seems that for remove the triggers is need change the count kills script, I think this "private void SaveRezult (bool CComplite) is related with the triggers, as some triggers have this part:

    SaveRezult (true) ;
    cmpl = true;

    Hope that you understand my confusion.

    BTW - IMHO, this "campaign progress" resume at end of missions add much for the campaign, giving a sense of purpose.

  10. #9
    Combat pilot
    Join Date
    Oct 2021
    Posts
    114
    Post Thanks / Like
    Total Downloaded
    12.95 MB

    Re: Campaign progress script

    Deleted by GANIX.
    Last edited by GANIX; Apr-11-2023 at 13:44.

  11. Likes Little Bill liked this post
  12. #10
    Combat pilot
    Join Date
    Oct 2021
    Posts
    114
    Post Thanks / Like
    Total Downloaded
    12.95 MB

    Re: Campaign progress script

    Deleted by GANIX.
    Last edited by GANIX; May-29-2023 at 10:31.

  13. #11
    ATAG Member ATAG_Oskar's Avatar
    Join Date
    Nov 2017
    Location
    Canada
    Posts
    986
    Post Thanks / Like
    Total Downloaded
    908.31 MB

    Re: Campaign progress script

    Quote Originally Posted by GANIX View Post
    Hello mission builders,

    in many SC files one can find

    < //-$debug >

    May someone explain what the command is for?
    Can you post an example file or link.

  14. #12
    Combat pilot
    Join Date
    Oct 2021
    Posts
    114
    Post Thanks / Like
    Total Downloaded
    12.95 MB

    Re: Campaign progress script

    Sorry, it should be 'CS' file



    Attachment 53078

  15. #13
    ATAG Member ATAG_Oskar's Avatar
    Join Date
    Nov 2017
    Location
    Canada
    Posts
    986
    Post Thanks / Like
    Total Downloaded
    908.31 MB

    Re: Campaign progress script

    Quote Originally Posted by GANIX View Post
    Sorry, it should be 'CS' file



    Attachment 53078
    It looks like a debug directive that the developer used when making the mission. But what you posted would not compile. You need to post a sample file or link so I can see exactly what you are talking about.
    Last edited by ATAG_Oskar; Mar-25-2022 at 14:57.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •