Results 1 to 13 of 13

Thread: Ticks?

  1. #1
    Ace
    Join Date
    May 2013
    Location
    Stamford, Lincs, UK
    Posts
    1,033
    Post Thanks / Like
    Blog Entries
    8
    Total Downloaded
    7.46 MB

    Ticks?

    So, there I was pretty sure of my own calcs but things weren't working quite as I expected.

    So, how many ticks are in a minute using Time.tickcounter() ?

  2. #2
    ATAG_Colander's Avatar
    Join Date
    Nov 2011
    Location
    Bir Tawil
    Posts
    11,128
    Post Thanks / Like
    Total Downloaded
    255.73 MB

    Re: Ticks?

    Isn't there a "ticklen()" that gives you that info?

  3. #3
    Ace
    Join Date
    May 2013
    Location
    Stamford, Lincs, UK
    Posts
    1,033
    Post Thanks / Like
    Blog Entries
    8
    Total Downloaded
    7.46 MB

    Re: Ticks?

    dunno. I'd been working under the assumption there were 32*60 ticks in a minute, which comes at around 1920 or something, but I've just read somewhere there's 1800... That might explain why mission lengths aren't quite what I thought they would be...

  4. #4
    ATAG_Colander's Avatar
    Join Date
    Nov 2011
    Location
    Bir Tawil
    Posts
    11,128
    Post Thanks / Like
    Total Downloaded
    255.73 MB

    Re: Ticks?

    Again, tickLen will give you the number you are looking for but, if you want it even easier, TicksToSecs should help you.

  5. #5
    ATAG Member ATAG_Freya's Avatar
    Join Date
    Jan 2013
    Location
    Lethbridge, Alberta
    Posts
    3,592
    Post Thanks / Like
    Total Downloaded
    16.16 MB

    Re: Ticks?

    sry - post deleted - figured it out....it was right infront of my face..
    Last edited by ATAG_Freya; Apr-05-2015 at 20:23.

  6. #6
    Ace No.401_Wolverine's Avatar
    Join Date
    Jan 2012
    Posts
    767
    Post Thanks / Like
    Total Downloaded
    974.2 KB

    Re: Ticks?

    Didn't see your post before you deleted it Freya, but I thought I'd just pop this in here in case it's relevant to anyone. We've always used Stopwatch to time our missions and they've always been pretty much bang on the second for time finishing and restarting.

  7. #7
    ATAG Member ATAG_Freya's Avatar
    Join Date
    Jan 2013
    Location
    Lethbridge, Alberta
    Posts
    3,592
    Post Thanks / Like
    Total Downloaded
    16.16 MB

    Re: Ticks?

    You didn't miss much, just me failing horribly at math. All I can come up with is 1 min = 2000 ticks.

    Stopwatch? Never heard of it, is it a script thing? I would like to know more about that!


  8. #8
    Team Fusion Salmo's Avatar
    Join Date
    Nov 2011
    Posts
    2,332
    Post Thanks / Like
    Total Downloaded
    191.25 MB

    Re: Ticks?

    Quote Originally Posted by ATAG_Freya View Post
    You didn't miss much, just me failing horribly at math. All I can come up with is 1 min = 2000 ticks.

    Stopwatch? Never heard of it, is it a script thing? I would like to know more about that!

    The C# stopwatch class does exactly what you'd think it does. It creates a new stopwatch that can the started, stopped & reset & you can read the time elapsed from it in minutes, seconds & milliseconds.

    http://www.dotnetperls.com/stopwatch

  9. Likes ATAG_Freya liked this post
  10. #9
    ATAG Member ATAG_Freya's Avatar
    Join Date
    Jan 2013
    Location
    Lethbridge, Alberta
    Posts
    3,592
    Post Thanks / Like
    Total Downloaded
    16.16 MB

    Re: Ticks?

    Quote Originally Posted by Salmo View Post
    The C# stopwatch class does exactly what you'd think it does. It creates a new stopwatch that can the started, stopped & reset & you can read the time elapsed from it in minutes, seconds & milliseconds.

    http://www.dotnetperls.com/stopwatch
    Is there a way to display a running time, or current state of the timer while using stopwatch? Everything I have tried so far the game doesn't seem to like the term 'elapsed'. It also doesn't like 'get()' - I need a way to display the time left between calling an AI raid (ie. how long till the timer resets again). I hashed out the string.format thing I was trying earlier, not sure I need that. Snippet of code I'm working with so far..

    Code:
     
        private bool BomberMissionInProgress = false;
        private string BomberMission = string.Empty;
        Stopwatch BomberMissionTimer = new Stopwatch();
    
    (snip)
    
    
                   if (menuItemIndex == 1)
    
                    //string BomberMissionTimer = String.Format("{0:00}:{1:00}:{2:00}", ts.Hours, ts.Minutes, ts.Seconds);
    
                                {
                			if (player.Army() == 1)
    					{
                                    		if (BomberMissionInProgress)
                                    		{
                                        		GamePlay.gpLogServer(null, "Bomber Command ready in: " + BomberMissionTimer.Get());
                                        		SetMainMenu(player);
                                    		}
    						else
                                    		{
                                        	BomberMission = BOMBERMISSIONS_FILE_PATH + "Raider4.mis";
    
    (snip)
    
            if (BomberMissionTimer.Elapsed.TotalSeconds >= 2400)   // 3600 RESETS BOMBER COMMAND EVERY HOUR 
            {
                BomberMissionInProgress = false;
                //BomberTarget = "";
                //BomberBrief = "";
                BomberMission = "";
                BomberMissionTimer.Reset();
                sendScreenMessageTo(1, "Aircraft are on standby and await mission orders.", null);
                sendScreenMessageTo(2, "Aircraft are on standby and await mission orders.", null);
            }
    Also If I use the line:

    GamePlay.gpLogServer(null, "Bomber Command ready in: " + BomberMissionTimer, new object[] { }));

    It says in-game "Bomber command ready in: System.diagnostics.stopwatch"

    OR something similar... but that won't do either!
    Last edited by ATAG_Freya; Jun-18-2016 at 12:28.

  11. #10
    Team Fusion TWC_Fatal_Error's Avatar
    Join Date
    Dec 2013
    Location
    Florida
    Posts
    678
    Post Thanks / Like
    Total Downloaded
    226.63 MB

    Re: Ticks?

    we use

    TICKS_PER_MINUTE=1986

    //empirically, based on a timeout test. This is approximate & varies slightly.
    i7 2700 ,32 gigs, 4 ssd's ,1 7200rpm 2terabyte,1 samsung 55 display,2 mfd's,EDTRACKER,Warthog ,X55 stick, 7inch liliput monitor in mfd's 21 I-inc secondary display for instruments using virtual cockpit
    [*]iustus facere unus[*] JUST MAKE ONE ( FATAL ERROR) Commander TWC http://twcpilots.com

  12. #11
    Ace
    Join Date
    May 2013
    Location
    Stamford, Lincs, UK
    Posts
    1,033
    Post Thanks / Like
    Blog Entries
    8
    Total Downloaded
    7.46 MB

    Re: Ticks?

    I use 200 per second, but as pointed out, Ticks vary. They're close enough.

  13. #12
    Novice Pilot
    Join Date
    Jul 2013
    Posts
    50
    Post Thanks / Like
    Blog Entries
    2
    Total Downloaded
    78.01 MB

    Re: Ticks?

    Hmmm... That gives me a thought...

    Lets say You take Your physical server machine and throw into big fat jumbo jet, and let it fly at 30k feet for few years without major stops.

    How will Tick function look between server and client then?
    Can we achieve something with sending CLOD into past?
    Will that be possible with TF ver.10?

  14. #13
    ATAG Member ATAG_Freya's Avatar
    Join Date
    Jan 2013
    Location
    Lethbridge, Alberta
    Posts
    3,592
    Post Thanks / Like
    Total Downloaded
    16.16 MB

    Re: Ticks?

    Solved my timer thinger:

    Code:
                                {
                			if (player.Army() == 1)
    					{
    
                                    		if (BomberMissionInProgress)
                                    		{
                                                    TimeSpan ts = BomberMissionTimer.Elapsed;
                                                    string elapsedTime = String.Format("{0:00}",ts.Minutes);
                                        		GamePlay.gpLogServer(null, "Bombers were called " + elapsedTime + " minutes ago, and can be called again after 40 minutes", new object[] { });
                                        		SetMainMenu(player);
                                    		}
    						else
                                    		{
                                        	BomberMission = BOMBERMISSIONS_FILE_PATH + "Raider4.mis";
                                        	BomberMissionInProgress = true;
                                        	GamePlay.gpPostMissionLoad(BomberMission);
                                        	sendScreenMessageTo(1, "Attention! 8X Wellington will be at Deal in 10min - angels 20 - target: Marquise west", null);
                                        	sendScreenMessageTo(2, "Achtung! Enemy Raid Reported. All squadrons on Alert - keep checking Radar", null);
                                        	BomberMissionTimer.Start();
                                        	SetMainMenu(player);
                                    		}
    There are probably better ways to do it, like the form of a countdown, but this will work well enough for today.

    Does anyone know how to make the - sendScreenMessageTo - part last for a longer time, maybe like 10-12 seconds?

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
  •