View Single Post
  #7  
Old 05-14-2011, 09:58 PM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
Don't get me wrong, modulus is great but this stopwatch is probably more accurate and it's a heck of a lot more readable.
The problem with external timing is that you will get time according to your system and not to game. Simulation can slow down because of lag, and external timer won't take that into account, i.e. briefing can say that bombers start at 9:00, however you may see that start greatly off its planned time (according to game clock), if you use external timer.

If you want to get rid of counting ticks, you can use this:
Code:
	//Runs once, when mission is loaded
	public override void Init(maddox.game.ABattle battle, int missionNumber)
	{
		base.Init(battle,missionNumber);
		//Planned missions
		MissionLoader(30,10,"missions/Multi/Dogfight/bombers1.mis");  // 10s from main mission start and repeatedly every 30s
		MissionLoader(100,60,"missions/Multi/Dogfight/bombers2.mis"); // 60s from main mission start and repeatedly every 100s
	}
	
	public void MissionLoader(int period, int offset, string mission)
	{
		if (offset > 0)
			Timeout(offset, () => {MissionLoader(period,0,mission);});
		else
			{
				GamePlay.gpPostMissionLoad(mission);	
				Timeout(period, () => {MissionLoader(period,0,mission);});		
			}
	}

Last edited by ZaltysZ; 05-15-2011 at 07:09 AM.
Reply With Quote