Results 1 to 3 of 3

Thread: Campaign stats...is there a way...

  1. #1
    Supporting Member Blitzen's Avatar
    Join Date
    Jan 2013
    Location
    Seattle,Washington
    Posts
    1,027
    Post Thanks / Like
    Total Downloaded
    6.72 GB

    Campaign stats...is there a way...

    I'm not sure that it has ever been possible in CloD campaigns just what the total stats ( kills, crashes ,number of missions flown etc.,) of my pilot(s) are in each campaign ? Its nice to see them after each mission of course , but a total would be better I think.Have I just missed this info somehow?

  2. Likes rontaila 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 stats...is there a way...

    CloD register only air kills/losses at end of missions.

    But something more detailed is possible, like in old Desastersoft campaigns, see ground and sea targets listed.

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

    But require use "Campaign.dll", "CampaignMission.dll" and a database, what complicate a already complicated thing, and is probable outside of most - the few; mission/campaigns makers.

    Early made campaign's has reference for an "score" file in missions script files, that seems should write in next mission briefing your kills in the previous missions:

    private static string mydocpath = Environment.GetFolderPath(Environment.SpecialFolde r.MyDocuments);
    private static string FILE_NAME = mydocpath + @"\1C SoftClub\il-2 sturmovik cliffs of dover\mission\campaign\campaign_Dunkirk\Score.data ";
    Spoiler: 

    Code:
    public class Mission : maddox.game.campaign.Mission
    {
        AiActor a1 = null;
        AiAircraft airc1 = null;
        int countPlayerWins = 0;
        int countDead = 0;
        bool isComplete = false;
        int score = 0;
    
        private static string mydocpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
        private static string FILE_NAME = mydocpath + @"\1C SoftClub\il-2 sturmovik cliffs of dover - MOD\mission\campaign\campaign_Dunkirk\Score.data";
    
        private static void writeScore(int scr)
        {
            using (FileStream fs = new FileStream(FILE_NAME, FileMode.Create))
            {
                using (BinaryWriter w = new BinaryWriter(fs))
                {
                    w.Write(scr);
                }
            }
        }
    
        private static int readScore()
        {
            using (FileStream fs = new FileStream(FILE_NAME, FileMode.Open, FileAccess.Read))
            {
                using (BinaryReader r = new BinaryReader(fs))
                {
                    return (r.ReadInt32());
                }
            }
        }
    
        private void serverMessage(string msg)
        {
            Player pl = GamePlay.gpPlayer();
            Player[] players = { pl };
            object[] args = { msg };
            GamePlay.gpLogServer(players, msg, args);
        }
    
        private void HUDMessgeTo(string message)
        {
            Player pl = GamePlay.gpPlayer();
            String namePlayer = pl.Name();
            GamePlay.gpHUDLogCenter(namePlayer + ": " + message);
        }
    
        public override void OnBattleStarted()
        {
            base.OnBattleStarted();
        }
    
        private void checkLanded(AiAircraft aircraft)
        {
            if (GamePlay.gpPlayer().Place() == aircraft)
            {
                Campaign.battleSuccess = true;
    
                isComplete = true;
                score += 100;
    
                HUDMessgeTo("Mission accomplished successfully!");
                Timeout(10.0, () =>
                {
                    GamePlay.gpHUDLogCenter("To end the mission, press ESC!");
                });
            }
        }
    
        public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
        {
            checkLanded(aircraft);
        }
    
        public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft)
        {
            checkLanded(aircraft);
        }
    
        public override void OnBattleStoped()
        {
            base.OnBattleStoped();
    
            if (isComplete)
            {
                writeScore(score);
    
                BriefingParser parser = new BriefingParser(@"..\il-2 sturmovik cliffs of dover\parts\bob\mission\campaign\campaign_Dunkirk\GB_01.BRIEFING");
                parser.AddSetting("2", "Description", "Your victories:", readScore().ToString());
            }
        }
    }


    But for what I test this don't work anymore... if have worked once.

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

    Re: Campaign stats...is there a way...

    Quote Originally Posted by Blitzen View Post
    I'm not sure that it has ever been possible in CloD campaigns just what the total stats ( kills, crashes ,number of missions flown etc.,) of my pilot(s) are in each campaign ?
    This is possible using scripts. I don't think anyone has done that yet.

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
  •