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 10-15-2012, 03:57 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default How to remove Static4 Stationary.Environment objects

Hi all,

this used to work but now it is not. any ideas on how to fix?


Below code is in the .mis file that items the stationary objects i want to remove after 58 minutes.
Code:
[Stationary]
  Static5 Stationary.Environment.FuelDrum_GER1_9 de 296598.06 217104.48 0.00 
  Static4 Stationary.Environment.FuelDrum_GER1_9 de 296582.91 217086.94 0.00 
  Static3 Stationary.Environment.FuelDrum_GER1_9 de 296562.56 217080.95 0.00   
  Static2 Stationary.Environment.FuelDrum_GER1_9 de 295859.16 217662.86 0.00 
  Static1 Stationary.Environment.FuelDrum_GER1_9 de 295877.09 217695.95 0.00 
  Static0 Stationary.Environment.FuelDrum_GER1_9 de 295899.00 217686.78 0.00
Below is the code I have in my .cs file that states ground objects to be removed after 58 minutes. This is not working. The barrels are not removing??

Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;
using System.Diagnostics;

public class Mission : AMission
{
    Stopwatch MissionTimer1M1 = new Stopwatch();
    bool ReStart = false;
    public override void Init(ABattle battle, int missionNumber)
    {
        base.Init(battle, missionNumber);
		GamePlay.gpLogServer(null, "Mission 1 Loaded ", new object[] { }); //test Message
        //MissionNumberListener = -1;

        MissionTimer1M1.Reset();
        MissionTimer1M1.Start();
    }

	public override void OnTickGame()
	{
		base.OnTickGame();
		if (Time.tickCounter() % (32 * 30 * 1) == 0)  // every 30sec repeat, (32 ticks a sec x 60 sec * 1 mins)
		{
		if (MissionTimer1M1.Elapsed.Minutes >= 59)
		MissionTimer1M1.Stop();
		}
	}
    
	
	//Section to remove AI after 58 mins

    public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
    {
        base.OnActorCreated(missionNumber, shortName, actor);

        if (actor is AiGroundActor) // 3599 = 58 mins
                Timeout(3599, () =>
                {
                    if (actor != null)
                    { (actor as AiGroundActor).Destroy(); }
                });
    }	
}
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
 


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 11:20 PM.


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