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() ?
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() ?
Isn't there a "ticklen()" that gives you that info?
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...
Again, tickLen will give you the number you are looking for but, if you want it even easier, TicksToSecs should help you.
sry - post deleted - figured it out....it was right infront of my face..
Last edited by ATAG_Freya; Apr-05-2015 at 20:23.
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.
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
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..
Also If I use the line: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); }
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.
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
I use 200 per second, but as pointed out, Ticks vary. They're close enough.
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?
Solved my timer thinger:
There are probably better ways to do it, like the form of a countdown, but this will work well enough for today.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); }
Does anyone know how to make the - sendScreenMessageTo - part last for a longer time, maybe like 10-12 seconds?
Bookmarks