Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-15-2012, 09:06 PM
bolox bolox is offline
Approved Member
 
Join Date: May 2008
Posts: 351
Default A little fun?

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



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?
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:57 AM.


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