So here is an issue I came across in scripting Cliffs of Dover FMB missions.
Generally you can get a list of all ground stationaries using a few simple functions CloD makes available to script writers.
HOWEVER - those lists of ground stationaries do not include a few important items!
In particular, they don't seem to include smoke or fire objects.
So I can understand how this likely happened--smoke & fire are simply a different type of object than most others. For example, if you bomb a location you might kill any nearby static object, but you probably wouldn't kill nearby smoke or fire.
Anyway, this is an issue because for most ground stationary objects, you can place them and then later remove them.
But with smoke & fire, you can place them--but you can't EVER remove them unless you completely restart the mission.
Anyone who knows a solution to this, I would really appreciate hearing it!
Sample .cs file that lists all ground stationaries of the mission and any submission loaded. If you create a .mis file with various groundstationaries including some smoke and fire, you'll see that everything is listed EXCEPT the smoke and fire:
Code:
using System;
using System.Collections.Generic;
using maddox.GP;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
Dictionary<GroundStationary, int> Stationaries = new Dictionary<GroundStationary, int>();
public override void OnBattleStarted()
{
base.OnBattleStarted();
MissionNumberListener = -1;
}
public override void OnMissionLoaded(int missionNumber)
{
base.OnMissionLoaded(missionNumber);
foreach (GroundStationary stationary in GamePlay.gpGroundStationarys())
{
if (!Stationaries.ContainsKey(stationary))
{
Stationaries[stationary] = missionNumber;
Console.WriteLine("Stat: {0} {1} {2} {3}", missionNumber, stationary.Name, stationary.Category, stationary.Title);
}
}
}
}
Example of how to get groundstationaries within a distance of a given point--except not that it will NOT list any smoke or fire groundstationaries!
Code:
GroundStationary[] gs = GamePlay.gpGroundStationarys(250000, 252000, 1000); //Find all groundstationaries within 1000 meters of map coordinate (250000,252000)
List of items I know are not picked up by gpGroundStationarys:
Code:
Smoke.Environment.Smoke1
Smoke.Environment.Smoke2
Smoke.Environment.BuildingFireSmall
Smoke.Environment.BuildingFireBig
Smoke.Environment.BigSitySmoke_0
Smoke.Environment.BigSitySmoke_1
More example code relating to placing & remove ground stationaries here:
https://forums.twcpilots.com/showthread.php?tid=165
Bookmarks