# Minimum (Integer)

Grammar — Min(value1, value2)
FlagsNative | Function

Returns the lowest of the two integer values specified.

# Arguments

  • int — Value 1
  • int — Value 2

Returns — int

native int MinI(int x1, int x2);

Category: Math / Conditionals

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L3785
MinI((gv_colonistsSaved + 1), 50)
// L290
MinI(PlayerGetPropertyInt(lv_owner, c_playerPropSuppliesMade), PlayerGetPropertyInt(lv_owner, c_playerPropSuppliesLimit))
// L2298
MinI(gv_trainsDestroyed, 7)
// L3142
MinI(lv_lingerTime, lv_arrivalTime)
// L1808
MinI(lv_desiredCasts, libNtve_gf_DifficultyValueInt(5, 5, 8, 9))
// L1881
MinI(lv_desiredCasts, 4)
// L3785
MinI((gv_colonistsSaved + 1), 50)
// L290
MinI(PlayerGetPropertyInt(lv_owner, c_playerPropSuppliesMade), PlayerGetPropertyInt(lv_owner, c_playerPropSuppliesLimit))
// L2298
MinI(gv_trainsDestroyed, 7)
// L3142
MinI(lv_lingerTime, lv_arrivalTime)
// L1808
MinI(lv_desiredCasts, libNtve_gf_DifficultyValueInt(5, 5, 8, 9))
// L1881
MinI(lv_desiredCasts, 4)

# campaigns/libertystory.sc2campaign

CampaignLib.galaxy

// L5586
MinI(libCamp_gf_StoryResearchPointCap(libCamp_ge_StoryResearchCategory_ResearchCategoryProtoss), libCamp_gf_StoryResearchPoints(libCamp_ge_StoryResearchCategory_ResearchCategoryProtoss))
// L5587
MinI(libCamp_gf_StoryResearchPointCap(libCamp_ge_StoryResearchCategory_ResearchCategoryZerg), libCamp_gf_StoryResearchPoints(libCamp_ge_StoryResearchCategory_ResearchCategoryZerg))
// L13649
MinI((libCamp_gv_tSX_DebugResearchLevel[(libCamp_ge_StoryResearchCategory_ResearchCategoryProtoss)] + 1), 35)
// L13667
MinI((libCamp_gv_tSX_DebugResearchLevel[(libCamp_ge_StoryResearchCategory_ResearchCategoryZerg)] + 1), 35)

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L3480
MinI(gv_hunterBanelingCollected, gv_hunterBanelingCollectRequired)
// L2168
MinI((15 - lv_roachCount), 5)
// L2178
MinI((15 - lv_roachCount), 5)
// L9429
MinI(lv_zerglings, 6)
// L7628
MinI(gv_structuresDestroyedS1Stat, gv_structuresDestroyedS1Max)
// L115
MinI(libSwaC_gf_StoryKerriganLevel(), 70)
// L146
MinI(libSwaC_gf_StoryKerriganLevel(), 70)
// L122
MinI(libSwaC_gf_StoryKerriganLevel(), 70)
// L3480
MinI(gv_hunterBanelingCollected, gv_hunterBanelingCollectRequired)
// L2168
MinI((15 - lv_roachCount), 5)
// L2178
MinI((15 - lv_roachCount), 5)
// L9429
MinI(lv_zerglings, 6)
// L7628
MinI(gv_structuresDestroyedS1Stat, gv_structuresDestroyedS1Max)
// L115
MinI(libSwaC_gf_StoryKerriganLevel(), 70)
// L146
MinI(libSwaC_gf_StoryKerriganLevel(), 70)
// L122
MinI(libSwaC_gf_StoryKerriganLevel(), 70)

# campaigns/swarmstory.sc2campaign

SwarmCampaignLib.galaxy

// L12287
MinI(libSwaC_gv_zS_KerriganActualLevel, 10)
// L12288
MinI(libSwaC_gv_zS_KerriganActualLevel, 20)
// L12289
MinI(libSwaC_gv_zS_KerriganActualLevel, 30)
// L12290
MinI(libSwaC_gv_zS_KerriganActualLevel, 40)
// L12291
MinI(libSwaC_gv_zS_KerriganActualLevel, 50)
// L12292
MinI(libSwaC_gv_zS_KerriganActualLevel, 60)
// L12293
MinI(libSwaC_gv_zS_KerriganActualLevel, 70)

# campaigns/void.sc2campaign

MapScript.galaxy

// L904
MinI((lv_zerglingCap - UnitGroupCount(lv_zerglingGroup, c_unitCountAlive)), 3)
// L904
MinI((lv_zerglingCap - UnitGroupCount(lv_zerglingGroup, c_unitCountAlive)), 3)
// L362
MinI(gv_heroMaxLevel_C, gv_heroCurrentLevel)
// L413
MinI(gv_heroMaxLevel_C, gv_heroCurrentLevel)
// L456
MinI(gv_heroMaxLevel_C, gv_heroCurrentLevel)
// L673
MinI(30, lp_level)
// L362
MinI(gv_heroMaxLevel_C, gv_heroCurrentLevel)
// L413
MinI(gv_heroMaxLevel_C, gv_heroCurrentLevel)
// L456
MinI(gv_heroMaxLevel_C, gv_heroCurrentLevel)
// L673
MinI(30, lp_level)

# mods/heroesbrawlmods/arenamodemods/arenamode.stormmod

LibAREN.galaxy

// L329
MinI(libAREN_gv_aRM_MechanicsCountToPick_C, libAREN_gv_aRM_MechanicsCount)

# mods/heroesbrawlmods/arenamodemods/gardenarena.stormmod

LibAMGT.galaxy

// L645
MinI(lv_dropIndex, lv_dropIndexMax)
// L831
MinI(lv_dropIndex, lv_dropIndexMax)

# mods/heroesbrawlmods/arenamodemods/punisherarena.stormmod

LibAMPU.galaxy

// L250
MinI(lp_score, libAMPU_gv_aRMPunisherSkullRequired_C)

# mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmod

LibMDoE.galaxy

// L1672
MinI(FixedToInt((libAtDe_gv_attackDefend.lv_score[lp_itTeam] + 1)), 5)
// L2810
MinI(libMDoE_gf_DoESGetCannonballCountOnHero(lv_handInPlayer, lv_handInHeroUnit), (libMDoE_gv_mDoE_CannonballTurnInCost[lv_handInTeam] - libMDoE_gv_mDoE_CannonballTurnedIn[lv_handInTeam]))

# mods/heroesdata.stormmod

GameLib.galaxy

// L1634
MinI(libGame_gv_deathRecap_DeathData[lp_deadPlayer].lv_highestDamagersCount, libGame_gv_deathRecap_MaxMaxDamagers_C)
// L1663
MinI(libGame_gv_deathRecap_DeathData[lp_deadPlayer].lv_highestDamagers[lp_maxDamagerIndex].lv_maxDamageAbilCount, libGame_gv_deathRecap_MaxMaxDamageAbils_C)
// L8898
MinI(lv_closestIndex, lv_secondaryIndex)
// L11106
MinI(lp_scalingTicks, libMapM_gv_jungleCreepCamps[lp_camp].lv_defenderNumberOfRanks)
// L11107
MinI(lp_scalingTicks, libMapM_gv_jungleCreepCamps[lp_camp].lv_mercNumberOfRanks)
// L17947
MinI(lv_minPingIndex, lv_pingIndex)

# mods/heroesdata.stormmod

MapMechanicsLib.galaxy

// L201
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "MercSiegeTrooperDefenderScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L202
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "MercSiegeTrooperLanerScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L233
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "MercSummonerDefenderScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L234
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "MercSummonerDefenderMinionScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L235
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "MercSummonerLanerScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L270
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "TerranHellbatDefenderScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L271
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "TerranHellbatScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L301
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "MercGoblinSapperDefenderScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L302
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "MercGoblinSapperLanerScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L317
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, lp_scalingBehavior, "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)

# mods/heroesdata.stormmod

SupportLib.galaxy

// L1752
MinI((lv_tokensToAdd + lv_currentTokenCount), lv_tokenHardCap)
// L8103
MinI(30, StringToInt(StringWord(EventChatMessage(false), 3)))

# mods/heroesmapmods/battlegroundmapmods/alteracpass.stormmod

LibMMAP.galaxy

// L242
MinI((((FixedToInt(TimerGetElapsed(libGame_gv_gameTimer))/60)*2)), 60)

# mods/heroesmapmods/battlegroundmapmods/blackheartsbay.stormmod

LibBBAY.galaxy

// L1473
MinI((UnitBehaviorCount(lv_collectingUnit, "MapMechanicStack") + 1), 100)
// L1548
MinI(libBBAY_gf_MMBBCannonballsHeroCannonballsCount(lv_handInPlayer, lv_handInHeroUnit), (libBBAY_gf_MMBBCannonballsPirateShipCost(lv_handInTeam) - libBBAY_gv_mMBBCannonballsBallsSubmitted[lv_handInTeam]))

# mods/heroesmapmods/battlegroundmapmods/hauntedmines.stormmod

LibMHtM.galaxy

// L519
MinI(lv_dropIndex, lv_dropIndexMax)

# mods/heroesmapmods/battlegroundmapmods/tombofthespiderqueen.stormmod

LibMSOC.galaxy

// L1818
MinI(lv_count, (100 - libMSOC_gf_MMTombSpiderQueenGetGemsHeldforUnit(lv_collectingUnit)))
// L1975
MinI(lv_ownCount, (libMSOC_gv_mMTombSpiderQueenActivationAmountRequired[lv_channelingTeam] - libMSOC_gv_mMTombSpiderQueenSoulsTotal[lv_channelingTeam]))
// L2031
MinI(libMSOC_gv_mMTombSpiderQueenActivationAmountRequired[lv_channelingTeam], libMSOC_gv_mMTombSpiderQueenActivationAmountCap_C)

# mods/heroesmapmods/battlegroundmapmods/warcraftdata.stormmod

Lib7EB401DE.galaxy

// L78
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "TerranHellbatDefenderScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)
// L79
MinI((CatalogFieldValueCount(c_gameCatalogBehavior, "TerranHellbatScaling", "VeterancyLevelArray", c_playerAny) - 1), libCore_gv_dataScalingMaxScalingTicks)

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L4906
MinI((lv_supply * lv_stacksPerSupply), lv_maxCount)
// L6644
MinI(lp_artifactNumber, libCOMI_gv_cM_ZeratulProphecyArtifactFinalUniqueNumber)
// L22655
MinI((lv_bunkerdepotcargocapacity / lv_troopercargosize), lv_bunkerdepotcargomaxcount)

# mods/starcoop/starcoop.sc2mod

LibCOMU.galaxy

// L815
MinI(FixedToInt(lv_newSupply), 10)
// L1166
MinI(PlayerGetPropertyInt(lv_microPlayer, c_playerPropVespene), 5)
// L1167
MinI(PlayerGetPropertyInt(lv_microPlayer, c_playerPropMinerals), 10)
// L1171
MinI(PlayerGetPropertyInt(lv_microPlayer, c_playerPropMinerals), 10)
// L1189
MinI(PlayerGetPropertyInt(lv_microPlayer, c_playerPropMinerals), MaxI(AbsI(FixedToInt(lv_orderCost)), 1))
// L1190
MinI(PlayerGetPropertyInt(lv_microPlayer, c_playerPropVespene), MaxI(AbsI(FixedToInt(lv_orderCost)), 1))
// L1191
MinI(FixedToInt(lv_orderCost), -1)
// L1192
MinI(FixedToInt(lv_orderCost), -1)
// L1196
MinI(FixedToInt(lv_orderCost), -1)
// L1197
MinI(PlayerGetPropertyInt(lv_microPlayer, c_playerPropMinerals), MaxI(AbsI(FixedToInt(lv_orderCost)), 1))

# mods/starcoop/starcoop.sc2mod

LibCOOC.galaxy

// L1320
MinI(lp_level, libCOOC_gv_cCC_PLAYERLEVELMAX)
// L1997
MinI(lp_level, libCOOC_gv_cCC_PLAYERLEVELMAX)

# mods/starcoop/starcoop.sc2mod

LibCOUI.galaxy

// L7194
MinI(libCOUI_gv_cU_MasteryCategoryPointsLeft[libCOOC_gf_CC_PlayerMasteryCategory(libCOUI_gv_cU_MasteryUpgrades[lv_itemIndex][EventPlayer()])][EventPlayer()], 10)
// L8137
MinI(lv_damageBarWidth, 244)

# mods/warcoop/warclassicsystem.sc2mod

WarClassicTactical.galaxy

// L99
MinI((CatalogFieldValueCount(c_gameCatalogAbil, lp_abil, "Range", lp_owner)-1), lp_level)