# Catalog Reference Get As Integer

Grammar — Value of reference for player player as an integer
FlagsNative | Function

Returns the value of a field for an entry as an integer. Use catalog lookup functions to retrieve a data value or other information from the game data. To find the name of a field path, open the data editor and turn on View Raw Data. For example, if you wanted to get the unit for the first index of a train ability, your field path string would be “InfoArray[0].Unit”.

# Arguments

  • string<reference> — Reference
  • int — Player

Returns — int

native int CatalogReferenceGetAsInt(
	string reference,
	int player,
);

Category: Catalog / Lookup

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:7981

    lv_butcherPlayer = EventPlayerEffectUsedUnitOwner(c_effectPlayerCaster);
    lv_butcher = libGame_gv_players[lv_butcherPlayer].lv_heroUnit;
    lv_maxCharges = FixedToInt(CatalogReferenceGetAsInt("Abil,ButcherFreshMeatDummy,Cost.Charge.CountMax", c_playerAny));
    lv_currentCharges = (lv_maxCharges - FixedToInt(UnitGetChargeUsed(lv_butcher, lv_freshMeatChargeLink)));
    lv_changeInCharges = (UnitBehaviorCount(lv_butcher, "ButcherFreshMeatTokenCounter") - lv_currentCharges);

mods/heromods/chogall.stormmodbase.stormdata/LibHCHO.galaxy:200


    // Implementation
    lv_runeBombSpeed = CatalogReferenceGetAsInt("Mover,ChoRuneBombReturnMissile,MotionPhases[0].Speed", libGDHL_gv_chogallPairs[lv_choGallPairsTeamID].lv_choPlayer);
    lv_runeBombDistanceToCho = DistanceBetweenPoints(UnitGetPosition(lv_runeBomb), UnitGetPosition(libGDHL_gv_chogallPairs[lv_choGallPairsTeamID].lv_choUnit));
    lv_timeToImpact = (lv_runeBombDistanceToCho / lv_runeBombSpeed);

mods/heromods/chogall.stormmodbase.stormdata/LibHCHO.galaxy:209

    UnitBehaviorSetDuration(libGDHL_gv_chogallPairs[lv_choGallPairsTeamID].lv_gallUnit, "GallRunicBlastOrbActive", lv_timeToImpact);
    while (((UnitIsAlive(lp_OrbUnit) == true) && (UnitIsAlive(libGDHL_gv_chogallPairs[lv_choGallPairsTeamID].lv_gallUnit) == true) && (UnitHasBehavior2(lv_runeBomb, "ChoRuneBombDetonationImmunity") == false) && (UnitHasBehavior2(lv_runeBomb, "ChoRuneBombDetonated") == false))) {
        lv_runeBombSpeed = CatalogReferenceGetAsInt("Mover,ChoRuneBombReturnMissile,MotionPhases[0].Speed", libGDHL_gv_chogallPairs[lv_choGallPairsTeamID].lv_choPlayer);
        lv_runeBombDistanceToCho = DistanceBetweenPoints(UnitGetPosition(lv_runeBomb), UnitGetPosition(libGDHL_gv_chogallPairs[lv_choGallPairsTeamID].lv_choUnit));
        lv_timeToImpact = (lv_runeBombDistanceToCho / lv_runeBombSpeed);

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

    // Variable Initialization
    lv_crittexttag = c_textTagNone;
    lv_critmultiplier = CatalogReferenceGetAsInt("Behavior,TychusHercCritPassive,DamageResponse.ModifyFraction", libCOOC_gf_CC_PlayerOfCommanderInGroupFirst("TerranTychus", libCOOC_gf_CC_PlayersOfCommander("TerranTychus")));
    lv_ragestacks = UnitBehaviorCount(EventPlayerEffectUsedUnit(c_effectUnitCaster), "TychusHercRageDamageBuff");
    lv_ragedamage = CatalogReferenceGetAsInt("Behavior,TychusHercRageDamageBuff,Modification.DamageDealtUnscaled[Melee]", libCOOC_gf_CC_PlayerOfCommanderInGroupFirst("TerranTychus", libCOOC_gf_CC_PlayersOfCommander("TerranTychus")));

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

    lv_critmultiplier = CatalogReferenceGetAsInt("Behavior,TychusHercCritPassive,DamageResponse.ModifyFraction", libCOOC_gf_CC_PlayerOfCommanderInGroupFirst("TerranTychus", libCOOC_gf_CC_PlayersOfCommander("TerranTychus")));
    lv_ragestacks = UnitBehaviorCount(EventPlayerEffectUsedUnit(c_effectUnitCaster), "TychusHercRageDamageBuff");
    lv_ragedamage = CatalogReferenceGetAsInt("Behavior,TychusHercRageDamageBuff,Modification.DamageDealtUnscaled[Melee]", libCOOC_gf_CC_PlayerOfCommanderInGroupFirst("TerranTychus", libCOOC_gf_CC_PlayersOfCommander("TerranTychus")));
    lv_weapondamage = CatalogFieldValueGetAsInt(c_gameCatalogEffect, "TychusHERCWeaponDamage", "Amount", libCOOC_gf_CC_PlayerOfCommanderInGroupFirst("TerranTychus", libCOOC_gf_CC_PlayersOfCommander("TerranTychus")));