Script Faction And Functions

  1. 6 years ago

    Hi All

    Anyone here know how i would get the active profiles count for the independent faction. I'm using the following script to count the profiles for balancing purposes but it wont count the independents...

    _profilesWest = count ([ALiVE_profileHandler, "getProfilesBySide", "WEST"] call ALIVE_fnc_profileHandler);
    _profilesEast = count ([ALiVE_profileHandler, "getProfilesBySide", "EAST"] call ALIVE_fnc_profileHandler);
    _profilesInd = count ([ALiVE_profileHandler, "getProfilesBySide", "INDEPENDENT"] call ALIVE_fnc_profileHandler);
    
    hint format ["Active Profiles \n West: %1 \n East: %2 \n Independent %3", _profilesWest, _profilesEast, _profilesInd];

    It works for EAST and WEST but i get the following error for independent...

    9:12:39 Error in expression <dent %3", _profilesWest, _profilesEast, _profilesInd];
    >
     9:12:39   Error position: <_profilesInd];
    >
     9:12:39   Error Undefined variable in expression: _profilesind
     9:12:39 File C:\Users\ic\Documents\Arma 3 - Other Profiles\Ian-C\missions\ALiVE_Lythium_NT.lythium\ProfileCount.sqf, line 5

    I have tried several abbreviations for independent like IND, INDE but with no success.

    Also while i'm here is there anywhere where i can find information about scripting functions related to ALiVE?

    TIA
    Ian

  2. Just a guess but have you tried GUER instead of INDEPENDENT?

    https://community.bistudio.com/wiki/side

    ALiVE scripting FAQ:
    http://alivemod.com/wiki/index.php/Script_Snippets

  3. Edited 6 years ago by SpyderBlack723

    Yes, GUER is what we use internally for the indep side

  4. Thanks guys

    I have changed the script as follows as it only seemed to work when testing from the editor, when on the dedicated server the script didn't work but the new script is working...

    	_profilesBySide = [ALiVE_profileHandler,"profilesBySide"] call ALIVE_fnc_hashGet;
    	_profilesBySide = _profilesBySide select 2;
     
    	_profileEAST = count (_profilesBySide select 0);
    	_profileWEST = count (_profilesBySide select 1);
    	_profileIND = count (_profilesBySide select 2);
    	_profileCIV = count (_profilesBySide select 3);
    	
    	hint format ["OPFOR: %1 \n BLUFOR: %2 \n IND: %3 \n CIVILIAN: %4", _profileEAST, _profileWEST, _profileIND, _profileCIV];

    As you can see i have included a Civilian count but i am unsure if this should work as I'm guessing that select 3 would be the correct element of the array or even if the Civilian count is performed by the function. Is there a correct way if any to count Civilian profiles?

    I'm working on an Asymmetric mission on the Lythium map and seem to be encountering really low levels of Civilian population hence the requirement to count Civilian profiles, especially as civilians play an important role in the asymmetric mission format.

  5. It won't work on dedicated servers because the profiles exist server-side and cannot be retrieved directly from the server.

 

or Sign Up to reply!