# Trunc (Integer)

Grammar — Trunc(x)
FlagsNative | Function

Strips off the fractional portion of a real.

# Arguments

  • fixed — Value

Returns — int

native int TruncI(fixed x);

Category: Math / Arithmetic

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/AILib.galaxy:2487

    else {
    }
    libGame_gf_ModifyTokenCount(TruncI(lv_aiThreatValue), lv_lanePowerDelegateToken, libGame_gv_teams[lp_teamID].lv_core);
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/AILib.galaxy:2541

        return ;
    }
    libGame_gf_ModifyTokenCount(TruncI(lv_aiThreatValue), lv_lanePowerDelegateToken, libGame_gv_teams[lp_teamID].lv_core);
}

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:4046

                libSCHO_gf_MMHOControlSlabAnimationsProgress(libGame_gv_teamOrderIndex_C);
                libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamOrderIndex_C] += libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C;
                libAIAI_gf_AITeamDelegateAdjustMapEventProgressforTeam(TruncI(libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C), libGame_gv_teamOrderIndex_C);
                if ((libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamOrderIndex_C] > 100.0)) {
                    libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamOrderIndex_C] = 100.0;

mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmodbase.stormdata/LibSCHO.galaxy:4067

                libSCHO_gf_MMHOControlSlabAnimationsProgress(libGame_gv_teamChaosIndex_C);
                libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamChaosIndex_C] += libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C;
                libAIAI_gf_AITeamDelegateAdjustMapEventProgressforTeam(TruncI(libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C), libGame_gv_teamChaosIndex_C);
                if ((libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamChaosIndex_C] > 100.0)) {
                    libSCHO_gv_mMHO_TeamProgress[libGame_gv_teamChaosIndex_C] = 100.0;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:2643


        if ((UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene) > 0)) {
            lv_unitPercentBaseCreateCount = MaxI(TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene))), 1);
        }
        else {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:2647

        else {
            breakpoint;
            lv_unitPercentBaseCreateCount = TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / 125.0));
        }
        autoEA202307_ae = lv_unitPercentBaseCreateCount;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:2999


        if ((UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene) > 0)) {
            lv_unitPercentBaseCreateCount = MaxI(TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene))), 1);
        }
        else {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:3003

        else {
            breakpoint;
            lv_unitPercentBaseCreateCount = TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / 125.0));
        }
        autoA1B74908_ae = lv_unitPercentBaseCreateCount;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:15344

    lv_biomassCountTargetTotal += (UnitBehaviorCount(EventPlayerEffectUsedUnit(c_effectUnitTarget), "BiomassBuff10") * 10);
    lv_biomassCountTargetTotal += UnitBehaviorCount(EventPlayerEffectUsedUnit(c_effectUnitTarget), "BiomassBuff1");
    lv_biomass100Stacks = TruncI((lv_biomassCountStoredTemp / 100));
    lv_biomassCountStoredTemp -= (lv_biomass100Stacks * 100);
    lv_biomass10Stacks = TruncI((lv_biomassCountStoredTemp / 10));

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:15346

    lv_biomass100Stacks = TruncI((lv_biomassCountStoredTemp / 100));
    lv_biomassCountStoredTemp -= (lv_biomass100Stacks * 100);
    lv_biomass10Stacks = TruncI((lv_biomassCountStoredTemp / 10));
    lv_biomassCountStoredTemp -= (lv_biomass10Stacks * 10);
    lv_biomass1Stacks = lv_biomassCountStoredTemp;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:15356

        libCOMI_gf_CM_Abathur_BiomassScale(EventPlayerEffectUsedUnit(c_effectUnitCaster), false);
        libCOMI_gv_cM_DebugAbathurBiomassCollected += lv_biomassCountStoredTemp;
        lv_biomass100Stacks = TruncI((lv_biomassCountStoredTemp / 100));
        lv_biomassCountStoredTemp -= (lv_biomass100Stacks * 100);
        lv_biomass10Stacks = TruncI((lv_biomassCountStoredTemp / 10));

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:15358

        lv_biomass100Stacks = TruncI((lv_biomassCountStoredTemp / 100));
        lv_biomassCountStoredTemp -= (lv_biomass100Stacks * 100);
        lv_biomass10Stacks = TruncI((lv_biomassCountStoredTemp / 10));
        lv_biomassCountStoredTemp -= (lv_biomass10Stacks * 10);
        lv_biomass1Stacks = lv_biomassCountStoredTemp;