# Catalog Field Value Modify (Based On Default Value)
Grammar — Modify value of catalog entry fieldPath for player player using operation and value, based on its default value
Flags —Action
Modifies the value of a field for an entry based on the default value instead of the current value. To find the name of a field path, open the data editor and turn on View Raw Data. For example, if you wanted to set the unit for the first index of a train ability, your field path string would be “InfoArray[0].Unit”.
# Arguments
int
<preset::CatalogType> — Catalogstring
<catalogentry> — Entrystring
<catalogfieldpath> — Field Pathint
— Playerfixed
— Valueint
<preset::UpgradeOperation> — Operation
Returns — bool
bool libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(
int lp_catalog,
string lp_entry,
string lp_fieldPath,
int lp_player,
fixed lp_value,
int lp_operation,
);
# Related
Category: Catalog / Support
- Upgrade Operation — preset —
int
- No Game Link — preset —
gamelink
- No Alert — preset —
string
- Cost Type — preset —
string
- Catalog Type — preset —
int
- Any Game Link — preset —
gamelink
- Field Type Category — preset —
int
- Catalog Field Value Set —
bool
— CatalogFieldValueSet - Catalog Field Value Set As Real —
bool
— libNtve_gf_CatalogFieldValueSetAsReal - Catalog Field Value Modify —
bool
— CatalogFieldValueModify - Catalog Field Value Modify (Based On Default Value) —
bool
— libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue - Catalog Reference Set —
bool
— CatalogReferenceSet - Catalog Reference Set As Real —
bool
— libNtve_gf_CatalogReferenceSetAsReal - Catalog Reference Modify —
bool
— CatalogReferenceModify - Catalog Reference Modify (Based On Default Value) —
bool
— libNtve_gf_CatalogReferenceModifyBasedOnDefaultValue - Catalog Link Replace —
void
— CatalogLinkReplace - Catalog Link Replacement —
string
— CatalogLinkReplacement
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:4530
// Implementation
CatalogFieldValueSet(c_gameCatalogEffect, libCOMI_gv_c_DehakaConsumeEffectPsiExplodeWeaponDmgLink, "Amount", lp_dehakaPlayer, (FixedToString(lv_totalDmg, c_fixedPrecisionAny)));
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogEffect, "DehakaConsumeEffectPsionicSearch", "AreaArray[" + IntToString(0) + "].Radius", lp_dehakaPlayer, UnitGetPropertyFixed(lp_dehakaUnit, c_unitPropRadius, c_unitPropCurrent), c_upgradeOperationAdd);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:5075
}
else {
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "HHWidowMineBurrowedAttack", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply);
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogBehavior, "HHWidowMineAnimationController", "Duration", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:5076
else {
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "HHWidowMineBurrowedAttack", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply);
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogBehavior, "HHWidowMineAnimationController", "Duration", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply);
}
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:6060
lv_instance = UserDataInstance(auto9ADCDADB_userType, auto9ADCDADB_i);
lv_uT = UserDataGetUnit(libCOMI_gv_cM_Tychus_UserTypeHeroList, lv_instance, "Unit Type", 1);
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(0) + "]", lp_p, RoundI((lp_multiplyMinerals * libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(0) + "]", c_playerAny) * lv_costfactor)), c_upgradeOperationSet);
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(1) + "]", lp_p, RoundI((lp_multiplyMinerals * libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(1) + "]", c_playerAny) * lv_costfactor)), c_upgradeOperationSet);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:6061
lv_uT = UserDataGetUnit(libCOMI_gv_cM_Tychus_UserTypeHeroList, lv_instance, "Unit Type", 1);
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(0) + "]", lp_p, RoundI((lp_multiplyMinerals * libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(0) + "]", c_playerAny) * lv_costfactor)), c_upgradeOperationSet);
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(1) + "]", lp_p, RoundI((lp_multiplyMinerals * libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(1) + "]", c_playerAny) * lv_costfactor)), c_upgradeOperationSet);
}
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:19359
}
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "ChargedBuster", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply);
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "FenixDragoonAirBomb", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply);
return true;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:19360
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "ChargedBuster", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply);
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "FenixDragoonAirBomb", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply);
return true;
}