# Set State Of Unit Filter

Grammar — Set type units to be state in filter|Unit Filter
FlagsNative | Action

Sets a state on the specified unit filter.

# Arguments

Returns — void

native void UnitFilterSetState(
	unitfilter inFilter,
	int inType,
	int inState,
);

Category: Unit / Filters

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:5715

                else {
                }
                UnitFilterSetState(lv_unitFilter, lv_filterType, lv_filterState);
            }

mods/core.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:4865

                else {
                }
                UnitFilterSetState(lv_unitFilter, lv_filterType, lv_filterState);
            }

mods/starcoop/starcoop.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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)