coolfact 10 Posted March 26, 2015 I'm trying to play around with the new "setGroupOwner" command, have taken Mons00n's "MoveToHC" script in his HC guide. I can transfer groups to HC just fine, but when I want the the FPS from the HC (called in fnc_sim) I get "ANY", indicating that it's not running as intended. Another problem I keep bumping into is when the HC DC and reconnect to the server (retaking the HC spot and join the mission) the script would not allocate the AI like it did before DC. Any help or pointers would be appreciated. HC_init.sqf: /* * Purpose: Move a groups to the headless client * AFTER the mission launches * * Mission: Arma3 Headless Client Tutorial * Author: Monsoon * Email: rweezera@hotmail.com * * edited: Coolfact * */ if(!isServer) exitWith{}; //only execute on the server if(!isMultiplayer) exitWith{}; //only execute in a MP environment fnc_sim = { _grp = _this select 0; { _x enableSimulation false; } foreach units _grp; VAR_FPS_HC = diag_fps; publicvariableserver "VAR_FPS_HC"; }; _HC = HC1; _HCid = owner _HC; _grps = []; VAR_FPS_HC = 50; if(isNull _HC) exitwith{}; // If HC not available exit // Main AI Distributor while {true} do { { _grp = _x; if(VAR_FPS_HC < 30) then { // Don't transfer if HC FPS are lower than 30 if(_grp setGroupOwner _HCid) then{ _grps = _grps + [_grp]; [[_grp],"fnc_sim",_HCid] call BIS_fnc_MP; // Disable PhysX and get HC FPS } else { _grps = _grps - [_grp]; }; }; sleep 2; } foreach allgroups; diag_log format["HC: Successfully transfered %1 groups to (id:%3) with FPS: %2",count _grps,VAR_FPS_HC,_HCid]; sleep 10; }; diag_log format["HC: Headless client NOT present, keeping %1 on the server.",_HCid]; Share this post Link to post Share on other sites
R3vo 2652 Posted March 28, 2015 I would try to completely exit the script when HC1 disconnects, and restart it, when it reconnects. if (isNull HC1) then {false}; You could also try to add an eventHandler to HC1 which will trigger the exit of the script when it disconnects. https://community.bistudio.com/wiki/BIS_fnc_addStackedEventHandler Share this post Link to post Share on other sites
coolfact 10 Posted March 28, 2015 That gave me an idea to fix the rejoin HC, thanks R3vo Share this post Link to post Share on other sites