# Get Max Desired Harvest Peon Count

Grammar — Get the maximum number of peons we want to have harvesting in town town for player player
FlagsNative | Function

Returns the maximum number of peons the AI wants to have harvesting in a town for a player.

# Arguments

  • int — Player
  • int — Town

Returns — int

native int AIGetMaxPeonCount(int player, int town);

Category: AI Advanced / Towns / Functions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeAI.galaxy:79

    DebugVarInt2(
        "peons cur",    AIGetCurPeonCount(player, c_townMax),
        "max",          AIGetMaxPeonCount(player, c_townMax)
    );
    DebugVarBool("e_flagsScouting", AIGetFlag(player, e_flagsScouting));

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:380

void AILDStockWorkers (int player, int count, string worker) {
    int econMin = AIGetMinPeonCount(player, c_townMax);
    int econMax = AIGetMaxPeonCount(player, c_townMax);

    if (econMin > count) {

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/MeleeAI.galaxy:79

    DebugVarInt2(
        "peons cur",    AIGetCurPeonCount(player, c_townMax),
        "max",          AIGetMaxPeonCount(player, c_townMax)
    );
    DebugVarBool("e_flagsScouting", AIGetFlag(player, e_flagsScouting));