Jump to content

[Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")


Sandbird

Recommended Posts

Walk Amongst The Dead

 

 

 

The famous "Walking Dead" trick, that you can smear zombie parts on you to hide from zombies is coming to dayz !

This mod is for 1.5 epoch. The 1.6+ version is continued by juandayz over here :

 

 

This script does exactly that!. I tried to do this as realistic as possible...so excuse the lengthy tutorial. Its to add realism to the mod.

 

Features: 

  • To apply the camo you need to harvest zombie parts, and Right click on them. (default value: 2)
  • Zombies ignore you when camo is active (camo can be active until player washes it off, or after x minutes...set in the config.sqf)
  • Humanity or blood decreases while under the effect (default value: 1 point per 10 seconds, easy to disable this..see the end of this thread)
  • When in combat, camo is temporarily disabled (ex...you shoot, or your friend does cause he thinks its funny :P)
  • Player is making random zombie noises when camo is on, to fit in with his new friends :P (male or female sounds, depending on the player's skin)
  • Rain can wash away your camo....depending on rain's intensity. Hide inside a building if you want to keep it. (Low, Medium, Hard rain / 26, 18, 12 seconds till you lose it.)
  • To remove the camo you need to wash it off with any type of water source (Right click water bottle, or swim, use mouse scroll on wells, ponds)
  • Changing clothes removes the camo

 

Basically you gut some zombies and use their parts to 'smear' yourself with zombie parts.

While you have the camo on you, zombies wont notice you, unless you fire your weapon or clean yourself.

If you fire your weapon, then you can easily get the 'zombie camo' back if you hide somewhere until the combat timer is off. You still 'wear' the z parts so the zombies still think you are one of them if they see you again.

 

Installation in 10 steps:

 

  1. Download the file containing the script  -=Click Here=-
  2. Extract the content in your Mission folder (i have them inside /custom  folder. For the purpose of this tutorial i'll refer to that folder. If you want to add them to your OWN special folder...Search all the files for the word custom and change it to your liking.)
  3. Open your init.sqf and at the bottom add this line:
    call compile preprocessFileLineNumbers "custom\walkamongstthedead\config.sqf";
  4. Open your description.ext and search for 
    class RscPictureGUI

    If you have RscPictureGUI dont do anything...If you dont....then add this at the bottom of the file.

    class RscPictureGUI
    {
    	access=0;
    	type=0;
    	idc=-1;
    	colorBackground[]={0,0,0,0};
    	colorText[]={0.38,0.63,0.25999999,0.75};
    	font="TahomaB";
    	sizeEx=0;
    	lineSpacing=0;
    	text="";
    	style="0x30 + 0x100";
    	x=0;
    	y=0;
    	w=0.2;
    	h=0.15000001;
    };
  5. In the same file search for: 

    class RscTitles

    If you have RscTitles then inside it add class zCamoStatusGUI from bellow...If you dont....then add ALL of this at the bottom of the file:

    class RscTitles
    { 
    	class zCamoStatusGUI {
    	idd = -1;
    	fadeout=0;
    	fadein=0;
    		onLoad = "uiNamespace setVariable ['zCamo_GUI_display', _this select 0]";
    		duration = 10e10;
    		name= "zCamoGui";
    		controlsBackground[] = {};
    		objects[] = {};
    		class controls {
    			class zCamoIcon:RscPictureGUI {
    			idc = 1;
    			text="custom\walkamongstthedead\zombie.paa";
    			x="0.958313 * safezoneW + safezoneX";
    			y="0.43 * safezoneH + safezoneY";
    			w=0.059999999;
    			h=0.079999998;
    			colorText[]={1,1,1,1};
    			};
    		};
    	};
    };	

    Notice the text="custom\walkamongstthedead\zombie.paa";      folder name custom...change to where you put the mod.
     

  6. In the same file (or if you have defines.hpp) seach for this:

    class CfgSounds

    If you have CfgSounds then inside it add class z_wzombie1 and z_wzombie2 from bellow, and into sounds[] array...If you dont....then add ALL of this at the bottom of the file:  (these are the female zombie sounds....whoever made dayz_sfx.pbo forgot to add them in the config.bin..so we have to add them manually).

    class CfgSounds
    {
    	sounds[] ={z_wzombie1,z_wzombie2};
    	class z_wzombie1 {
    		name = "";
    		sound[] = {"custom\walkamongstthedead\dayz_sfx\femalezombie_attack_04.ogg",0.3,1,40};
    		titles[] = {0, ""};
    	};
    	
    	class z_wzombie2 : z_wzombie1 {
    		sound[] = {"custom\walkamongstthedead\dayz_sfx\femalezombie_spotted_01.ogg",0.3,1,40};
    	};
    };
  7. At the bottom of the file add this: (This is the right click options for WaterBottle and Zombie Parts...a must for step 8)

    #include "custom\walkamongstthedead\watd.hpp"
  8. Now for the right clicking options on the Zombie Guts and Water Bottles we have to overwrite ui_selectSlot.sqf in the dayz_code\init\compiles.sqf. If you have done this go to step 9.
    Open your compiles.sqf and search for player_selectSlot and change it to this:

    player_selectSlot= compile preprocessFileLineNumbers "dayz_code\compile\ui_selectSlot.sqf";

    Open the dayz_code.pbo located in the dayz epoch mod folder (yes the 2.5gig folder) and extract the dayz_code\compile\ui_selectSlot.sqf you see there in your Mission folder (look above the path....dayz_code\compile\)
     

  9. Open ui_selectSlot.sqf  and search for: 

    _pos set [3,_height];

    Right above this add: 

    _erc_cfgActions = (missionConfigFile >> "WaTd" >> _item);
    _erc_numActions = (count _erc_cfgActions);
    if (isClass _erc_cfgActions) then {
        for "_j" from 0 to (_erc_numActions - 1) do 
        {
            _menu =  _parent displayCtrl (1600 + _j + _numActions);
            _menu ctrlShow true;
            _config =  (_erc_cfgActions select _j);
            _text =  getText (_config >> "text");
            _script =  getText (_config >> "script");
            _height = _height + (0.025 * safezoneH);
            uiNamespace setVariable ['uiControl', _control];
            _menu ctrlSetText _text;
            _menu ctrlSetEventHandler ["ButtonClick",_script];
        };
    };
  10. If you have in*****r Antihack add this as well in your _dayzActions
    s_player_cleanguts
  11. (Update, If you dont have v5). Since the latest beta patch is so strict, add this at the top of your walkamongstthedead\config.sqf file:
    hasGutsOnHim = false;

 

 

If people are getting kicked/banned with inifistar you can do this to fix it. Open AH.sqf and change line:

player_zombieAttack = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_zombieAttack.sqf';

to this:

player_zombieAttack = {};

V2 Changes

All values have been moved to config.sqf

 

V3 Changes
- Changed config.sqf (removed wells from there...now all wells are recognized from the walkamongstthedead.sqf

- Changed walkamongstthedead.sqf (added all wells and ponds detection. Look at any well or a pond and use scroll to get the option to remove camo)

 

V4 Changes (17-5-14)
- Fixed flashing icon not flashing when in combat

- Fixed camo not getting reactivated properly when 1st camo finishes and new one applied

- Added value in config.cfg to NOT disable Z camo when you fire your weapon...so it stays on
- (if you are updating from previous versions just change your walkamongstthedead.sqf, and config.sqf files)

 

V5 Changes

- Added a value in config.sqf to initialize a bool.
 

 

 

Open config.sqf and tweak the hell out of it if you want.

If you want to lose blood instead of humanity do these 4 steps

  1. Grab this \z\addons\dayz_code\system\player_spawn_2.sqf and put it in your compiles folder
  2. Change path to player_spawn_2.sqf in compiles.sqf, to where you put it in
  3. Open player_spawn_2.sqf and change line:
    if (!r_player_infected and !r_player_inpain and !r_player_injured and !DZE_InRadiationZone) then {

    to

    if (!r_player_infected and !r_player_inpain and !r_player_injured and !DZE_InRadiationZone and !DZE_hasZombieCamo) then {
  4. Set DZ_ZCAMO_HUMANITY = false; in the \walkamongstthedead\config.sqf

 

 

Gui will look like this when you have zombie camo on
2dtu5fs.jpg

 

 

Note:
If you dont hear any idle zombie sounds when you are wearing the Z camo, try this fix here:
It should work for the latest Epoch version.

 

 

Enjoy
 

Credits: Enhanced Water Bottle Filling - by BDC - Aug 11 2013, for DayZ 1.7.7.1

 

I DO NOT ALLOW ANYONE SELLING THIS SCRIPT...PERIOD
YOU DO NOT HAVE MY PERMISSION TO SELL IT

THIS SCRIPT SHOULD BE USED FREELY


 

Link to comment
Share on other sites

question for you...I already have a custom ui_selectslot file and it is causing me headaches trying to get your change to play nice with what I already have. any chance you could have a look and see if you could see how to fit them together?

 

private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType","_erc_cfgActions","_erc_numActions","_text"];
disableSerialization;
_control  = _this select 0;
_button  = _this select 1;
_parent  = findDisplay 106;
 
if (_button == 1) then {
_group = _parent displayCtrl 6902;
_pos = ctrlPosition _group;
_pos set [0,((_this select 2) + 0.48)];
_pos set [1,((_this select 3) + 0.07)];
_item = gearSlotData _control;
_conf = configFile >> "cfgMagazines" >> _item;
if (!isClass _conf) then {_conf = configFile >> "cfgWeapons" >> _item;};
_name = getText(_conf >> "displayName");
_cfgActions = _conf >> "ItemActions";
_numActions = (count _cfgActions);
_height = 0;
_erc_cfgActions = (dGrenade_West") then {
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft IED";
_script = "IED\ied.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
}; 
if (_item == "BAF_ied_v1") then { 
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft Large IED";
_script = "IED\ied_large.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v2") then { 
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft Extra Large IED";
_script = "IED\ied_xlarge.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v3") then { 
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft XXL IED";
_script = "IED\ied_xxlarge.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
for "_i" from 0 to (_numActions - 1) do 
{
_menu = _parent displayCtrl (1600 + _i);
_menu ctrlShow true;
_config = (_cfgActions select _i);
_type = getText (_config >> "text");
_script = getText (_config >> "script");
_outputOriented =  getNumber (_config >> "outputOriented") == 1;
_height = _height + (0.025 * safezoneH);
_compile =  format["_id = '%2' %1;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
if (_outputOriented) then {
_array = getArray (_config >> "output");
_outputClass = _array select 0;
_outputType = _array select 1;
_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
};
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
_pos set [3,_height];
_group ctrlShow true;
ctrlSetFocus _group;
_group ctrlSetPosition _pos;
_group ctrlCommit 0;
 
};

 

any help would be appreciated as I've been trying various things with no success. Thanks and this script is great if I can't get this worked out and no one can tell me what needs changing I'll just remove the thing I have that is using it at this point for your script. :D

Link to comment
Share on other sites

There are zombie sound effects are already within the mod, you can call them within the code exactly how you want them to play, without including them in the mission file to save space. Interesting script!

I know...but if you look at the config.bin inside dayz_sfx.pbo .... the female zombie sounds are not inside the class...so you cant reference them...I already made a post here hoping in the next epoch update they fix this.

 

question for you...I already have a custom ui_selectslot file and it is causing me headaches trying to get your change to play nice with what I already have. any chance you could have a look and see if you could see how to fit them together?

 

private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType","_erc_cfgActions","_erc_numActions","_text"];
disableSerialization;
_control  = _this select 0;
_button  = _this select 1;
_parent  = findDisplay 106;
 
if (_button == 1) then {
_group = _parent displayCtrl 6902;
_pos = ctrlPosition _group;
_pos set [0,((_this select 2) + 0.48)];
_pos set [1,((_this select 3) + 0.07)];
_item = gearSlotData _control;
_conf = configFile >> "cfgMagazines" >> _item;
if (!isClass _conf) then {_conf = configFile >> "cfgWeapons" >> _item;};
_name = getText(_conf >> "displayName");
_cfgActions = _conf >> "ItemActions";
_numActions = (count _cfgActions);
_height = 0;
_erc_cfgActions = (dGrenade_West") then {
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft IED";
_script = "IED\ied.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
}; 
if (_item == "BAF_ied_v1") then { 
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft Large IED";
_script = "IED\ied_large.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v2") then { 
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft Extra Large IED";
_script = "IED\ied_xlarge.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v3") then { 
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft XXL IED";
_script = "IED\ied_xxlarge.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
for "_i" from 0 to (_numActions - 1) do 
{
_menu = _parent displayCtrl (1600 + _i);
_menu ctrlShow true;
_config = (_cfgActions select _i);
_type = getText (_config >> "text");
_script = getText (_config >> "script");
_outputOriented =  getNumber (_config >> "outputOriented") == 1;
_height = _height + (0.025 * safezoneH);
_compile =  format["_id = '%2' %1;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
if (_outputOriented) then {
_array = getArray (_config >> "output");
_outputClass = _array select 0;
_outputType = _array select 1;
_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
};
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
_pos set [3,_height];
_group ctrlShow true;
ctrlSetFocus _group;
_group ctrlSetPosition _pos;
_group ctrlCommit 0;
 
};

 

any help would be appreciated as I've been trying various things with no success. Thanks and this script is great if I can't get this worked out and no one can tell me what needs changing I'll just remove the thing I have that is using it at this point for your script. :D

Will take a look now and post back

 

Awesome script! Is there are way to change player blood by -10 per 1 sec instead of humanity? Because with humanity change players can abuse this script to make them bandits easily.

Will make a modified walkamongstthedead.sqf need to tweak the while loop to do that. Will post it on and let you know

Link to comment
Share on other sites

question for you...I already have a custom ui_selectslot file and it is causing me headaches trying to get your change to play nice with what I already have. any chance you could have a look and see if you could see how to fit them together?

 

private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType","_erc_cfgActions","_erc_numActions","_text"];
disableSerialization;
_control  = _this select 0;
_button  = _this select 1;
_parent  = findDisplay 106;
 
if (_button == 1) then {
_group = _parent displayCtrl 6902;
_pos = ctrlPosition _group;
_pos set [0,((_this select 2) + 0.48)];
_pos set [1,((_this select 3) + 0.07)];
_item = gearSlotData _control;
_conf = configFile >> "cfgMagazines" >> _item;
if (!isClass _conf) then {_conf = configFile >> "cfgWeapons" >> _item;};
_name = getText(_conf >> "displayName");
_cfgActions = _conf >> "ItemActions";
_numActions = (count _cfgActions);
_height = 0;
_erc_cfgActions = (dGrenade_West") then {
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft IED";
_script = "IED\ied.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
}; 
if (_item == "BAF_ied_v1") then { 
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft Large IED";
_script = "IED\ied_large.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v2") then { 
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft Extra Large IED";
_script = "IED\ied_xlarge.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v3") then { 
_menu = _parent displayCtrl (1600);
_menu ctrlShow true;
_type = "Craft XXL IED";
_script = "IED\ied_xxlarge.sqf";
_height = _height + (0.025 * safezoneH);
_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
for "_i" from 0 to (_numActions - 1) do 
{
_menu = _parent displayCtrl (1600 + _i);
_menu ctrlShow true;
_config = (_cfgActions select _i);
_type = getText (_config >> "text");
_script = getText (_config >> "script");
_outputOriented =  getNumber (_config >> "outputOriented") == 1;
_height = _height + (0.025 * safezoneH);
_compile =  format["_id = '%2' %1;",_script,_item];
uiNamespace setVariable ['uiControl', _control];
if (_outputOriented) then {
_array = getArray (_config >> "output");
_outputClass = _array select 0;
_outputType = _array select 1;
_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
};
_menu ctrlSetText format[_type,_name];
_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
_pos set [3,_height];
_group ctrlShow true;
ctrlSetFocus _group;
_group ctrlSetPosition _pos;
_group ctrlCommit 0;
 
};

 

any help would be appreciated as I've been trying various things with no success. Thanks and this script is great if I can't get this worked out and no one can tell me what needs changing I'll just remove the thing I have that is using it at this point for your script. :D

 

I am trying to fix this with your script but i have a feeling there is something wrong with it ...you have this :

_erc_cfgActions = (dGrenade_West") then {

that doesnt make sense....First there is just a single " (quote) out of nowhere and then there is no "if" to say "then".

I think you messed up on a copy/paste or something.

Anyways....i think i fix it now....i think it should say there:

if (_item == "HandGrenade_West") then {

Give this a try ui_selectSlot.sqf

private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType","_erc_cfgActions","_erc_numActions","_text"];
disableSerialization;
_control  = _this select 0;
_button  = _this select 1;
_parent  = findDisplay 106;
 
if (_button == 1) then {
	_group = _parent displayCtrl 6902;
	_pos = ctrlPosition _group;
	_pos set [0,((_this select 2) + 0.48)];
	_pos set [1,((_this select 3) + 0.07)];
	_item = gearSlotData _control;
	_conf = configFile >> "cfgMagazines" >> _item;
	if (!isClass _conf) then {_conf = configFile >> "cfgWeapons" >> _item;};
	_name = getText(_conf >> "displayName");
	_cfgActions = _conf >> "ItemActions";
	_numActions = (count _cfgActions);
	_height = 0;
if (_item == "HandGrenade_West") then { 
	_menu = _parent displayCtrl (1600);
	_menu ctrlShow true;
	_type = "Craft IED";
	_script = "IED\ied.sqf";
	_height = _height + (0.025 * safezoneH);
	_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
}; 
if (_item == "BAF_ied_v1") then { 
	_menu = _parent displayCtrl (1600);
	_menu ctrlShow true;
	_type = "Craft Large IED";
	_script = "IED\ied_large.sqf";
	_height = _height + (0.025 * safezoneH);
	_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v2") then { 
	_menu = _parent displayCtrl (1600);
	_menu ctrlShow true;
	_type = "Craft Extra Large IED";
	_script = "IED\ied_xlarge.sqf";
	_height = _height + (0.025 * safezoneH);
	_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v3") then { 
	_menu = _parent displayCtrl (1600);
	_menu ctrlShow true;
	_type = "Craft XXL IED";
	_script = "IED\ied_xxlarge.sqf";
	_height = _height + (0.025 * safezoneH);
	_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
for "_i" from 0 to (_numActions - 1) do 
{
	_menu = _parent displayCtrl (1600 + _i);
	_menu ctrlShow true;
	_config = (_cfgActions select _i);
	_type = getText (_config >> "text");
	_script = getText (_config >> "script");
	_outputOriented =  getNumber (_config >> "outputOriented") == 1;
	_height = _height + (0.025 * safezoneH);
	_compile =  format["_id = '%2' %1;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	if (_outputOriented) then {
		_array = getArray (_config >> "output");
		_outputClass = _array select 0;
		_outputType = _array select 1;
		_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
		_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
	};
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
};

_erc_cfgActions = (missionConfigFile >> "WaTd" >> _item);
_erc_numActions = (count _erc_cfgActions);
if (isClass _erc_cfgActions) then {
    for "_j" from 0 to (_erc_numActions - 1) do 
    {
        _menu =  _parent displayCtrl (1600 + _j + _numActions);
        _menu ctrlShow true;
        _config =  (_erc_cfgActions select _j);
        _text =  getText (_config >> "text");
        _script =  getText (_config >> "script");
        _height = _height + (0.025 * safezoneH);
        uiNamespace setVariable ['uiControl', _control];
        _menu ctrlSetText _text;
        _menu ctrlSetEventHandler ["ButtonClick",_script];
    };
};

_pos set [3,_height];
_group ctrlShow true;
ctrlSetFocus _group;
_group ctrlSetPosition _pos;
_group ctrlCommit 0;
 
};

Link to comment
Share on other sites

It would be great! Thank you Sir! 

 

Ok to lose blood, instead of humanity....all you have to do is change function sand_makeSounds = {}  to this:

 

sand_makeSounds = {
	private ["_type","_chance","_sound","_isWoman","_plsound","_bloodleft","_bloodloss","_id","_sleepTime"];
	
	_bloodloss = 1;  // How much blood points to lose per _sleepTime
	_sleepTime = 2;  // Seconds passed before losing blood
	
	_isWoman = getText(configFile >> "cfgVehicles" >> (typeOf player) >> "TextPlural") == "Women";	
	if (isNil 'make_sounds_loop') then {
		while {true} do {
			if (!hasGutsOnHim) exitWith {make_sounds_loop = nil;};
			make_sounds_loop = true;
			
			if (_isWoman) then {
				_type = ["wzombie1","wzombie2"];
			} else {
				_type = ["idle_0","idle_18","idle_20","idle_24","idle_26","idle_29","idle_32","idle_35","attack_9"];
			};
			
			_plsound  = _type call BIS_fnc_selectRandom;
			_chance = ceil (random 10);
			
			if ((round(random _chance) == _chance) or (_chance == 0)) then {
				_sound = "z_" + _plsound;
				[nil,player,rSAY,[_sound, 10]] call RE;
				if (isNil "showNotificationOnce") then {systemChat ("Zombie ninja: You will be making random zombie sounds like this one."); showNotificationOnce = false;};
			};
			
			
			_bloodleft = r_player_blood - _bloodloss;
			if (_bloodleft < 0) then {
				_id = [] spawn player_death;
			} else {
				r_player_blood = _bloodleft;
			};
			
			
			//[player,-1,10] call player_humanityChange;
			sleep _sleepTime;
		};
	};
};

 

Notice the 2 new values at the top:

_bloodloss = 1;  // How much blood points to lose per _sleepTime
_sleepTime = 2;  // Seconds passed before losing blood

I think 1 point per second was too much...so i added a value for the timer as well....lose 1 blood per 2 seconds is ok i guess..Tweak it to your liking.

I left the humanity value bellow as well...If you still want it.

 

 

This thing is absolute....i redid the script....This is included in V2.

Link to comment
Share on other sites

Test it, and script work perfect! But not with blood - Epoch have blood regen +10 per 2 sec if you not hungry, so i make some tweaks:

1. Grab this \z\addons\dayz_code\system\player_spawn_2.sqf

2. Change path to player_spawn_2.sqf in compiles

3. In new player_spawn_2.sqf i remove part with regen


	// Health uptick when healty not thirsty or hungry
	if (_foodVal >= 0.9 and _thirstVal >= 0.9) then {
		if (!r_player_infected and !r_player_inpain and !r_player_injured and !DZE_InRadiationZone) then {
			_result = r_player_blood + 10;
			if (_result >= r_player_bloodTotal) then {
				r_player_blood = r_player_bloodTotal;
			} else {
				r_player_blood = _result;
			};
		};
	};

4. Made some tweaks in walkamongstthedead.sqf with blood lose


			_bloodleft = r_player_blood - _bloodloss;
			if (_bloodleft < 0) then {
				_id = [] spawn player_death;
			} else {
				r_player_blood = _bloodleft;
				player setVariable['USEC_BloodQty',r_player_blood,true];
			};

Link to comment
Share on other sites

Test it, and script work perfect! But not with blood - Epoch have blood regen +10 per 2 sec if you not hungry, so i make some tweaks:

1. Grab this \z\addons\dayz_code\system\player_spawn_2.sqf

2. Change path to player_spawn_2.sqf in compiles

3. In newplayer_spawn_2.sqf i remove part with regen

	// Health uptick when healty not thirsty or hungry
	if (_foodVal >= 0.9 and _thirstVal >= 0.9) then {
		if (!r_player_infected and !r_player_inpain and !r_player_injured and !DZE_InRadiationZone) then {
			_result = r_player_blood + 10;
			if (_result >= r_player_bloodTotal) then {
				r_player_blood = r_player_bloodTotal;
			} else {
				r_player_blood = _result;
			};
		};
	};

4. make some tweaks in walkamongstthedead.sqf with blood lose

			_bloodleft = r_player_blood - _bloodloss;
			if (_bloodleft < 0) then {
				_id = [] spawn player_death;
			} else {
				r_player_blood = _bloodleft;
				player setVariable['USEC_BloodQty',r_player_blood,true];
			};

 

 

hmmm i forgot about that....Or you could just do this:

  1. In walkamongst.sqf and newplayer_spawn_2.sqf restore everything back to normal so blood does go up.....but add !DZE_hasZombieCamo in the if statement (in newplayer_spawn_2.sqf)
    if (!r_player_infected and !r_player_inpain and !r_player_injured and !DZE_InRadiationZone and !DZE_hasZombieCamo) then {
    
  2. In the walkamongstthedead.sqf change sand_shieldON and sand_shieldOFF to

     

    sand_shieldOFF = {
    	private ["_txt"];
    	_txt = "Zombies are aware of you now.";
    	systemChat ("Zombie ninja: "+str _txt+"");
    	//cutText [_txt,"PLAIN DOWN"];
    	player_zombieCheck = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_zombieCheck.sqf';
    	player_zombieAttack = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_zombieAttack.sqf';
        DZE_hasZombieCamo = false;
    };
    
    sand_shieldON = {
    	private ["_txt"];
    	_txt = "Zombies think you are one of them.";
    	systemChat ("Zombie ninja: "+str _txt+"");
    	//cutText [_txt,"PLAIN DOWN"];
    	player_zombieCheck = {};
    	player_zombieAttack = {};
        DZE_hasZombieCamo = true;
    };
    
  3. Add DZE_hasZombieCamo = false;  in your variables.sqf or init.sqf so its off by default if you are not using the camo script.

This thing is absolute....i redid the script....This is included in V2. (you still need to overwrite player_spawn_2.sqf though)

Link to comment
Share on other sites

I am trying to fix this with your script but i have a feeling there is something wrong with it ...you have this :

_erc_cfgActions = (dGrenade_West") then {

that doesnt make sense....First there is just a single " (quote) out of nowhere and then there is no "if" to say "then".

I think you messed up on a copy/paste or something.

Anyways....i think i fix it now....i think it should say there:

if (_item == "HandGrenade_West") then {

Give this a try ui_selectSlot.sqf

private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType","_erc_cfgActions","_erc_numActions","_text"];
disableSerialization;
_control  = _this select 0;
_button  = _this select 1;
_parent  = findDisplay 106;
 
if (_button == 1) then {
	_group = _parent displayCtrl 6902;
	_pos = ctrlPosition _group;
	_pos set [0,((_this select 2) + 0.48)];
	_pos set [1,((_this select 3) + 0.07)];
	_item = gearSlotData _control;
	_conf = configFile >> "cfgMagazines" >> _item;
	if (!isClass _conf) then {_conf = configFile >> "cfgWeapons" >> _item;};
	_name = getText(_conf >> "displayName");
	_cfgActions = _conf >> "ItemActions";
	_numActions = (count _cfgActions);
	_height = 0;
if (_item == "HandGrenade_West") then { 
	_menu = _parent displayCtrl (1600);
	_menu ctrlShow true;
	_type = "Craft IED";
	_script = "IED\ied.sqf";
	_height = _height + (0.025 * safezoneH);
	_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
}; 
if (_item == "BAF_ied_v1") then { 
	_menu = _parent displayCtrl (1600);
	_menu ctrlShow true;
	_type = "Craft Large IED";
	_script = "IED\ied_large.sqf";
	_height = _height + (0.025 * safezoneH);
	_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v2") then { 
	_menu = _parent displayCtrl (1600);
	_menu ctrlShow true;
	_type = "Craft Extra Large IED";
	_script = "IED\ied_xlarge.sqf";
	_height = _height + (0.025 * safezoneH);
	_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
if (_item == "BAF_ied_v3") then { 
	_menu = _parent displayCtrl (1600);
	_menu ctrlShow true;
	_type = "Craft XXL IED";
	_script = "IED\ied_xxlarge.sqf";
	_height = _height + (0.025 * safezoneH);
	_compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
};
for "_i" from 0 to (_numActions - 1) do 
{
	_menu = _parent displayCtrl (1600 + _i);
	_menu ctrlShow true;
	_config = (_cfgActions select _i);
	_type = getText (_config >> "text");
	_script = getText (_config >> "script");
	_outputOriented =  getNumber (_config >> "outputOriented") == 1;
	_height = _height + (0.025 * safezoneH);
	_compile =  format["_id = '%2' %1;",_script,_item];
	uiNamespace setVariable ['uiControl', _control];
	if (_outputOriented) then {
		_array = getArray (_config >> "output");
		_outputClass = _array select 0;
		_outputType = _array select 1;
		_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
		_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
	};
	_menu ctrlSetText format[_type,_name];
	_menu ctrlSetEventHandler ["ButtonClick",_compile];
};

_erc_cfgActions = (missionConfigFile >> "WaTd" >> _item);
_erc_numActions = (count _erc_cfgActions);
if (isClass _erc_cfgActions) then {
    for "_j" from 0 to (_erc_numActions - 1) do 
    {
        _menu =  _parent displayCtrl (1600 + _j + _numActions);
        _menu ctrlShow true;
        _config =  (_erc_cfgActions select _j);
        _text =  getText (_config >> "text");
        _script =  getText (_config >> "script");
        _height = _height + (0.025 * safezoneH);
        uiNamespace setVariable ['uiControl', _control];
        _menu ctrlSetText _text;
        _menu ctrlSetEventHandler ["ButtonClick",_script];
    };
};

_pos set [3,_height];
_group ctrlShow true;
ctrlSetFocus _group;
_group ctrlSetPosition _pos;
_group ctrlCommit 0;
 
};

 

 

Thanks So Much not sure how that ended up that way and still working lol but I appreciate your help. Also I have a suggestion. Perhaps the effect should wear off after a certain amount of time(maybe 20-30 minutes), otherwise you could pretty much log in kill 2 zombies and be zombie free until you log or die, as long as you don't care about your humanity and many players don't.

Link to comment
Share on other sites

Thanks So Much not sure how that ended up that way and still working lol but I appreciate your help. Also I have a suggestion. Perhaps the effect should wear off after a certain amount of time(maybe 20-30 minutes), otherwise you could pretty much log in kill 2 zombies and be zombie free until you log or die, as long as you don't care about your humanity and many players don't.

 

Yeah ok, thats easy to do..I'll also add infection chance as well.

Probably i should make a config file and add all the values there.

Link to comment
Share on other sites

With vars and blood all work like a Charm, You are Genius, Sir! ^^

And i have a suggestion:

While you in zombie camo you can't run, or you expose yourself. Or add an option to turn this on or off)

That was my original thought..i still have the code around.

Zombies bug out though sometimes from the quick on/off.

I even added a delay till the shield reactives but i think the trouble is in the zombie agent.

If they notice you and ran towards you and the shield goes on...they turn to those zombies that that girl had with chains and no jaws.

They follow you around....waiting for the shield to go off

Hey maybe that could be another mod :p

Link to comment
Share on other sites

Me have Infistar Antihack and me add

s_player_cleanguts

at your _dayzActions but anti hack baned me??. how to fix it??

 

hmm, banned you with what reason ? The s_player_cleanguts is to show the menu option when you look at a well...so it cant be that.

Check the RPT log and find the reason please.

 

Talked with player...old AH..solved

Link to comment
Share on other sites

!!! Update !!!

 

Changed the script to include ALL of the stuff we talked about here.

The only thing you need to do is redownload the files and redo step 3.

People that use blood loss instead of humanity, check the red letters further down the 1st thread.

 

config.sqf includes everything in there now.

 

 

Infection is a bit annoying....player coughs all the freaking time if he gets it...I dont know why...I am not adding it in a loop or something....so i didnt add it to the changes.

Link to comment
Share on other sites

!!! Update !!!

 

Changed the script to include ALL of the stuff we talked about here.

The only thing you need to do is redownload the files and redo step 3.

People that use blood loss instead of humanity, check the red letters further down the 1st thread.

 

config.sqf includes everything in there now.

 

 

Infection is a bit annoying....player coughs all the freaking time if he gets it...I dont know why...I am not adding it in a loop or something....so i didnt add it to the changes.

 

 

The coughing bit is just how your player acts when infected.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...