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)
-   -   A little fun? (http://forum.fulqrumpublishing.com/showthread.php?t=30492)

bolox 03-15-2012 09:06 PM

A little fun?
 
a quick, hopefully fun 'slalom race' offline mission with a timer and 'gate passing' script.

http://i240.photobucket.com/albums/f...cod/SLALOM.jpg

http://www.mediafire.com/download.php?2itdv8u9sclio7b

script
Code:

using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
using maddox.GP;
using System.Diagnostics;

public class Mission : AMission{
        Stopwatch missionTimer = new Stopwatch();
                int aa = 0;//trigger count
                double sw = 0;//stopwatch
                double se = 0;//stopwatch calculated
        public override void OnBattleStarted() {
        base.OnBattleStarted();
                missionTimer.Start();
    }
    public override void OnTrigger(int missionNumber, string shortName, bool active) {
        if ("start".Equals(shortName) && active) {
                aa = 0;
                missionTimer.Restart();
                {
                GamePlay.gpHUDLogCenter("GO");//start
                }
                }
                if ("b".Equals(shortName) && active) {//gate 1
                ++aa;
                {GamePlay.gpHUDLogCenter("1");
                }
                }
                if ("c".Equals(shortName) && active) {//gate2
                ++aa;
                {GamePlay.gpHUDLogCenter("2");
                }
                }
                if ("d".Equals(shortName) && active) {//gate 3
                ++aa;
                {GamePlay.gpHUDLogCenter("3");
                }
                }
                if ("e".Equals(shortName) && active) {//gate 4
                ++aa;
                {GamePlay.gpHUDLogCenter("4");
                }
                }
                if ("finish".Equals(shortName) && active) {        //finish
                missionTimer.Stop();
                double initTime = 0.0;
                sw = missionTimer.Elapsed.TotalMilliseconds;
                se = sw/1000;{
                GamePlay.gpHUDLogCenter("TIME:"+se);
                Timeout(initTime += 5.0, () =>
                {
                GamePlay.gpHUDLogCenter("GATES:"+aa);
                });
                }
                }
        }
  }

very simple airstart mission that's a 'proof of concept' but might be an idea for something a bit different?

_79_dev 03-15-2012 10:04 PM

I like that Idea mate...:)

ATAG_Doc 03-15-2012 10:43 PM

Haha cool.

hc_wolf 03-16-2012 03:56 AM

Dude! that is a bit of fun :D

That code will come in handy for something I am sure.

RED BULL RACING HERE WE COME!!!


All times are GMT. The time now is 05:56 AM.

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