# Value From Data Table (Unit)

Grammarname from the scope|Global/Local data table
FlagsNative | Function

Returns a unit value from a data table. Data tables allow you to store and recall values using a string identifier.

# Arguments

  • bool [ preset::DataScope ] — Scope
  • string — Name

Returns — unit

native unit DataTableGetUnit(bool global, string name);

Category: Data Table / Load Value

# Examples

# campaigns/swarmstory.sc2campaign

SwarmCampaignLib.galaxy

// L7828
DataTableGetUnit(true, (libSwaC_gv_zSC_ArmyCustomEggUnitDataPrefix + (lp_armyCategory)))

# mods/core.sc2mod

NativeLib.galaxy

// L5203
DataTableGetUnit(false, "%REPLACEDUNIT%")
// L4448
DataTableGetUnit(false, "%REPLACEDUNIT%")

# mods/heroesbrawlmods/brawlmapmods/coop/pvebrawlmod.stormmod

LibPVEB.galaxy

// L802
DataTableGetUnit(false, TriggerEventParamName(libPVEB_gv_eventID_NPCHeroSpawn_C, libPVEB_gv_eventParam_NPCHeroSpawn_HeroUnit_C))

# mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmod

LibPVEM.galaxy

// L1009
DataTableGetUnit(false, TriggerEventParamName(libPVEM_gv_pvEEventIDNPCHeroSpawn_C, libPVEM_gv_pvEEventParamNPCHeroSpawnHeroUnit_C))

# mods/heroesdata.stormmod

GameDataHelperLib.galaxy

// L477
DataTableGetUnit(false, TriggerEventParamName(libGDHL_gv_eventID_AbathurUltimateEvolutionEnded_C, libGDHL_gv_eventParam_AbathurUltimateEvolution_ClonedUnit_C))
// L530
DataTableGetUnit(false, TriggerEventParamName(libGDHL_gv_eventID_AbathurSymbiote_C, libGDHL_gv_eventParam_AbathurSymbiote_SymbioteUnit_C))
// L536
DataTableGetUnit(false, TriggerEventParamName(libGDHL_gv_eventID_AbathurSymbiote_C, libGDHL_gv_eventParam_AbathurSymbiote_SymbioteTarget_C))

# mods/heroesdata.stormmod

GameLib.galaxy

// L3479
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_JungleDefenderAIDefenderKilled_C, libGame_gv_eventParam_JungleDefenderAIDefenderKilled_Unit_C))
// L3651
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_HeroParticipatedInCreepTakedown_C, libGame_gv_eventParam_HeroParticipatedInCreepTakedown_NPC_C))
// L3689
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_HeroExitedTransport_C, libGame_gv_eventParam_HeroExitedTransport_Transport_C))
// L3716
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_HeroEnteredTransport_C, libGame_gv_eventParam_HeroEnteredTransport_Transport_C))
// L3722
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_HeroEnteredTransport_C, libGame_gv_eventParam_HeroEnteredTransport_CargoUnit_C))
// L3793
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_HeroPortedBackToTown_C, libGame_gv_eventParam_HeroPortedBackToTown_Unit_C))
// L3819
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_HeroParticipatedInNPCTakedown_C, libGame_gv_eventParam_HeroParticipatedInNPCTakedown_NPC_C))
// L3845
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_HeroWitnessedAlliedNPCDeath_C, libGame_gv_eventParam_HeroWitnessedAlliedNPCDeath_NPC_C))
// L3871
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_SpecialCaseUnitParticipatedInNPCTakedown_C, libGame_gv_eventParam_SpecialCaseUnitParticipatedInNPCTakedown_NPC_C))
// L3919
DataTableGetUnit(false, TriggerEventParamName(libGame_gv_eventID_HeroParticipatedInTakedown_C, libGame_gv_eventParam_HeroParticipatedInTakedown_HeroKilled_C))

# mods/heroesdata.stormmod

HeroesLib.galaxy

// L3397
DataTableGetUnit(true, libCore_gf__UnitDataName(libCore_ge__UnitDataType_Unit, lp_unit, lp_index))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L5933
DataTableGetUnit(false, TriggerEventParamName(EventGenericName(), "EventHero"))
// L5951
DataTableGetUnit(false, TriggerEventParamName(EventGenericName(), "EventStructure"))
// L6342
DataTableGetUnit(false, TriggerEventParamName(EventGenericName(), "ZeratulEventUnit"))
// L6345
DataTableGetUnit(false, TriggerEventParamName(EventGenericName(), "ZeratulEventArtifactUnit"))
// L6349
DataTableGetUnit(false, TriggerEventParamName(EventGenericName(), "ZeratulEventUnit"))
// L32613
DataTableGetUnit(false, TriggerEventParamName(("ZeratulEvent_ProphecyCastStart"), "ZeratulEventUnit"))