# Modulo (Integer)

Grammarx mod y
FlagsNative | Function

Uses integer values. Returns the remainder after the dividend has been divided by the divisor.

# Arguments

  • int — Dividend
  • int — Divisor

Returns — int

native int ModI(int x, int m);

Category: Math / Arithmetic

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L2051
ModI(lv_i, 2)
// L484
ModI(lv_count, 12)
// L1125
ModI(TriggerGetExecCount(TriggerGetCurrent()), 4)
// L2051
ModI(lv_i, 2)
// L484
ModI(lv_count, 12)
// L1125
ModI(TriggerGetExecCount(TriggerGetCurrent()), 4)

# campaigns/libertystory.sc2campaign

CampaignLib.galaxy

// L2001
ModI((lp_second / 60), 60)
// L2002
ModI(lp_second, 60)
// L10966
ModI((lv_index-1), 4)

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L4015
ModI(lv_index, 2)
// L4971
ModI(gv_gasOnCycle, 2)
// L3880
ModI(lv_runcount, 4)
// L3949
ModI(lv_runcount, 3)
// L4887
ModI(gv_potentialRepairingBotDropIndex, libHots_gf_DifficultyValueInt2(2, 2, 5))
// L4015
ModI(lv_index, 2)
// L4971
ModI(gv_gasOnCycle, 2)
// L3880
ModI(lv_runcount, 4)
// L3949
ModI(lv_runcount, 3)
// L4887
ModI(gv_potentialRepairingBotDropIndex, libHots_gf_DifficultyValueInt2(2, 2, 5))

# campaigns/swarmstory.sc2campaign

SwarmCampaignLib.galaxy

// L12586
ModI(lv_energy, 10)
// L12587
ModI(lv_life, 10)
// L15113
ModI(libSwaC_gv_zS_DebugStoryTechArmyCatCount, 2)
// L15150
ModI(libSwaC_gv_zS_DebugStoryTechArmyCatCount, 2)
// L15161
ModI(libSwaC_gv_zS_DebugStoryTechArmyCatCount, 2)
// L23542
ModI(libSwaC_gv_zS_DebugCutsceneCount, 5)

# campaigns/void.sc2campaign

MapScript.galaxy

// L3823
ModI(gv_bigWavesSent, 2)
// L804
ModI(lv_rotationIncrement, 2)
// L843
ModI(lv_rotationIncrement, 2)
// L3600
ModI(gv_disruptionCount, 2)
// L4057
ModI(gv_disruptionCount, 2)
// L1105
ModI(lv_rotationIncrement, 2)
// L1143
ModI(lv_rotationIncrement, 2)
// L3493
ModI(gv_terrazineNightCount, 3)
// L3592
ModI(gv_terrazineNightCount, 2)
// L3106
ModI(gv_kerriganUnderAttackWarningsCount, 3)
// L3823
ModI(gv_bigWavesSent, 2)
// L804
ModI(lv_rotationIncrement, 2)
// L843
ModI(lv_rotationIncrement, 2)
// L3600
ModI(gv_disruptionCount, 2)
// L4057
ModI(gv_disruptionCount, 2)
// L1105
ModI(lv_rotationIncrement, 2)
// L1143
ModI(lv_rotationIncrement, 2)
// L3493
ModI(gv_terrazineNightCount, 3)
// L3592
ModI(gv_terrazineNightCount, 2)
// L3106
ModI(gv_kerriganUnderAttackWarningsCount, 3)

# campaigns/voidstory.sc2campaign

VoidCampaignLib.galaxy

// L158
ModI(libVoiC_gv_pC_DebugCampaignTechArmyCatCount, 2)
// L199
ModI(libVoiC_gv_pC_DebugCampaignTechArmyCatCount, 2)
// L10037
ModI(libVoiC_gv_pC_DebugCutsceneCount, 5)

# mods/core.sc2mod

NativeLib.galaxy

// L2544
ModI((lv_hourIndex - 1), 12)

# mods/heroes.stormmod

MapScript.galaxy

// L3568
ModI(lv_timeIndex, 30)
// L885
ModI(lp_index, 7)
// L3568
ModI(lv_timeIndex, 30)
// L885
ModI(lp_index, 7)

# mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmod

LibPEB1.galaxy

// L2077
ModI(lv_iterationCounter, 100)
// L8058
ModI(lv_durationRemaining, 5)
// L8066
ModI(lv_durationRemaining, 10)

# mods/heroesbrawlmods/brawlmapmods/coop/pvebrawluimod.stormmod

LibPBUI.galaxy

// L1320
ModI((libGame_gv_players[lp_viewerPlayer].lv_rosterSlot - 1), 5)
// L1321
ModI((libGame_gv_players[lp_subjectPlayer].lv_rosterSlot - 1), 5)

# mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmod

LibPVEU.galaxy

// L1335
ModI((libGame_gv_players[lp_viewerPlayer].lv_rosterSlot - 1), 5)
// L1336
ModI((libGame_gv_players[lp_subjectPlayer].lv_rosterSlot - 1), 5)

# mods/heroesbrawlmods/heroselectionmods/ingameheroselection.stormmod

LibIGHS.galaxy

// L1506
ModI((libGame_gv_players[lp_viewerPlayer].lv_rosterSlot - 1), 5)
// L1507
ModI((libGame_gv_players[lp_subjectPlayer].lv_rosterSlot - 1), 5)

# mods/heroesdata.stormmod

AILib.galaxy

// L2915
ModI(FixedToInt((GameGetMissionTime() * 16.0)), libAIAI_gv_aIDefenderIndexMod)

# mods/heroesdata.stormmod

GameDataHelperLib.galaxy

// L1705
ModI(UnitBehaviorCount(lv_vikingUnit, "LostVikingsVikingBriberyStacks"), 40)
// L17820
ModI(UnitBehaviorCount(lv_nova, libGame_gv_players[lv_player].lv_bribeTokenLink), libGame_gv_players[lv_player].lv_bribeChargeStackRequirement)

# mods/heroesdata.stormmod

GameLib.galaxy

// L8697
ModI((libGame_gv_minionWaveSpawnCounter - libGame_gv_minion_PeriodicCatapultsFirstWave), libGame_gv_minion_PeriodicCatapultsWavePeriod_C)
// L9253
ModI(UnitBehaviorCount(lv_bribeOwnerUnit, libGame_gv_players[lp_killingPlayer].lv_bribeTokenLink), libGame_gv_players[lp_killingPlayer].lv_bribeChargeStackRequirement)
// L19549
ModI(FixedToInt((lv_missionTime / 0.0625)), lv_heroIndexMod)

# mods/heroesdata.stormmod

HeroesLib.galaxy

// L2519
ModI(lv_i, lv_numberOfValidPoints)

# mods/heroesdata.stormmod

MapMechanicsLib.galaxy

// L2996
ModI(libMapM_gv_mMRavenLastTributeSpawnIndex1, 2)
// L2996
ModI(libMapM_gv_mMRavenLastTributeSpawnIndex2, 2)
// L2996
ModI(lv_index, 2)
// L2996
ModI(libMapM_gv_mMRavenLastTributeSpawnIndex1, 2)

# mods/heroesmapmods/battlegroundmapmods/hanamura.stormmod

LibMHmu.galaxy

// L639
ModI(lv_shotsRemaining, lv_shotspervolley)

# mods/heroesmapmods/battlegroundmapmods/hauntedmines.stormmod

LibMHtM.galaxy

// L1493
ModI(lv_timeIndex, 4)

# mods/heroesmapmods/battlegroundmapmods/tombofthespiderqueen.stormmod

LibMSOC.galaxy

// L415
ModI(lv_count1, 20)
// L417
ModI(lv_count1, 5)

# mods/heroesmapmods/battlegroundmapmods/volskayamechanics.stormmod

LibVLSK.galaxy

// L1126
ModI(lp_rawTime, 60)
// L1127
ModI(lp_rawTime, 60)
// L1131
ModI(lp_rawTime, 60)

# mods/heromods/dehaka.stormmod

LibHDEH.galaxy

// L130
ModI(lv_newScoreValue, libHDEH_gv_heroDehakaTalentEnhancedAgilityEssencePerStack)
// L169
ModI(lv_newScoreValue, libHDEH_gv_heroDehakaTalentTissueRegenerationEssencePerStack)

# mods/liberty.sc2mod

LibertyLib.galaxy

// L507
ModI(lv_positionFromRight, 3)
// L518
ModI((lv_positionFromRight + 1), 3)

# mods/missionpacks/novacampaign.sc2mod

LibNovC.galaxy

// L258
ModI(lv_techItemIndex, 5)
// L259
ModI(lv_techItemIndex, 5)

# mods/novastoryassets.sc2mod

MapScript.galaxy

// L661
ModI(lv_i, 2)
// L3640
ModI(gv_protossClaimWavesSent, 2)
// L3683
ModI(gv_protossClaimWavesSent, 2)
// L3726
ModI(gv_protossClaimWavesSent, 2)
// L8320
ModI(gv_protossClaimWavesSent, 2)
// L8351
ModI(gv_protossClaimWavesSent, 2)
// L8382
ModI(gv_protossClaimWavesSent, 2)
// L661
ModI(lv_i, 2)
// L3640
ModI(gv_protossClaimWavesSent, 2)
// L3683
ModI(gv_protossClaimWavesSent, 2)
// L3726
ModI(gv_protossClaimWavesSent, 2)
// L8320
ModI(gv_protossClaimWavesSent, 2)
// L8351
ModI(gv_protossClaimWavesSent, 2)
// L8382
ModI(gv_protossClaimWavesSent, 2)