Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   Simple HUD timer test script (http://forum.fulqrumpublishing.com/showthread.php?t=29045)

Smokeynz 01-12-2012 10:01 PM

Simple HUD timer test script
 
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.

Code:


/**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;
        }
        /*=========================================*/
       
    } 
}



All times are GMT. The time now is 03:07 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.