# Catalog Reference Get As Integer
Grammar — Value of reference for player player as an integer
Flags —Native
|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> — Referenceint
— Player
Returns — int
native int CatalogReferenceGetAsInt(
string reference,
int player,
);
# Related
Category: Catalog / Lookup
- Catalog Entry Is Default —
bool
— CatalogEntryIsDefault - Catalog Entry Is Valid —
bool
— CatalogEntryIsValid - Catalog Entry Class —
int
— CatalogEntryClass - Catalog Entry Count —
int
— CatalogEntryCount - Catalog Entry Get —
string
<catalogentry> — CatalogEntryGet - Catalog Entry Parent —
string
<catalogentry> — CatalogEntryParent - Catalog Entry Scope —
string
<catalogscope> — CatalogEntryScope - Catalog Field Count —
int
— CatalogFieldCount - Catalog Field Get —
string
<catalogfieldname> — CatalogFieldGet - Catalog Field Exists —
bool
— CatalogFieldExists - Catalog Field Is Array —
bool
— CatalogFieldIsArray - Catalog Field Is Scope —
bool
— CatalogFieldIsScope - Catalog Field Type —
string
— CatalogFieldType - Catalog Field Type Category —
int
<preset::FieldTypeCategory> — CatalogFieldTypeCategory - Catalog Field Value Get —
string
— CatalogFieldValueGet - Catalog Field Value Get As Integer —
int
— CatalogFieldValueGetAsInt - Catalog Field Value Get Flags As Integer —
int
— CatalogFieldValueGetFlagsAsInt - Catalog Field Value Get As Real —
fixed
— libNtve_gf_CatalogFieldValueGetAsReal - Catalog Field Value Count —
int
— CatalogFieldValueCount - Catalog Reference Get —
string
— CatalogReferenceGet - Catalog Reference Get As Integer —
int
— CatalogReferenceGetAsInt - Catalog Reference Get As Real —
fixed
— libNtve_gf_CatalogReferenceGetAsReal - Catalog Reference Count —
int
— CatalogReferenceCount - Class Of Ability —
int
<preset::AbilityClass> — AbilityClass - Cost Of Ability —
fixed
— libNtve_gf_CostOfAbility
# Examples
mods/heroesdata.stormmod — base.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.stormmod — base.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.stormmod — base.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.sc2mod — base.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.sc2mod — base.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")));