Smokeynz
01-12-2012, 10:01 PM
The following code is a simple visual reference HUD timer to test mission operation periods.
Example: to check that missions load at specific time or not or other timed periods.
Set ts value for interval period required(in seconds), as 60 the HUD will display the following, then by intervals of 60secs adding each time.
Elapsed Time:Min:1 Secs:60 Ticks:1800
Note:ticks can be varible, however in this case ts count multiplied by 30
(near enough for visual, ingame checks)
Feel free to use and modify.
/**missiontesttimer.cs**/
//
//By Smokeynz
//lastmod 13/1/2012
using System;
using System.Collections;
using maddox.game;
using maddox.game.world;
using maddox.GP;
using System.Collections.Generic;
using System.Diagnostics;
public class Mission : AMission
{
//Goes with time indicator, set period for cycle repeat period: value = seconds
private double timeValue = 60;
private double time;
public override void OnTickGame()
{
base.OnTickGame();
/*=========================================*/
// Time. current() in seconds from Battle Start
if (Time.current() >= time)
{
GamePlay.gpHUDLogCenter("Elapsed Time:Min:" + time / 60 + " Secs:" + time + " Ticks:" + time * 30);
ime = time + timeValue;
}
/*=========================================*/
}
}
Example: to check that missions load at specific time or not or other timed periods.
Set ts value for interval period required(in seconds), as 60 the HUD will display the following, then by intervals of 60secs adding each time.
Elapsed Time:Min:1 Secs:60 Ticks:1800
Note:ticks can be varible, however in this case ts count multiplied by 30
(near enough for visual, ingame checks)
Feel free to use and modify.
/**missiontesttimer.cs**/
//
//By Smokeynz
//lastmod 13/1/2012
using System;
using System.Collections;
using maddox.game;
using maddox.game.world;
using maddox.GP;
using System.Collections.Generic;
using System.Diagnostics;
public class Mission : AMission
{
//Goes with time indicator, set period for cycle repeat period: value = seconds
private double timeValue = 60;
private double time;
public override void OnTickGame()
{
base.OnTickGame();
/*=========================================*/
// Time. current() in seconds from Battle Start
if (Time.current() >= time)
{
GamePlay.gpHUDLogCenter("Elapsed Time:Min:" + time / 60 + " Secs:" + time + " Ticks:" + time * 30);
ime = time + timeValue;
}
/*=========================================*/
}
}