# Convert Real To Integer

Grammar — Integer(val|Real)
FlagsNative | Function

Converts a real value into an integer value.

# Arguments

  • fixed — Value

Returns — int

native int FixedToInt(fixed x);

Category: Conversion / Basic Conversions

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L3372
FixedToInt((IntToFixed(lp_points) * (1.0 + (IntToFixed(gv_repeatTimes) * gv_c_ScoreBonus))))
// L3492
FixedToInt((IntToFixed((lv_shotDownTotal * 100)) / IntToFixed(gv_levelTotalEnemy)))
// L3526
FixedToInt((IntToFixed((lv_pickupTotal * 100)) / IntToFixed(gv_levelTotalPowerups)))
// L4842
FixedToInt(((IntToFixed(lv_deadInterceptorCount) + 1.0) * 0.666))
// L5846
FixedToInt((180.0 / lv_angleDeltaBetweenShots))
// L6332
FixedToInt((lv_shootingInterval + RandomFixed(-10.0, 10.0)))
// L6860
FixedToInt((lv_waveInfo.lv_patternParam5 / AbsF(lv_angleInterval)))
// L8073
FixedToInt((IntToFixed(gv_bossHPBarInnerWidth) * ((UnitGetPropertyFixed(gv_boss, c_unitPropLife, c_unitPropCurrent) + UnitGetPropertyFixed(gv_boss, c_unitPropShields, c_unitPropCurrent)) / (UnitGetPropertyFixed(gv_boss, c_unitPropLifeMax, c_unitPropCurrent) + UnitGetPropertyFixed(gv_boss, c_unitPropShieldsMax, c_unitPropCurrent)))))
// L8142
FixedToInt((IntToFixed(gv_unitHPBarInnerWidth) * ((UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropLife, c_unitPropCurrent) + UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropShields, c_unitPropCurrent)) / (UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropLifeMax, c_unitPropCurrent) + UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropShieldsMax, c_unitPropCurrent)))))
// L2496
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L1885
FixedToInt(UnitGetCustomValue(EventUnit(), 2))
// L1206
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLifeMax, c_unitPropCurrent))
// L1209
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLifeMax, c_unitPropCurrent))
// L1210
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLife, c_unitPropCurrent))
// L1238
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLife, c_unitPropCurrent))
// L1296
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1396
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1506
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1620
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1727
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1508
FixedToInt(UnitGetCustomValue(EventUnit(), 1))
// L1564
FixedToInt(UnitGetCustomValue(EventUnitProgressUnit(), 1))
// L1665
FixedToInt(UnitGetCustomValue(EventUnit(), 1))
// L2063
FixedToInt(UnitGetCustomValue(autoB51C2030_var, (ge_UnitData_udEggType)))
// L2065
FixedToInt(UnitGetCustomValue(autoB51C2030_var, (ge_UnitData_udEggColony)))
// L2148
FixedToInt(UnitGetCustomValue(auto499A4BF2_var, 0))
// L2149
FixedToInt(UnitGetCustomValue(auto499A4BF2_var, 0))
// L2155
FixedToInt(UnitGetCustomValue(auto499A4BF2_var, 0))
// L4319
FixedToInt(gv_trainWaveWait)
// L4335
FixedToInt(gv_trainWaveWait)
// L4348
FixedToInt(gv_trainWaveWait)
// L4362
FixedToInt(gv_trainWaveWait)
// L4374
FixedToInt(gv_trainWaveWait)
// L4381
FixedToInt(gv_trainWaveWait)
// L4389
FixedToInt(gv_trainWaveWait)
// L1269
FixedToInt(gv_odinCurrentHealth)
// L1270
FixedToInt(UnitGetPropertyFixed(gv_odin, c_unitPropLife, c_unitPropCurrent))
// L2498
FixedToInt(UnitGetCustomValue(lp_unit, (ge_CustomDataIndex_CustomDataIndexClickableLock)))
// L2503
FixedToInt(UnitGetCustomValue(lp_unit, (ge_CustomDataIndex_CustomDataIndexClickableRoom)))
// L9588
FixedToInt(UnitGetCustomValue(lv_hotspot, (ge_CustomDataIndex_CustomDataIndexFlashingData)))
// L9603
FixedToInt(UnitGetCustomValue(lp_unit, (ge_CustomDataIndex_CustomDataIndexFlashingData)))
// L9891
FixedToInt(UnitGetCustomValue(lp_unit, (ge_CustomDataIndex_CustomDataIndexFlashingData)))
// L9998
FixedToInt((1600.0 * lv_gradientWidthPercent))
// L10013
FixedToInt(ConversationDataStateFixedValue(lp_convoID, "Anchor"))
// L10013
FixedToInt(ConversationDataStateFixedValue(lp_convoID, "OffsetX"))
// L10013
FixedToInt(ConversationDataStateFixedValue(lp_convoID, "OffsetY"))
// L10013
FixedToInt(ConversationDataStateFixedValue(lp_convoID, "Width"))
// L295
FixedToInt(UnitGetCustomValue(UnitGroupRandomUnit(lv_terrazineGroup, c_unitCountAlive), 0))
// L303
FixedToInt(UnitGetCustomValue(UnitGroupRandomUnit(UnitGroup("TerrazineCanister", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive), 0))
// L497
FixedToInt(UnitGetCustomValue(auto96AA0583_var, 0))
// L502
FixedToInt(UnitGetCustomValue(auto96AA0583_var, 0))
// L533
FixedToInt(UnitGetCustomValue(auto7CD40DCB_var, 0))
// L538
FixedToInt(UnitGetCustomValue(auto7CD40DCB_var, 0))
// L568
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L608
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L618
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L1697
FixedToInt(UnitGetCustomValue(EventUnitTargetUnit(), 0))
// L111
FixedToInt(UnitGetPropertyFixed(UnitFromId(326), c_unitPropLifeMax, c_unitPropNormal))
// L4488
FixedToInt(UnitGetPropertyFixed(gv_tosh, c_unitPropLife, c_unitPropCurrent))
// L1816
FixedToInt(UnitGetPropertyFixed(gv_tHEONEDRILL, c_unitPropLife, c_unitPropNormal))
// L1817
FixedToInt(UnitGetPropertyFixed(gv_tHEONEDOOR, c_unitPropLife, c_unitPropCurrent))
// L2310
FixedToInt((lv_d / 5.0))
// L2520
FixedToInt(TimerGetRemaining(gv_kerriganSearchTimer))
// L1128
FixedToInt((((PointGetY(PointFromId(142)) - PointGetY(PointFromId(122))) / 3.5) - ModF((PointGetY(PointFromId(142)) - PointGetY(PointFromId(122))), 3.5)))
// L5782
FixedToInt(UnitGetCustomValue(auto937566B9_var, 0))
// L5783
FixedToInt(UnitGetCustomValue(auto937566B9_var, 0))
// L7291
FixedToInt(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLifeMax, c_unitPropCurrent))
// L7292
FixedToInt(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent))
// L7322
FixedToInt(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent))
// L499
FixedToInt(UnitGetCustomValue(lp_spawner, 0))
// L510
FixedToInt(UnitGetCustomValue(lp_spawner, 0))
// L2790
FixedToInt(UnitGetCustomValue(EventUnit(), 0))
// L1203
FixedToInt(UnitAbilityGetCooldown(gv_artifact, "EnergyNova", "Abil/Supernova"))
// L1221
FixedToInt(UnitAbilityGetCooldown(gv_artifact, "EnergyNova", "Abil/Supernova"))
// L1807
FixedToInt((IntToFixed(lv_targetCount) * libNtve_gf_DifficultyValueFixed(0.5, 0.5, 0.6, 0.75)))
// L1880
FixedToInt((IntToFixed(lv_targetCount) * 0.8))
// L5325
FixedToInt(TimerGetRemaining(gv_protectArchiveTimer))
// L1174
FixedToInt(TimerGetRemaining(gv_mainTimer))
// L1292
FixedToInt(TimerGetRemaining(gv_mainTimer))
// L1372
FixedToInt(TimerGetRemaining(gv_mainTimer))
// L3372
FixedToInt((IntToFixed(lp_points) * (1.0 + (IntToFixed(gv_repeatTimes) * gv_c_ScoreBonus))))
// L3492
FixedToInt((IntToFixed((lv_shotDownTotal * 100)) / IntToFixed(gv_levelTotalEnemy)))
// L3526
FixedToInt((IntToFixed((lv_pickupTotal * 100)) / IntToFixed(gv_levelTotalPowerups)))
// L4842
FixedToInt(((IntToFixed(lv_deadInterceptorCount) + 1.0) * 0.666))
// L5846
FixedToInt((180.0 / lv_angleDeltaBetweenShots))
// L6332
FixedToInt((lv_shootingInterval + RandomFixed(-10.0, 10.0)))
// L6860
FixedToInt((lv_waveInfo.lv_patternParam5 / AbsF(lv_angleInterval)))
// L8073
FixedToInt((IntToFixed(gv_bossHPBarInnerWidth) * ((UnitGetPropertyFixed(gv_boss, c_unitPropLife, c_unitPropCurrent) + UnitGetPropertyFixed(gv_boss, c_unitPropShields, c_unitPropCurrent)) / (UnitGetPropertyFixed(gv_boss, c_unitPropLifeMax, c_unitPropCurrent) + UnitGetPropertyFixed(gv_boss, c_unitPropShieldsMax, c_unitPropCurrent)))))
// L8142
FixedToInt((IntToFixed(gv_unitHPBarInnerWidth) * ((UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropLife, c_unitPropCurrent) + UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropShields, c_unitPropCurrent)) / (UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropLifeMax, c_unitPropCurrent) + UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropShieldsMax, c_unitPropCurrent)))))
// L2496
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L1885
FixedToInt(UnitGetCustomValue(EventUnit(), 2))
// L1206
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLifeMax, c_unitPropCurrent))
// L1209
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLifeMax, c_unitPropCurrent))
// L1210
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLife, c_unitPropCurrent))
// L1238
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLife, c_unitPropCurrent))
// L1296
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1396
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1506
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1620
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1727
FixedToInt(TimerGetRemaining(gv_poweringUpTime))