Auto Pause ALiVE Modules with Headlessclient

  1. 4 years ago
    Edited 4 years ago by RagcBaker

    Hy ALiVE Team.

    I have some questions about Pause Module with Headless Client Configuration
    I do the thing in the following post. But it seems not working.
    http://alivemod.com/forum/4862-auto-pause-feature-clafghan

    initServer.sqf

    ["someId", "onPlayerConnected", {
    	if (({isPlayer _x} count playableUnits) > 0 || OPCOM_TOGGLE) then { ["ALIVE_SYS_PROFILE","ALIVE_MIL_OPCOM","ALIVE_AMB_CIV_POPULATION"] call ALiVE_fnc_unPauseModule; OPCOM_TOGGLE = false; };
    }] call BIS_fnc_addStackedEventHandler;
     
    ["someId", "onPlayerDisconnected", {
    	if ( ({isPlayer _x} count playableUnits) == 0 ) then { ["ALIVE_SYS_PROFILE","ALIVE_MIL_OPCOM","ALIVE_AMB_CIV_POPULATION"] call ALiVE_fnc_pauseModule; OPCOM_TOGGLE = true; };
    }] call BIS_fnc_addStackedEventHandler;

    The problem is that the server is not stopping increase Memory or CPU usage. In editor a game logic headless is placed and named. In the ALiVE Module "auto pause" option is set. Can someone tell me what i´m doing wrong in the setup or configuration?

    Thanks in advanced
    Baker

  2. Edited 4 years ago by RagcBaker

    We use Vcom AI also.
    maybe this can be a part of the problem.

    I tried now without VcomAI but the problem still be the same.

  3. I have tried different thing now. But nothing seems to work.

    - paste the following into init.sqf

    ["ALIVE_MIL_OPCOM","ALIVE_MIL_OPCOM","ALIVE_CIV_OPCOM","ALIVE_AMB_CIV_POPULATION"] call ALiVE_fnc_PauseModule;
    • Uncheck Autopause in ALiVE Module
    • place a trigger and sync Commander Modules to it
    • create the initServer.sqf with the code above

    Nothing happens, modules work as before. Did someone have an idea or help for me?

    in Module "LOGIC_ALIVE" set "AI Distribution" to Headless Clients
    Headless Client is configured in init.sqf as followed

    if (!hasInterface && !isDedicated) then {	
    headlessClients = [];							
    headlessClients set [(count headlessClients), player];		
    publicVariable "headlessClients";						
    isHC = true;									
    };	
  4. Edited 4 years ago by JD_Wang

    We have this issue as well, I believe it's because the autopause script uses count playableUnits to check if the server is empty and the HC counts as a playable unit.

    I did suggest it get changed to allPlayers - entities "HeadlessClient_F"; in Discord, but never got around to raising an issue on github. I'll do that now and hopefully I'm right and it's a fairly simple fix.

    https://github.com/ALiVEOS/ALiVE.OS/issues/668

  5. Thanks JD_Wang

    we also tried to use 1 instead of 0 in the count of playable Units. But the same problem. Maybe someone can write a short tutorial how to set this up correct for a mission. An example initServer.sqf or and other needed files like init.sqf or description.ext

  6. There is this snippet in the wiki which may work if you change it to accommodate HC's.

    The change I suggested above should work I think, something I should test at some stage.

  7. After some further testings, i found out that the increase of memory are from the Air Commander Module. I removed the Air Commanders in my Mission. The memory stops increase.

    I will now check the modules pause configuration.

  8. Do you have any updates on that?
    Auto Pause still not working at the moment. Is there a way to handle this with triggers?

  9. Do you have any updates on that?
    Auto Pause still not working at the moment. Is there a way to handle this with triggers?

 

or Sign Up to reply!