Jump to content
ViseVersa

[Beta] New Kind of Headless Client

Recommended Posts

So, recently I was just browsing trough forums and I read about Headless Clients and I was like phew that would be a nice thing to have man. So I went straight to the Downloads, gave them a few Tests and decided screw this. I've seen "ARMA 2" Headless Clients using event handlers, that are for arma3 - not even sure, if they actually work in arma2 and then it's a mess (no offence thou, but it was very hard to read trough all that). Well, what Solutions did I have? Making my own one and share it with the Community to improve it to an acceptable Standard.

 

The following Video (Sound might be loud) shows an Example of the Headless Client

 

Spoiler

 

 

So, what's so Special about this...

Well first of all this works on any Map. Also it works with any Loot Table. Also it works without the need of a player. It has it's own "independent Area" where it interacts in. What I mean with that is, that you won't need to rely on any Functions, as everything that is needed is included. All Variables and Functions work outside of the normal "dayz stuff", as only the Headless Client loads it and it won't overwrite anything. Also it comes with a few features available.

 

  • You can fully customize the spawn Ratio between Zombies spawned on Buildings and in Wilderness, for Example you could have 3x as many Zombies in cities
  • You can fully customize the Loot Tables or integrate your existing ones just by changing a variable
  • You can fully customize which modules to use, like animal spawn, wild zombie spawn, building zombie spawn, loot spawn and custom spawn.
  • You can customize which Animals to Spawn
  • You can make AI Shoot at the Zombies
  • You can shuffle the Loot by setting permaLoot to false, as the server clean up will then clean it up and the hc will just re-spawn it.
  • You can ofc set how many zombies / animals / loot piles should max be spawned

 

For a full List, of available Options see the variablesHC.sqf.

 

The Performance

While you have the ability to use all those variables, you can tweak the performance of this. However, the script will only be as good as the code and I'm not perfect. I tried my best to check every tiny bit to make sure nothing ever goes wrong, but there's always that slight possibility. Also I'm not perfect and this is my very first attempt, so if I did something wrong or could've done it better just let me know. Also be carefully, when changing the Script Timers, as a to low value might impact dramatically on your FPS.

 

The Design

This Client is not meant to Tackle the common Problem of a Headless Client joining to early, etc. It is meant to be persistent, reliable and functional. It more a "spawning handler" for various things like the loot. If you want a "perfect" Headless Client this is not the thing you're searching for. This is the Basement of a Script that is living from user Input, user Feedback and user advices. It wants further improving (if possible) and optimizing (if possible). Regardless of the fact, that it is fully Stable you can however do things wrong - I personally have only limited methods to test this Client, while you or other maybe have a large player base that is willing to tackle a new world of Zombies - so.. If you find any Bug or have any more wishes just let me know.

 

The Installation

Please prepare for everything, that you'll need:

  • An Editor of your choice (OK, this was obvious)
  • Your mission.sqm (Located in your MPMissions\DayZ_Epoch_%INSTANCE%.%MAP%
  • Your init.sqf (Located in your MPMissions\DayZ_Epoch_%INSTANCE%.%MAP%
  • Your config.cfg (Usually Located in a Folder called "instance_number_mapName")
  • The Headless Client itself (See also: GitHub - Headless Client)

 

IF you do NOT have a Headless Client Installed or failed to install it before:

Spoiler

Open your mission.sqm and Press CTRL + F. That will bring up the Search. Type in the Search Box "side="LOGIC". It will jump to a Class, you will want to change that class Number and add one to it. So if you found SIDE=LOGIC in "class Item1" you will want to change it to "class Item2".


Next paste the following Code ABOVE your renamed class.

Spoiler

		class Item2
		{
			side="CIV";
			class Vehicles
			{
				items=1;
				class Item0
				{
					position[]={10154.729,0.4931505,-4593.6821};
					azimut=-17.083944;
					id=52;
					side="CIV";
					vehicle="Survivor1_DZ";
					player="PLAY CDG";
					skill=0.60000002;
					text="HeadlessClient";
					init="this allowDamage false; this setVariable ['mmHC',true,true];";
					description="HeadlessClient";
					name="HeadlessClient";
					forceHeadlessClient=1;
				};
			};
		};

 

Before you continue, check that the class name from the code that you just copied is correct. In most cases you will have to change it to "class Item1".

Once you checked everything (Did you check everything?) press CTRL + F again and search for "class Groups". It will take you to the class, where you then can locate a single Line saying "items = 2". Change this to "items = 3". NOTE: It doesn't necessary has to be items 2 for you, if you already added something else before! 


To fully isolate the HC from the rest of your files you will have to change quite a few bits and pieces in the init.sqf. Near the Middle you will see a few calls like:

call compile preprocessFileLineNumbers "init\variables.sqf";

These Lines we're going to wrap in an IF. For me the whole thing looks like:

//Load in compiled functions
if (isServer || hasInterface) then {
	call compile preprocessFileLineNumbers "init\variables.sqf";				//Initilize the Variables (IMPORTANT: Must happen very early)
};

//progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "init\publicEH.sqf";				//Initilize the publicVariable event handlers

if (isServer || hasInterface) then {
	//progressLoadingScreen 0.2;
	call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";	//Functions used by CLIENT for medical
	//progressLoadingScreen 0.4;
	call compile preprocessFileLineNumbers "init\compiles.sqf";				//Compile regular functions
	//progressLoadingScreen 0.5;
	call compile preprocessFileLineNumbers "custom\scripts\rightclick\init.sqf";
};

You can put the "publicEH" in there to, that's totally fine, I only have it outside because I was doing something else with that to.

 

Underneath those calls we start our Headless Client:

if (!hasInterface && !isDedicated) then {
	//run on headless clients only
	
	call compile preprocessFileLineNumbers "headlessclient\variablesHC.sqf";
	
	call compile preprocessFileLineNumbers "headlessclient\compilesHC.sqf";
};

 

The next Part is finding

if (!isDedicated) then {

And replacing it with

if (!isDedicated && hasInterface) then {

 

 

The Last Bit is Optional, if you have Scripts that run on both server and client. You decide whether or not to Load them on the Headless Client, but I recommend not to. So you will want to put the bottom parts inside an IF again, for Example:

if (isServer || hasInterface) then {

	execVM "custom\scripts\weather\DynamicWeatherEffects.sqf";

	[7,true,true,15] execFSM "custom\fsm\core_time.fsm";
	
	#include "\z\addons\dayz_code\system\BIS_Effects\init.sqf"
	
};

 

 

IF you do have a Headless Client installed or managed to do so before:

Spoiler

Add This to your init.sqf

if (!hasInterface && !isDedicated) then {
	//run on headless clients only
	
	call compile preprocessFileLineNumbers "headlessclient\variablesHC.sqf";
	
	call compile preprocessFileLineNumbers "headlessclient\compilesHC.sqf";
};

 

 

The Last Step is simply to create a Folder inside your Mission named "headlessclient" (You can ofc define your own paths) and put all the HC Files into that Folder. Edit the Variables if you want to or just hop right into game and start the massacre!

 

PS: If I was unclear with the Instructions at any point let me know.

 

 

//EDIT:

Just out of interest I forced the HC to join the wrong slot, to see what happens. Apparently it can be in any slot, it doesn't differ ^^

 

Spoiler

 

 

 

 

//Edit
Apparently some files on Github got broken during the Upload, they have meanwhile been replaced.

Share this post


Link to post
Share on other sites
1 hour ago, J001 said:

noob question, how do you login as a client to the dedicated server.

Well a headless client is basically a "virtual player" who`s screen is black. In order to play the game you have to actually start it. You could do that with a batch file, so here is mine for example:

Save as "name.bat"

@echo off
start "HeadlessClient" /MIN /HIGH /B "E:\SteamGames\steamapps\common\Arma 2 Operation Arrowhead\ArmA2OA_BE.exe" 0 0 -skipIntro -nosplash -showScriptErrors -noPause -client -connect=127.0.0.1 -port=2302 -nosound "-mod=E:\SteamGames\steamapps\common\Arma 2 Operation Arrowhead\EXPANSION;E:\SteamGames\steamapps\common\Arma 2 Operation Arrowhead\@DayZ_Epoch1051" -cpuCount=2 -name=HeadlessClient -profiles=HeadlessClient

 

The main Important things are "-client" and "-connect"

 

//Edit:
You could also you a c++ Library to start the HC whenever somebody connects.

Share this post


Link to post
Share on other sites

ViseVersa

Thank your for your reply, i just tested it. and i had this message "signature timeout" by battleye and You were kicked off the game., any info how to solve this

 

Share this post


Link to post
Share on other sites
3 minutes ago, J001 said:

ViseVersa

Thank your for your reply, i just tested it. and i had this message "signature timeout" by battleye and You were kicked off the game., any info how to solve this

 

You might want to validate your client files trough steam and also make sure, that you've started the game at least once.

If you've done those steps and it didn't help you still have to option to turn signature checks out in your config.cfg by changing "verifySignatures" to 0.

Share this post


Link to post
Share on other sites

Ok, thanks ViseVersa, i changed verifysignatures to 0 and now its loading.

One more question, is it possible as you in the video, to login as a HC player to that CIV slot?

 

 

Share this post


Link to post
Share on other sites
15 hours ago, J001 said:

Ok, thanks ViseVersa, i changed verifysignatures to 0 and now its loading.

One more question, is it possible as you in the video, to login as a HC player to that CIV slot?

 

In the Video I've logged in as normal Player. It's the headless Client, that joined the Civil Slot. The HC was started from a c++ library in that Video, which is why it started automatically. Originally somebody wanted to give me Money for that Library, which is why it's not included, because it would've been unfair to let somebody pay for it while everybody else get's it for free.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Kovicson
      Hey guys, I was looking through my RPT for the server and seen this
      I have no idea what it is... but infistar seems to not like it.
      Any ideas?
      Thank you
      18:39:58 "<infiSTAR.de> CONNECTLOG: CONNECT - Bob Stookee(PLAYER ID)" 18:39:58 "<infiSTAR.de> KickLog: SERVER kicked Bob Stookee(PLAYER ID) - TempBanned" 18:40:03 "INFO - Player: PID#16(Bob Stookee)(UID:PLAYER ID/CID:141) Status: LOGGING IN" 18:40:04 "INFO - Player: PID#16(Bob Stookee)(UID:PLAYER ID/CID:141) Status: LOGIN PUBLISHING, Location factory [132079]" 18:40:10 "<infiSTAR.de> BAN: Bob Stookee (PLAYER ID) | BadFile: blah.sqf - #line 1 "blah.sqf" player addWeapon "M16A2"; player addMagazine "20Rnd_556x45_Stanag"; " 18:40:10 "<infiSTAR.de> BAN: Bob Stookee (PLAYER ID) | BadFile: blah.sqf - #line 1 "blah.sqf" player addWeapon "M16A2"; player addMagazine "20Rnd_556x45_Stanag"; " 18:40:10 "<infiSTAR.de> KickLog: SERVER kicked Bob Stookee(PLAYER ID) - Bob Stookee (PLAYER ID) | BadFile: blah.sqf - #line 1 "blah.sqf" player addWeapon "M16A2"; player addMagazine "20Rnd_556x45_Stanag"; " 18:40:10 "["PVAHR_0_p8c4d7f43821237871843",["Bob Stookee","PLAYER ID","BAN",[66,97,100,70,105,108,101,58,32,98,108,97,104,46,115,113,102,32,45,32,35,108,105,110,101,32,49,32,34,98,108,97,104,46,115,113,102,34,10,112,108,97,121,101,114,32,97,100,100,87,101,97,112,111,110,32,34,77,49,54,65,50,34,59,32,10,112,108,97,121,101,114,32,97,100,100,77,97,103,97,122,105,110,101,32,34,50,48,82,110,100,95,53,53,54,120,52,53,95,83,116,97,110,97,103,34,59,32]]]" 18:40:10 "Player UID#PLAYER ID CID#141 PID#16(Bob Stookee) as Survivor2_DZ died at Wilderness [813895]" 18:40:10 "DeathMessage: Bob Stookee died from blood loss." 18:40:16 "<infiSTAR.de> KickLog: SERVER kicked Bob Stookee(PLAYER ID) - TempBanned" 18:40:20 "<infiSTAR.de> CONNECTLOG: DISCONNECT - Bob Stookee(PLAYER ID)" 18:40:20 "INFO: OnPlayerDisconnect exiting. Player is near respawn_west. This is normal after death. [PLAYER ID","Bob Stookee"]" 18:40:20 Client: Remote object 16:4 not found 18:40:21 Client: Object 6:425 (type Type_149) not found. 18:40:21 Client: Object 10:552 (type Type_149) not found. 18:40:21 Client: Object 17:11 (type Type_149) not found. 18:42:22 Server: Object 6:444 not found (message 70) 18:42:22 Server: Object 6:443 not found (message 89) 18:42:24 Server: Object 10:672 not found (message 70) 18:42:24 Server: Object 6:445 not found (message 94) 18:42:28 Server: Object 6:408 not found (message 221) 18:42:30 "<infiSTAR.de> CONNECTLOG: CONNECT - Bob Stookee(PLAYER ID)" 18:42:30 "<infiSTAR.de> KickLog: SERVER kicked Bob Stookee(PLAYER ID) - TempBanned"  
    • By VATwitch
      THIS ISSUE HAS BEEN SOLVED! FIX IS BELOW!
      If you are using SurvivalServers, or any other server host that allows HTTP server pbo upload, DON'T USE IT! It doesn't save your changes to your server PBO regardless if the server is offline!
       
      I simply uploaded my PBO's to the FTP and it fixed it.
       
       
       
       
      I've followed the directions to the T, and I added my filters to the BE script.txt as well. I can't figure this out, could someone help me?
       
      Client.rpt:
       
       
      Scripts.txt:
       
       
       
      Server RPT:
       
       
       
       
      Screenshots:
       


    • By UGRexie
      Dayz epoch server 
      Name: Dayz Epoch Tavi -missions-Hardcore-unitedgamers   Connection Info: 193.111.186.225:2302 Map  - Taviana
      List of mods in sever , 
      -Single Coin Currency
      Plot For Life
      Plot Management
      Group Management
      Lift & Tow
      Service points
      Custom start gear
      No weight limit
      Slow zombies
      1 Step build
      Andre Convoys
      Para Spawn
      DZAI 
      Wai Missions
      DZMS Missions
       
      -Our Server is Hardcore ,
      -if you has a idea for a mod ask a admin , 
       
       
      -Server Restart every 4 hours 
      -Admin Teamspeak support, 
        ts- ts3.unitedgamers.eu
      Server Admin - Ask in ts for them if needed,
       [UG]Chieff,[UG]Rexie
    • By Dzhabrailov
      Hello! who can make Headless Client for epoch1062 to order? Or I'm not at the address :(
    • By Nytrex
      Hello there!
      Not my first work, but also not the best!
      I'm just starting a own server, and adding a bit of customstuff for the future players.
      I wanted to share that stuff with you, so you can use it aswell, if you going to like it.
      Screenshots at the end Quote
      Tested on a ARMA 2 DAYZ Epoch server - 1.0.6.1
      I also changed the important "Map_" classnames to "Land_" so there will be loot in all the barracks, and the Super market :)
      Download: http://www.mediafire.com/file/b2winspp45saavs/balota.sqf
      1. Create folder for all your buildings in your dayz_server.pbo // Skip this if you already got one!
      2. Put the downloaded balota.sqf in this folder" 
      3. Go to your dayz_server.pbo again, head to the "init" folder, and add at the bottom from server_functions.sqf this:
       
      4. Repack your dayz_server-pbo, upload it again - There you go! 
       
      Screenshots:
       
      If youre are interested in the server, take look here: Community Server by Impact eSport
      Thanks for tuning in! If you find any bugs, just let me know them!
  • Advertisement
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×