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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2011, 09:02 PM
king1hw king1hw is offline
Approved Member
 
Join Date: Jul 2010
Posts: 64
Default Script?

I was trying to set up a Historical Day of Battle of Britain events:

The script I would like to fix is:

if (Time.tickCounter() % 108000 == 18000) // 108000 = 60 min repeat. 18000 = 10 min delay.

First misson starts at 1100, Then the second they come in 2 hours 25 min at 1325 then, a mid evening hit followed by a 2130 to 0530 attack on airfields.

I also need search lights if anyone can help.

PLS
Reply With Quote
  #2  
Old 07-16-2011, 03:08 AM
king1hw king1hw is offline
Approved Member
 
Join Date: Jul 2010
Posts: 64
Default Trying to set the times correctly?

Below is a script I cam up with but I guess it is not correct also the hours i am looking for are as follows.

1. mission load 30 sec

2. spaced to load every 2 hours

1100
1325
1530
2130

If any one can help thanks.


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

public class Mission : AMission
{

public override void OnTickGame()
{


if (Time.tickCounter() % 866000 == 216000) // 480 min repeat, 5 min delay.

{
GamePlay.gpPostMissionLoad("missions/channelv6/BM1/Blue1.mis");
GamePlay.gpPostMissionLoad("missions/channelv6/BM1/Red1.mis");

double initTime = 0.0;
Timeout(initTime += 30, () =>
{
GamePlay.gpHUDLogCenter("10 July 1940 1100hrs German attack on shipping convoy!");
});

}

if (Time.tickCounter() % 215999 == 432000) // 480 min repeat, 240 min delay.

{
GamePlay.gpPostMissionLoad("missions/channelv6/BM1/Blue2.mis");
GamePlay.gpPostMissionLoad("missions/channelv6/BM1/Red2.mis");

double initTime = 0.0;
Timeout(initTime += 30, () =>
{
GamePlay.gpHUDLogCenter("10 July 1940 1325hrs German attack on shipping convoy!");
});

}

if (Time.tickCounter() % 431999 == 648000) // 480 min repeat, 480 min delay.

{
GamePlay.gpPostMissionLoad("missions/channelv6/BM1/Blue3.mis");

double initTime = 0.0;
Timeout(initTime += 30, () =>
{
GamePlay.gpHUDLogCenter("10 July 1940 German bomber attack on sothwest England!");
}

if (Time.tickCounter() % 647999 == 866000) // 240 min repeat, 720 min delay.

{
GamePlay.gpPostMissionLoad("missions/channelv6/BM1/Blue4.mis");

double initTime = 0.0;
Timeout(initTime += 30, () =>
{
GamePlay.gpHUDLogCenter("10 July 1940 2130-0530 German bomber attack o airfields!");
});

}
}
Reply With Quote
  #3  
Old 07-18-2011, 01:50 PM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

Check this line: delay > than repeat -> Problem, but I am no expert...

if (Time.tickCounter() % 215999 == 432000) // 480 min repeat, 240 min delay
.
.
.if (Time.tickCounter() % 647999 == 866000) // 240 min repeat, 720 min delay.
__________________
http://cornedebrouwer.nl/cf48e
Reply With Quote
  #4  
Old 07-18-2011, 02:35 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

if (Time.tickCounter() % 215999 == 432000)
if (Time.tickCounter() % 431999 == 648000)
if (Time.tickCounter() % 647999 == 866000)

You use the modulo operator in c# (http://en.wikipedia.org/wiki/Modulo_operation)
So the result can never be greater or equal the divisor. The result of a modulo operation is the remainder of the division.
For example 9 mod 3 is 0,
10 mod 3 is 1
11 mod 3 is 2
12 mod 3 is 0
13 mod 3 is 1
14 mod 3 is 2
15 mod 3 is 0
you see there will never be a result like three or greater.
Same for your code your if clauses will never became true.

Also check:
double initTime = 0.0;
Timeout(initTime += 30, () =>
{
GamePlay.gpHUDLogCenter("10 July 1940 German bomber attack on sothwest England!");
} //<= missing );


double initTime = 0.0;
Timeout(initTime += 30, ...
doesn't make any sense to me. :/
if you want a 30sek delay simple use
Timeout(30, () =>

Last edited by FG28_Kodiak; 07-18-2011 at 03:04 PM.
Reply With Quote
Reply


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 08:16 AM.


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