# Change Empty Unit Variables In Events
Grammar — Change empty unit variables in events to be treated as option|Any Unit/No Unit
Flags —Native
|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
bool
<preset::UnitReferenceOption> — Option
Returns — void
native void UnitEventSetNullVariableInvalid(bool inVal);
# Related
Category: Unit / Basic
- Unit Show Kill Display —
void
— UnitShowKillDisplay - Unit Can Path To Point —
bool
— UnitPathableToPoint - Unit Can Path To Unit —
bool
— UnitPathableToUnit - Create Units With Default Facing —
void
— libNtve_gf_CreateUnitsWithDefaultFacing - Create Units With Point Facing —
void
— libNtve_gf_CreateUnitsAtPoint2 - Create Units Facing Angle —
unitgroup
— UnitCreate - Create Units Facing Point —
unitgroup
— libNtve_gf_UnitCreateFacingPoint - Last Created Unit —
unit
— UnitLastCreated - Last Created Units —
unitgroup
— UnitLastCreatedGroup - Original Caster Of Unit —
unit
— UnitGetOriginalCaster - Effect That Created Unit —
string
<gamelink::Effect> — UnitGetOriginalEffect - Replace Unit —
void
— libNtve_gf_ReplaceUnit - Last Replaced Unit —
unit
— libNtve_gf_LastReplacedUnit - Change Owner —
void
— UnitSetOwner - Unit Owner Changes —
void
— TriggerAddEventUnitChangeOwner - Old Unit Owner —
int
— EventUnitOwnerOld - New Unit Owner —
int
— EventUnitOwnerNew - Rescue Unit —
void
— libNtve_gf_RescueUnit - Rescue Unit Group —
void
— libNtve_gf_RescueUnit2 - Kill Unit —
void
— UnitKill - Revive Unit —
void
— UnitRevive - Remove Unit —
void
— UnitRemove - Owner Of Unit —
int
— UnitGetOwner - Unit Is Alive —
bool
— UnitIsAlive - Unit Is Valid —
bool
— UnitIsValid - Unit Group Is Dead —
bool
— libNtve_gf_UnitGroupIsDead - Move Unit Instantly —
void
— UnitSetPosition - Make Unit Face Angle —
void
— UnitSetFacing - Make Unit Face Point —
void
— libNtve_gf_MakeUnitFacePoint - Position Of Unit —
point
— UnitGetPosition - Goal Position Of Unit —
point
— UnitGetGoalPosition - Facing Angle Of Unit —
fixed
— UnitGetFacing - Pause/Unpause Unit —
void
— libNtve_gf_PauseUnit - Pause/Unpause All Units —
void
— UnitPauseAll - Sleep/WakeUp Unit —
void
— libNtve_gf_SleepUnit - Show/Hide Unit —
void
— libNtve_gf_ShowHideUnit - Share Vision of Unit —
void
— libNtve_gf_ShareVisionofUnit - Unit Is Paused —
bool
— libNtve_gf_UnitIsPaused - Unit Is Sleepiing —
bool
— libNtve_gf_UnitIsSleepiing - Unit Is Hidden —
bool
— libNtve_gf_UnitIsHidden - Unit Is Visible To Player —
bool
— libNtve_gf_UnitIsVisibleToPlayer - Set Unit Custom Value —
void
— UnitSetCustomValue - Custom Value Of Unit —
fixed
— UnitGetCustomValue - Unit Enters/Leaves Region —
void
— TriggerAddEventUnitRegion - Triggering Region —
region
— EventUnitRegion - Unit Enters/Leaves Point —
void
— TriggerAddEventUnitRangePoint - Unit Enters/Leaves Range Of Unit —
void
— TriggerAddEventUnitRange - Triggering Range Unit —
unit
— EventUnitRangeUnit - Unit In Region —
bool
— libNtve_gf_UnitInRegion - Triggering Unit —
unit
— EventUnit - Load Unit Model —
void
— UnitLoadModel - Unload Unit Model —
void
— UnitUnloadModel - Agent Of Player For Unit —
unit
— UnitAgent - Change Empty Unit Variables In Events —
void
— UnitEventSetNullVariableInvalid - Name of Unit —
text
— UnitGetName - Ideal Harvester Count —
int
— UnitIdealWorkerCount - Current Harvester Count —
int
— UnitCurrentWorkerCount
# Examples
campaigns/swarmstory.sc2campaign — base.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.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:2517
}
UnitEventSetNullVariableInvalid(true);
return true;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:2517
}
UnitEventSetNullVariableInvalid(true);
return true;
}
campaigns/voidstory.sc2campaign — base.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.stormmod — base.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.stormmod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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();