# Set State Of Unit Filter
Grammar — Set type units to be state in filter|Unit Filter
Flags —Native
|Action
Sets a state on the specified unit filter.
# Arguments
unitfilter
— Filterint
<preset::UnitFilterType> — Typeint
<preset::UnitFilterState> — State
Returns — void
native void UnitFilterSetState(
unitfilter inFilter,
int inType,
int inState,
);
# Related
Category: Unit / Filters
- Unit Filter Match —
bool
— UnitFilterMatch - Set State Of Unit Filter —
void
— UnitFilterSetState - State Of Unit Filter —
int
<preset::UnitFilterState> — UnitFilterGetState - Convert Target Filter String To Unit Filter —
unitfilter
— libNtve_gf_ConvertTargetFilterStringToUnitFilter
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/NativeLib.galaxy:5715
else {
}
UnitFilterSetState(lv_unitFilter, lv_filterType, lv_filterState);
}
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:67
// Setup a friendly filter
filterUnit = UnitFilter(0,0,0,0);
UnitFilterSetState(filterUnit, c_targetFilterUncommandable, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterWorker, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterUnderConstruction, c_unitFilterExcluded);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:68
filterUnit = UnitFilter(0,0,0,0);
UnitFilterSetState(filterUnit, c_targetFilterUncommandable, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterWorker, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterUnderConstruction, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterStructure, c_unitFilterExcluded);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:69
UnitFilterSetState(filterUnit, c_targetFilterUncommandable, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterWorker, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterUnderConstruction, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterStructure, c_unitFilterExcluded);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:70
UnitFilterSetState(filterUnit, c_targetFilterWorker, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterUnderConstruction, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterStructure, c_unitFilterExcluded);
// *** Scan the area for the following, set priority unit when found *** (highest first)
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:230
// grab psi units
filterUnit = UnitFilter(0,0,0,0);
UnitFilterSetState(filterUnit, c_targetFilterPsionic, c_unitFilterRequired);
psiGroup = UnitGroupFilter(null, c_playerAny, targetGroup, filterUnit, 0);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:235
// remove the psi units we grabbed
filterUnit = UnitFilter(0,0,0,0);
UnitFilterSetState(filterUnit, c_targetFilterPsionic, c_unitFilterExcluded);
targetGroup = UnitGroupFilter(null, c_playerAny, targetGroup, filterUnit, 0);
mods/core.stormmod — base.stormdata/TriggerLibs/NativeLib.galaxy:4865
else {
}
UnitFilterSetState(lv_unitFilter, lv_filterType, lv_filterState);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:68
// Setup a friendly filter
filterUnit = UnitFilter(0,0,0,0);
UnitFilterSetState(filterUnit, c_targetFilterUncommandable, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterWorker, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterUnderConstruction, c_unitFilterExcluded);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:69
filterUnit = UnitFilter(0,0,0,0);
UnitFilterSetState(filterUnit, c_targetFilterUncommandable, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterWorker, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterUnderConstruction, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterStructure, c_unitFilterExcluded);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:70
UnitFilterSetState(filterUnit, c_targetFilterUncommandable, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterWorker, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterUnderConstruction, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterStructure, c_unitFilterExcluded);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:71
UnitFilterSetState(filterUnit, c_targetFilterWorker, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterUnderConstruction, c_unitFilterExcluded);
UnitFilterSetState(filterUnit, c_targetFilterStructure, c_unitFilterExcluded);
// *** Scan the area for the following, set priority unit when found *** (highest first)