elec 1 Posted May 14, 2013 elec's HeadLessClient Auto Detection Switch Hi there, i wrote a script to auto-detect a headlessclient and let the mission be able to choose it to spawn units or do script stuff on it. Basically it's just a "auto" switch that ask if a HC is connected. If so, your scripts - like upsmon or whatever - will execute on it. If not the scripts will run on the server like normal. The thing is, you don't have to be change your "if (!isServer) exitWith{};" every time you build a headlessclient mission local to test it. Also if you want to build a mission that should be able to spawn your units on a headless client but it should be also run if no headless client is available or something like that. I have build a example mission to test out the proper working of the script. You can spawn units whit a radio trigger and check in the sidechat where they running. Also i have implemented a switch that you can force HC or Server execution if you need Copy "elec_HC_detect.sqf" into your mission folder and add this code in the !! FIRST !! line of your init.sqf: elec_HC_detect = ["auto"] execVM "elec_HC_detect.sqf"; waitUntil {scriptDone elec_HC_detect}; // ========SWITCH======== // Use "auto" to autodetect if a headless client is connected and force execution on it. // Use "on" to force the execution of your scripts on the HC, even he is not connected to the server. // (so your scripts won't execute if no HC is connected to the server) // Use "off" to force server execution. // Replace your if(!isserver)exitWith{}; // line with if(elec_stop_exec == 1) exitWith{}; // in your scripts, that you want to execute over the switch. If you have any question just use this thread to ask. :) --- DOWNLOAD elec's HeadLessClient Auto Detection Switch --- Share this post Link to post Share on other sites
Guest Posted May 20, 2013 Thank you for informing us about the release :cool: Release frontpaged on the Armaholic homepage. HeadLessClient Auto Detection Switch v1.0bArma 2: Operation Arrowhead Beta patch 101032 or higherHeadLessClient-Server setup (optional) Share this post Link to post Share on other sites
UGLY58 10 Posted May 20, 2013 Nice idea, Should make testing HC missions a little less painful. Share this post Link to post Share on other sites
pellejones 1 Posted October 4, 2013 I just tested this with ARMA 3, did a minor change to the debug script to make that one work. The rest worked like a charm! Thanks a million for this, this has saved me from headache. THANK YOOOU!!!11!!!11 SSG Loves you for this. Share this post Link to post Share on other sites
DaViSFiT 21 Posted October 28, 2013 Uh, can you upload the Arma3 version? :P Share this post Link to post Share on other sites
killshot 5 Posted December 19, 2013 (edited) This is the debug_hint.sqf working in Arma 3! //debug_hint.sqf to let you know that it works hint "debug!"; playerunits = 0; hcunits = 0; svunits = 0; PAPABEAR=[West,"HQ"]; while{true}do{ if(hasinterface) then { _unitss = {local _x} count allUnits; _jochen = "LOCALunits: "; _zeige = _jochen + str(_unitss); [-2, {player groupChat Format ["%1",_this];}, _zeige] call CBA_fnc_globalExecute; //[PAPABEAR,nil,rsideChat,_zeige] call RE; }; if(!hasinterface && !isServer) then { _unitss = {local _x}count allUnits; _jochen = "HEADLESSunits: "; _zeige = _jochen + str(_unitss); [-2, {player groupChat Format ["%1",_this];}, _zeige] call CBA_fnc_globalExecute; }; if(isServer) then { _unitss = {local _x}count allUnits; _jochen = "SERVERunits: "; _zeige = _jochen + str(_unitss); [-2, {player groupChat Format ["%1",_this];}, _zeige] call CBA_fnc_globalExecute; }; sleep 5; }; Thanks to Pellejones and numrollen! Edited December 19, 2013 by killshot Share this post Link to post Share on other sites
meatball 25 Posted January 25, 2014 Has anyone been able to get this to work fully with A3? I've found one problem. Have this as the first line of my init.sqf: elec_HC_detect = [] execVM "miscScripts\elec_HC_detect.sqf"; waitUntil {scriptDone elec_HC_detect}; Also have this as the top line of my "AI Spawning" scripts that are run at the end of of my init.sqf. if(elec_stop_exec == 1) exitWith{}; I'm getting the following results: 1) 'Server' / Game being hosted on a players machine, AI called in my scripts spawn correctly. 2) Dedicated Server with a Headless Client connected, AI called in my scripts spawn correctly. 3) Dedicated Server, no headless client connected. AI called in my scripts never spawn. Anyone run into anything similar, or have any ideas? Share this post Link to post Share on other sites
jandrews 116 Posted May 1, 2014 this is great. does it work for arma 3???? Share this post Link to post Share on other sites
jandrews 116 Posted May 2, 2014 does anyone know if this works completely with arma 3?? If so could you give me details? Share this post Link to post Share on other sites