Jump to content
LancerSolurus

Survivor Companions

Recommended Posts

I have been working on companions for the players in the Dayz & Epoch mods. Had a few in Fallout, made me want them on DayZ as well. It is nearly working perfectly, survivors can be be recruited and once recruited can not be taken over by another player. They will kill zeds and bandits. All spawning of the survivors is server side so they will be available even when the first player logs in. Currently they aren't saved to the database so all will be available to players at every restart. I may add purchasable AI in a later update but this version is to simply to get them working properly. 

 

Looking for some feedback as to what you would want from them. Remember these are regular DayZ AI so that limits it to what they can do by default. Once you recruit them you can use (~,Alt ~, Backspace & numpad .) to control them.

 

Now for the release of this addon Version 0.1

DB Groups for Epoch by Digital Brilliance Software
All of these instructions are for Epoch 1.0.3.1 only
 
**************************************************************************************************************************************************************
You will find the dbgroups folder in the the same folder you opened this file in.
 
Copy 'dbgroups' to your MPMissions\Dayz_Epoch_version.map folder, mine is DayZ_Epoch_17.Chernarus
 
Edits to your init.sqf
 
above this line
startLoadingScreen ["","RscDisplayLoadCustom"];
 
add this
DBGroupsStarted = false;
DBMaxSurvivors = 50; // change this to the number of survivors you want, the more you add the lower your server and client FPS
 
In this section before the };, this is to initialize the public variables...
if (isServer) then {
 
add this
DBPV_SrvrUnits = [];
publicVariable "DBPV_SrvrUnits";
DBCurSurvivors = 0;
publicVariable "DBCurSurvivors";
DBSGroups = false;
publicVariable "DBSGroups";
DBUpdClient = false;
publicVariable "DBUpdClient";
 
And then after the }; add this so the server and client initialize it properly (between }; and if (!isDedicated) then {)
 
[] execVM "dbgroups\init.sqf";
 
In this section before the };
if (!isDedicated) then {
 
add this
[] execVM "dbgroups\scripts\scp_srvractions.sqf";
[] execVM "dbgroups\scripts\scp_adjustrating.sqf";
DBUpdClient = true; // update survivor variables
publicVariable "DBUpdClient";
 
Now if you want the zeds to be killed by the survivors you will need to create a custom zombie_generate.sqf file and
add a single line to it near the very end of the script, there are plenty of examples of how to edit your compiles script to point to a new file
This is the compiles.sqf line you need to make point to your new file
zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf";
 
At the bottom of zombie_generate.sqf right above
//Start behavior
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
 
add this
_agent addRating -1000000;
 
Thats it, enjoy your new companions
 
Lancer Solurus
http://www.galaxyempire.com/
 
Add this to mission.sqm, needed for spawning, adjust the numbers if you already have additional markers
class Item18
{
position[]={8319.0,6.0942454,12763.0};
name="S1";
type="mil_box";
colorName="ColorBrown";
};
class Item19
{
position[]={1000.0,5.8799777,2860.0};
name="S2";
type="mil_box";
colorName="ColorBrown";
};
class Item20
{
position[]={4400.0,6.1736083,3960.0};
name="S3";
type="mil_box";
colorName="ColorBrown";
};
class Item21
{
position[]={6500.0,6,4660.0};
name="S4";
type="mil_box";
colorName="ColorBrown";
};
class Item22
{
position[]={8400.0,6.0013299,6660.0};
name="S5";
type="mil_box";
colorName="ColorBrown";
};
class Item23
{
position[]={10400.0,5.8035483,8860.0};
name="S6";
type="mil_box";
colorName="ColorBrown";
};
class Item24
{
position[]={10700.0,6.0,10860.0};
name="S7";
type="mil_box";
colorName="ColorBrown";
};
class Item25
{
position[]={12900.0,5.66116,10160.0};
name="S8";
type="mil_box";
colorName="ColorBrown";
};
class Item26
{
position[]={12300.0,5.990002,12560.0};
name="S9";
type="mil_box";
colorName="ColorBrown";
};
class Item27
{
position[]={4900.0,5.9533463,9960.0};
name="S10";
type="mil_box";
colorName="ColorBrown";
};
class Item28
{
position[]={1600.0,2.34526,7860.0};
name="S11";
type="mil_box";
colorName="ColorBrown";
};
class Item29
{
position[]={2700.0,5.99689,5460.0};
name="S12";
type="mil_box";
colorName="ColorBrown";
};
 
Make sure your item count is correct, mine is
class Markers
{
items=30;
 
You can change the type to "empty" if you don't wan't it to show on the map.
 
Download it from here
 
Additional notes...
************************************************************************************************************************
Sukkaed

For battleye kicks add these in first line of publicvariable.txt

!"DBUpdClient" !"DBPV_PubUnit"
 

fr1nk

type fix for hiding markers

Share this post


Link to post
Share on other sites

Won't be much longer, got most of the stuff working that I wanted in it. Seems to working good even for JIP players. They certainly hate the AI (custom WAI system) and zeds equally. It will require a few additions to the init.sqf and also to the zombie_generate.sqf (to make zeds change to enemy mode).

Share this post


Link to post
Share on other sites

Interesting indeed. I have option to spawn AI bodyguard for yourself with 1 briefcase. Problems are that these bodyguards are not saved to database, so they are gone after restart and they won't get inside vehicles. Also they shoot everything that moves, except the owner. It would be good feature to make it so that everyone you have tagged friendly would be safe. These AI's can also be very dumb. They will shoot 10 mags straight to wall if there is zombie behind it :)

Share this post


Link to post
Share on other sites

Well they were shooting into walls before I moved the spawning to server-side. They do still sometimes try to shoot through vehicles so it's usually a good idea to make the vehicle point away from the enemy then drive forward a little bit before getting out. You also have the option to have them cease fire. Since they have unlimited ammo doesn't matter how many shots they fire, they won't run out. BTW the only people not safe are bandits, I put in the comment's of the ranking adjustment file on how to make it so all are safe, unless they accidentally shot one of their companions, they don't like that at all. Currently it is set to the player's humanity, mine is currently at 108,563 on my server so I have no trouble recruiting them.

 

BTW they aren't saved to the database either (probably later on they will be up for permanent hire), they also are replaced by a new companion if they are killed. Also it makes blood bags useful once more, that is what is used to heal them.

Share this post


Link to post
Share on other sites

Well since they aren't affected by the weight system that is easy to do. There is a backpack line but it's commented out since they have no need for it. In my server there is 200 slot backpacks so they could carry nearly as much as a MTVR for you. You can easily access their backpack when they have one, works exactly like accessing one another player has.

Share this post


Link to post
Share on other sites

You run up on them, 'Recruit unit' appears, you recruit them. Typically requires you to be with within a few meters of them. Once you recruit them they are locked to you and no other players can take them from you. If you dismiss them then another player can take them. I do that if I'm taking a survivor to another player on my server so they can grab them. When I dismiss them they have to chase the survivor to make it their own, they create all new waypoints when released and will head to them as fast as possible unless zeds are present.

 

Yes, they spawn at 12 spawn locations at a random distance. They are spawned when the server starts up, dead units respawn at those 12 locations at a random distance.

 

For free, yes, it's all for free atm, you recruit, it's yours only, you dismiss, it's anyones survivor, there are 50 of them in the default setting....

Share this post


Link to post
Share on other sites

AI's are the best server performance destroyers. Spawning any unnecessary AI units might not be the best idea imo. Maybe vendor system could be better, so AI's are spawned only when needed, not 50 on every restart. Just my can of beans..  I'll give it a try today. Nice work.

Share this post


Link to post
Share on other sites

Yes they are, that is why I made it configurable. I do want to get it to the point that they are bought only and only come online when the player does. This first release is about a weeks worth of coding and testing to see if was possible to do in Epoch. I don't know if it cause any BE kicks though since I run a passworded server with the BE pretty much neutered. 

Share this post


Link to post
Share on other sites

Yes they are, that is why I made it configurable. I do want to get it to the point that they are bought only and only come online when the player does. This first release is about a weeks worth of coding and testing to see if was possible to do in Epoch. I don't know if it cause any BE kicks though since I run a passworded server with the BE pretty much neutered. 

 

This works great on 1.0.4.2, though they don't seem to get into vehicles when you do. Also I get no Kicks from BE while they are in use ;)

Share this post


Link to post
Share on other sites

Hit the ~ key and tell them to get in. They will drive vehicles for you but they aren't very good drivers for the larger vehicles. If you get in as driver first it easier to make them get in the vehicle you are in. It's also a good idea if you are at your base to tell them to hold fire. They don't care if your vehicles are in the way.

Share this post


Link to post
Share on other sites

I don't see any issue in that pastebin log, they do have a 500m roaming range from the spawn point. A lot of the time I just sit near the spawn point and they will come near enough for me to grab them. They create a new waypoint after they reach their last waypoint, it's always within 250m of the spawn location. New waypoints aren't logged so I can't tell where they head next. I tried to pick an open area for every spawn point so you could see them easily, the one near the bandit trader and the one near the lower left hand trader (wholesaler) in #17 are the most open ones I used. If you leave the markers turned on, just sit and wait for them, they will cycle back to near the markers. I've had no trouble picking up 10 or more companions in a single play through.

Share this post


Link to post
Share on other sites

Also you can look at your server RPT log and see if they were actually spawned, it will show in there the unit created and where they were spawned at. I am a big fan of logging just about anything script related I create.

 

Thanks. I did end up parking myself at a spawn marker for a few minutes but had to log before I saw anything. Will need to give this another go when I get home later today.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...