Quote:
Originally Posted by TheEnlightenedFlorist
If you think AI are starting to pile up in your server, try putting the following code into your OnTickGame() method. Every five minutes, it should print to the chat bar the number of AirGroups in the server. It's not an exact count of the number of AI aircraft on the server, but if the number continually climbs, you know that not all AI are being taken care of. Also, it will only work if there is more than one aircraft on both sides, so you might not see it immediately after starting the server.
Code:
if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
GamePlay.gpLogServer(GamePlay.gpRemotePlayers(), totalAircraft.ToString(), null);
}
}
|
Hi EF. I put this into my script and tried it offline (compile said it was OK) but no messages showed up. Does it send thse to the server log? Im guessing it does given the 'gpLogServer' command. I don't actually mind if it does, rather than it show up on screen. No idea how to enable the log in single player though.
Just spent about an hour working out how many AI groups should be in the air at a given moment on the mission, so this would be great to compare.
Thx