DayZ:Factions

Xyberviri

Valued Member!
Hello there server owners i made a add-on for my server and i though i might release it in case it helps anyone else.

For anyone that has modded their server and added AI, you probably discovered that your AI don't seem to want to kill Zeds that want to kill you. Currently the only solution is to set the Civilian faction to enemy, this has the side effect of locking you out of the corpses and/or other containers.

This addon changes the side relations for zeds and bandits so that the side attached to the unit is correct to "Resistance" all zombies and "OppFor" for the two bandit units. This will allow any AI added to the game to identify the unit with the correct reaction. Additionally this means that the mission editor does not have to modify the side relations for civilian and therefor the players are not locked out of containers that have no side relations(even though they are all really civ)

Added ZED Faction - All zombies are now found under GUR > ZED in the mission editor
Added Bandit Faction - All bandits are now found under OPP > Bandit in the mission editor

Files: http://opendayz.net/index.php?attachments/dayz_factions-zip.108/
Server key: Yes
Video of demo: http://www.twitch.tv...iri/b/358105298

How to activate, If you have not modified your DayZ mission file in any way then simply Add the following init to your init.sqf:

Code:
if (isServer) then {
hiveInUse = true;
_serverMonitor = [] execVM "\z\addons\dayz_server\system\server_monitor.sqf";
_dayzFactions = [] execVM "Dayz_Factions\init.sqf";
};

Copy the following folder included to your mission root:
"Dayz_Factions\init.sqf"

If you have modified the mission, either by placing units on the EAST or RESISTANCE side, then you will need to remove the following "CreateCenter" commands for the respective side.
Code:
waitUntil{initialized};
//0Day
createCenter east;
createCenter resistance;
//Survivors
WEST setFriend [RESISTANCE,0];
WEST setFriend [EAST,0];
//Bandits
EAST setFriend [RESISTANCE,0];
EAST setFriend [WEST,0];

You do not need the to create the center for a side that you have placed units down on the map for, if your using DAC for example, you do however need to set the side relation if you have not already done so in the mission editor.

Since zed AI is controlled by the player pc and is not tied to faction this does not change the behavior of zeds attacking players, however at this time zeds will not attack the ai that helps you, however they may not need to as the ai in arma is pretty stupid and will get killed when surrounded by zeds that don't act like insurgents.

Naming: this add-on is being called DayZ Factions because that is what is missing period, there is no intention of stealing or coping from DayZ or otherwise.

Disclaimer: i take no responsibility for anything that happens as a result of the use of DayZ_Factions.

Support: Please use this thread for support issues or contact me directly.

Trouble shooting:
Code:
Server wont start:
    Did you put the DayZ_Factions\init.sqf line in your init.sqf file of your dayz mission pbo file?
    Do you already have units from east/resistance on your map?
 
If you place units from resistance or east then you do not need to "createCenter" on either of those sides, please remove that from the included init file.
 
AI wont shoot at Zeds:
    Did you join the server with out the mod enabled?
    Did your mission file run the init.sqf
    If your not using the init.sqf file are your side relations set?
 
Why are bandits east?
    Because they are not your friend
    Because on my server im modding it so that bandit players will be east side
 
Are player bandits going to be screwed because of this?
    Please test if AI on a player team reacts as if a player bandit is east by default. This needs testing.
 
Do i need rMod?
    No, This mod only modifys the base class for zeds and the two bandit classes.
    This changes the side the unit is on when spawned as an actor.
"you can not play/edit this mission it something content deleted, Dayz_Factions"?
 
What is with this "Missing content, DayZ_Factions" about?
    You do not need to include this in the addons of your mission file, that will break stuff.



Backup download if issues with attached file:
https://docs.google.com/file/d/0By9zTEuk5q1EZDBWMVdibmdyaDQ/edit
 

Attachments

  • @DayZ_Factions.zip
    5.6 KB · Views: 595
I will be running this on my server. Will defiantly be updating you guys on how it works.

nice work man! and cheers!


Works like a charm. I think we should be distributing this. I just put it on my custom repo

***EDIT*** Just uploaded some video of the AI in action

There is a link in the description with more video links.
 
Just an FYI - We've been running a customized DayZ (and actually looking for developers to help out) map/server/mod (whatever you want to call it; because I'm not even sure) called "FactionZ". We started running it back in, I think, November 2012.

It's really just a private server with a bunch of custom bases/zones that each 'Faction' has as a perm-safe zone. Users request to be on one Faction or the other (or a bandit group) and then we hold events every weekend and have 'cycles' on the 3rd week where they earn a win for their Faction and we reset. (Super small summary)

Just letting you know since the names are pretty close.
 
I have honestly been thinking about expanding this but haven't because i didn't want to make this something that required another mod to do, however its very well possible to add additional units to dayz using the method i created with this patch.

My end goal is to merge wasteland with dayz in order to create more story line, so that random missions are poping up and stuff, while changing it to be more dayzish.

this is all because my server owner has asked me to try to set this up so this mod is a required stepping stone to get that working.

i have been looking at maybe changing bandits to oppfor when they login too because i found some team/side switching code on the arma forums.

This way all bandits will be enemy to both the player and any npc ai that might be on their side also.
 
You don't need to switch bandits to opfor... Their player rating is already low because they KILLED a "teammate" or rather a blufor.


@strikes, do you have a website?
 
Anyone want to make me a mission file for Taviana with 250 AI Bandits all geared up? :)
 
i can create a server but the problem is after i get into the game for couple seconds it will pop up a sentence "you can not play/edit this mission it something content deleted, zerodayz" am i putting the files wrong. i did add the sentence "_dayzFactions = [] execVM "Dayz_Factions\init.sqf";" in mpmissions file which is my chernarus. but i m not quite sure where do i place another init.sqf file in the Dayz_Factions in middion files
 
remove the "dayz_factions" from your addons in the mission.sqm file in your mission.pbo.

I have attached a copy of my mission.pbo file so you can see how its all setup.

Code:
startLoadingScreen ["","DayZ_loadingScreen"];
enableSaving [false, false];
 
dayZ_instance = 1393;    //The instance
hiveInUse    =    true;
initialized = false;
dayz_previousID = 0;
execVM "R3F_ARTY_AND_LOG\init.sqf";
 
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";    //Initilize the publicVariable event handlers
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 "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
progressLoadingScreen 1.0;
//stream_locationCheck = {};
 
 
player setVariable ["BIS_noCoreConversations", true];
//enableRadio false;
 
_logistic = execVM "=BTC=_Logistic\=BTC=_Logistic_Init.sqf";
_recruitable_nps = execVM "bon_recruit_units\init.sqf";
 
"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
 
if (isServer) then {
    hiveInUse = true;
 
    _serverMonitor = [] execVM "\z\addons\dayz_server\system\server_monitor.sqf";
    _dayzFactions = [] execVM "Dayz_Factions\init.sqf";
};
 
if (!isDedicated) then {
    fnc_usec_selfActions =        compile preprocessFileLineNumbers "fixes\fn_selfActions.sqf";
    0 fadeSound 0;
    0 cutText [(localize "STR_AUTHENTICATING"), "BLACK FADED",60];
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =    [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
 
};

This is the only change needed: "_dayzFactions = [] execVM "Dayz_Factions\init.sqf";"

Let me know if you have any problems getting setup.
 

Attachments

  • dayz_1393.chernarus.pbo
    337.4 KB · Views: 90
i m sorry...do u think u can give a instruction which file should put it becoz i m dont quite understand the method u explain on the top :[
 
Sure, First off you need a tool called PBO Manager, http://www.armaholic.com/page.php?id=16369

This only gets complicated if you have already added EAST or RESISTANCE units to your map, if you have not added either of these units then follow the steps below, if you have then please contact me and ill walk you though the steps to set this up.

First you go to where you mission file is located on your server, if you use dayz.st or one of those providers they should have a file upload er/download er. download a copy of the mission to your computer, rename the extension on the one on the server from .pbo to .bak in case something doesn't work and you want to go back.

the name of the file is dayz_#.island.pbo, where the # is your instance id of your server and island is the name of the island your server is on, ie chernarus for most of us.

next you right click on that mission pbo file and if you installed pbo manager you will get an option that will say "Extract to dayz_1.chernarus"
wZyqO.png


This will create a folder you can go into, you then have to edit the init.sqf file, personally i use notepad++:
GdEnv.png


Find the section of the file that reads
Code:
if (isServer) then {
hiveInUse = true;
_serverMonitor = [] execVM "\z\addons\dayz_server\system\server_monitor.sqf";
};

We then change this code to read as follows:
Code:
if (isServer) then {
hiveInUse = true;
_serverMonitor = [] execVM "\z\addons\dayz_server\system\server_monitor.sqf";
_dayzFactions = [] execVM "Dayz_Factions\init.sqf";
};

The completed file will look like this:
NKk7COX.png


Next you need to put the DayZ_Factions folder inside your mission folder:
cPAwCz0.png


NOTE: Before this next step you should rename your old mission pbo file, just change the extension to .bak.

After that you just have to repack your mission file and put it back on the server:
fDfTC.png



If you have any trouble please let me know, alternativly if you give me your instance id i can create a mission.pbo file for you to try on your server.
 
init.png Ok, first of all, thank you thank you and thank you for having such a patience to help me, i upload my dayz chernarus.pbo i try to create a server everything work just fine(zombies,loot) but i can't see any AI. am i doing it(file) wrong? is there ways to check is there any AI in my server? i put a debug monitor bak into the server, will that affect the file? and, Am i missing two folder becoz i saw ur screenshot that has =BTC=_logistic and bon_recruit_units thank you again forgot to said, i m using Bliss to create my server :rolleyes:
 

Attachments

  • dayz_1.chernarus.pbo
    68.8 KB · Views: 39
I understand what your asking however at this time this is not added because its still in the early stages. right now DayZ factions only adds a compatibility layer that you can add AI to your own map using the in game editor. the server owner that is using factions is using it with DAC because he originally already had them on the map, im working on something else at this time which will add the something similar to the game.
 
So..do i still have any chances to play with this mod? and where should i put the @DayZ_Factions (inside has a addons folder and key folder)
 
the @dayz_factions goes in the same folder next to dayz, its another addon that is needed to make the ai work properly, this is primarily intended for server owners that customize their servers.
 
I pulled some of the TK models into the bandit side, Yes bandits are still east
4GICgkX.jpg

I was just playing around to see if it was possible to just add the model to a new class and 1-2 lines of code let me copy some GUR units into their own dayz classes.
 
I love you.. soo much mate.. thanks for this.. I've struggled with figuring this out for about 4 months.. any idea if this will work with upsmon AI spawned via mcc sandbox? or will this require the AI to be placed in the mission file?

tia
-gicon
 
The only thing you need Dac/upsmon and all the dynamic ai mods should work with this, key is the createcenter command for any side that doesnt have a unit on the map, and setting resistance to enemy. Let me know if you need help, this might be intended for advance editing but its very easy to setup( literally 4-6 lines of code )

Edit: erm my phone ate the reply ill type a better on up in a little bit
 
yeah, I see what you did.. this unfortunately isn't what I was looking for, however fantastic share none the less mate.
 
Back
Top