hc_wolf
10-15-2012, 03:57 AM
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.
[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??
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(); }
});
}
}
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.
[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??
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(); }
});
}
}