# 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.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:610

    libSwaC_gv_zS_CombatTimer = TimerCreate();
    TimerStart(libSwaC_gv_zS_CombatTimer, 86400.0, false, c_timeGame);
    UnitEventSetNullVariableInvalid(true);
    DialogControlHookupStandard(c_triggerControlTypePanel, "UIContainer/ConsoleUIContainer");
    libSwaC_gv_zS_MissionUIContainer = DialogControlLastCreated();

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:2517

    }

    UnitEventSetNullVariableInvalid(true);
    return true;
}

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:2517

    }

    UnitEventSetNullVariableInvalid(true);
    return true;
}

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:4365

    libVCMI_gv_pM_CombatTimer = TimerCreate();
    TimerStart(libVCMI_gv_pM_CombatTimer, 86400.0, false, c_timeGame);
    UnitEventSetNullVariableInvalid(true);
    DialogControlHookupStandard(c_triggerControlTypePanel, "UIContainer/ConsoleUIContainer");
    libVCUI_gv_pU_MissionUIContainer = DialogControlLastCreated();

mods/heroesbrawlmods/arenamodemods/arenamode.stormmodbase.stormdata/LibAREN.galaxy:95

    GameSetPauseable(false);
    SetScoreTimer(libGame_gv_gobalTimer);
    UnitEventSetNullVariableInvalid(true);
    TriggerExecute(libCore_gt_DEBUGInitializeDataMiningAndDebugOutput, true, false);
    TriggerExecute(libCore_gt_InitializeData, true, false);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/HeroesLib.galaxy:4807

    TimerStart(libGame_gv_gobalTimer, c_timerDurationInfinite, false, c_timeGame);
    SetScoreTimer(libGame_gv_gameTimer);
    UnitEventSetNullVariableInvalid(true);
    TriggerExecute(libCore_gt_DEBUGInitializeDataMiningAndDebugOutput, true, false);
    TriggerExecute(libCore_gt_InitializeData, true, false);

mods/missionpacks/campaigncommon.sc2modbase.sc2data/LibCMMI.galaxy:30

void libCMMI_gf_CM_Initialize () {
    // Implementation
    UnitEventSetNullVariableInvalid(true);
    libCMMI_gv_NM_CombatTimer = TimerCreate();
    TimerStart(libCMMI_gv_NM_CombatTimer, 86400.0, false, c_timeGame);

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

    libCOMI_gv_cM_CombatTimer = TimerCreate();
    TimerStart(libCOMI_gv_cM_CombatTimer, 86400.0, false, c_timeGame);
    UnitEventSetNullVariableInvalid(true);
    DialogControlHookupStandard(c_triggerControlTypePanel, "UIContainer/ConsoleUIContainer");
    libCOUI_gv_cU_MissionUIContainer = DialogControlLastCreated();

mods/voidprologue.sc2modbase.sc2data/LibA3DDD02B.galaxy:305

    libA3DDD02B_gv_pP_CombatTimer = TimerCreate();
    TimerStart(libA3DDD02B_gv_pP_CombatTimer, 86400.0, false, c_timeGame);
    UnitEventSetNullVariableInvalid(true);
    DialogControlHookupStandard(c_triggerControlTypePanel, "UIContainer/ConsoleUIContainer");
    libA3DDD02B_gv_pP_MissionUIContainer = DialogControlLastCreated();