# Get Min Desired Harvest Peon Count

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

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

# Arguments

  • int — Player
  • int — Town

Returns — int

native int AIGetMinPeonCount(int player, int town);

Category: AI Advanced / Towns / Functions

# Examples

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

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

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

//--------------------------------------------------------------------------------------------------
void TerranBasicEconomy (int player, int tier, int minWorkers) {
    int econMin = AIGetMinPeonCount(player, c_townMax);
    if (minWorkers > econMin) {
        minWorkers = econMin;

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

//--------------------------------------------------------------------------------------------------
void ZergBasicEconomy (int player, int tier, int minWorkers) {
    int econMin = AIGetMinPeonCount(player, c_townMax);
    if (minWorkers > econMin) {
        minWorkers = econMin;

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

//--------------------------------------------------------------------------------------------------
void ProtossBasicEconomy (int player, int tier, int minWorkers) {
    int econMin = AIGetMinPeonCount(player, c_townMax);
    if (minWorkers > econMin) {
        minWorkers = econMin;