Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   CountAiGroundActor ??? I want to count how many Static objects (http://forum.fulqrumpublishing.com/showthread.php?t=33660)

hc_wolf 08-05-2012 11:55 AM

CountAiGroundActor ??? I want to count how many Static objects
 
HI, I want to see how many Static objects I have in my mission at any one time.

Is there a way to see this?

I wrote this below but does not show me the number when I call it in Menu. Any ideas?

Code:


GamePlay.gpLogServer(new Player[] { player }, "Ground Unit Count: RAF {0}      LWA {1} ", new object[] { CountAiGroundActor(1), CountAiGroundActor(2) });

Code:

    /*------------AI Ground Units Select------------*/
    public int CountAiGroundActor(int Army)
    {
        int NumberOfStaticObjects = 0;

        if (GamePlay.gpGroundGroups(Army) != null) return 0;
        foreach (AiGroundGroup gg in GamePlay.gpGroundGroups(Army))
        {
            NumberOfStaticObjects += 1;
        }
        return NumberOfStaticObjects;
    }


FG28_Kodiak 08-05-2012 06:17 PM

To get the number of all Statics you can use:
Code:

public int CountStatic()
{
    return GamePlay.gpGroundStationarys().Length;
}



All times are GMT. The time now is 09:37 PM.

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