Blacklist Profiler Via Classname

  1. 5 years ago

    I want to run a scripted function to profile all non-profiled units on the map, but need to prevent it from profiling certain things via classname. Is there a way to do this?

    Here is the script (pulled from the wiki)

    if (isServer) then {
        [] spawn {
            while {true} do {
                sleep 60;
                [] call ALiVE_fnc_createProfilesFromUnitsRuntime;
            };
        };
    };
  2. Yes and no, the script has an internal blacklist that you can't change from the outside. Your best bet is to copy the script and modify those blacklist(s) and call your version instead.

  3. Edited 5 years ago by marceldev89

    Or you can do something along the lines of this:

    private _unitBlacklist = ["SOME_CLASS", "ANOTHER_CLASS"];
    private _vehicleBlacklist = ["SOME_CLASS", "ANOTHER_CLASS"];
    
    private _excludeGroups = [];
    private _excludeVehicles = [];
    
    {
        private _group = _x;
    
        {
            private _unit = _x;
    
            if (typeOf _unit in _unitBlacklist) exitWith {
                _excludeGroups pushBack _group;
            };
        } forEach (units _group);
    } forEach allGroups;
    
    {
        private _vehicle = _x;
    
        if (typeOf _vehicle in _vehicleBlacklist) then {
            _excludeVehicles pushBack _vehicle;
        }
    } forEach vehicles;
    
    private _groups = allGroups - _excludeGroups;
    private _vehicles = vehicles - _excludeVehicles;
    
    [false, _groups, _vehicles] call ALIVE_fnc_createProfilesFromUnitsRuntime;

    Should put you in the right direction. :)

  4. Thanks! I'll give this a try. o7

 

or Sign Up to reply!