# Change Empty Unit Variables In Events

Grammar — Change empty unit variables in events to be treated as option|Any Unit/No Unit
FlagsNative | Action

When unit events refer to a unit variable, this option determines how empty values are treated. By default, empty unit variables are considered “any unit”, and the event will fire for all units. This can be changed to “no unit”, and the event will never fire if the variable is empty.

# Arguments

Returns — void

native void UnitEventSetNullVariableInvalid(bool inVal);

Category: Unit / Basic

# Examples

# campaigns/swarmstory.sc2campaign

SwarmCampaignLib.galaxy

// L610
UnitEventSetNullVariableInvalid(true)

# campaigns/void.sc2campaign

MapScript.galaxy

// L2517
UnitEventSetNullVariableInvalid(true)
// L2517
UnitEventSetNullVariableInvalid(true)

# campaigns/voidstory.sc2campaign

VoidCampaignMissionLib.galaxy

// L4365
UnitEventSetNullVariableInvalid(true)

# mods/heroesbrawlmods/arenamodemods/arenamode.stormmod

LibAREN.galaxy

// L95
UnitEventSetNullVariableInvalid(true)

# mods/heroesdata.stormmod

HeroesLib.galaxy

// L4807
UnitEventSetNullVariableInvalid(true)

# mods/missionpacks/campaigncommon.sc2mod

LibCMMI.galaxy

// L30
UnitEventSetNullVariableInvalid(true)

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L12300
UnitEventSetNullVariableInvalid(true)

# mods/voidprologue.sc2mod

LibA3DDD02B.galaxy

// L305
UnitEventSetNullVariableInvalid(true)