Jump to content

Zombie Shield Generator


N340

Recommended Posts

This idea was taken from Base Building. I wanted to get a working zombie shield to work that I could build without using the whole Base Building GUI. 

 

I got it working fully today very easily but it did require some decent modifications so I thought I would post it for others to use. I personally made it so that others had to build parts to the shield and combine them to make it. This is just a script for you to use as you wish that makes it so that an item (default: CDF_WarfareBUAVterminal) will have scroll options to turn on and off the zombie shield. Configurable in he variables settings. 

 

If you want any help making it work in a different way, just ask. I am happy to help.

 

1. First Download the following: https://www.dropbox.com/s/9b0mwstlfz0g7k0/Zedshield.rar

 

2. Put the shield folder in your mission pbo root folder

 

3. Open your custom fn_selfactions.sqf and find:

if(_player_deleteBuild) then {
		if (s_player_deleteBuild < 0) then {
			s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
		};
	} else {
		player removeAction s_player_deleteBuild;
		s_player_deleteBuild = -1;
	};

Then past this under it:

_lever = cursorTarget;

//Zombie Shield
	if (_cursorTarget isKindof TypeOfZShield) then {
		if (EnableZShield == 1) then {
			if (s_player_ZombieShield_on < 0) then {
				s_player_ZombieShield_on = player addAction [format[("<t color=""#FFF700"">" + ("Zombie Shield On") +"</t>"),_adminText], "shield\ZombieShield.sqf", [_lever, true], 6, true, true, "", ""];
			};
			if (s_player_ZombieShield_off < 0) then {
				s_player_ZombieShield_off = player addAction [format[("<t color=""#FFF700"">" + ("Zombie Shield Off") +"</t>"),_adminText], "shield\ZombieShield.sqf", [_lever, false], 6, false, true, "", ""];
			};
		} else {
			if (s_player_ZombieShield_on < 0) then {
				s_player_ZombieShield_on = player addAction [format[("<t color=""#FFF700"">" + ("Zombie Shields are disabled on this server") +"</t>"),_adminText], "", [], 6, false, true, "", ""];
			};
			player removeAction s_player_ZombieShield_off;
			s_player_ZombieShield_off = -1;
		};
	} else {
		player removeAction s_player_ZombieShield_on;
		s_player_ZombieShield_on = -1;
		player removeAction s_player_ZombieShield_off;
		s_player_ZombieShield_off = -1;
	};
//End Shield

4. Then find this line in fn_selfactions.sqf

if(DZE_AllowForceSave) then {
		//Allow player to force save
		if((_isVehicle or _isTent) and !_isMan) then {
			if (s_player_forceSave < 0) then {
				s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
			};
		} else {

***************Replace STUFF IN HERE
		
			};
	};

Where I put *******************Replace STUFF IN HERE, delete everything there and add this in its place:

			s_player_ZombieShield_on = -1;
			player removeAction s_player_ZombieShield_off;
			s_player_ZombieShield_off = -1;
			player removeAction s_player_forceSave;
			s_player_forceSave = -1;

5. Open your custom variable.sqf and paste this at the bottom, this is also where you can customize all your settings.

/**************************************************** Zombie Shield Generator Settings ****************************************************/
	EnableZShield				= 1; //Enable toggleable zombie shield generator/ 1 = Enabled // 0 = Disabled (If disabled, players can still build shield generators, they just wont do anything)
	TypeOfZShield				= "CDF_WarfareBUAVterminal"; //Type of object used for Zombie Shield, included this only in case some maps have this object banned
	AllZShieldTypes			= ["CDF_WarfareBUAVterminal"]; //DO NOT REMOVE ITEMS FROM THIS ARRAY, you can ADD an object class if you want a different building to be used as a Zombie Shield Generator!
	MaxZShields				= 1; //Maximum number of zombie shield generators a player can be added to, default is 1
	ZShieldRadius				= 50; //Radius for zombie shield generator, default is 50
	ZShieldClean				= 0; //Delete Zombies when they enter active shield radius/ 1 = Enabled // 0 = Disabled (If disabled, zombies will be killed but not deleted, could lead to zombie loot farming)

Close up, repack and done. Then any object CDF_WarfareBUAVterminal or anything you replace it with will then have a scroll option to turn a shield on and off. 

 

I have tested this on my servers and works fine. If you have any complications please let me know and ill be happy to help.

 

Here is a pre compiled Cherno mission PBO with a working zombie shield and the extra_RC.hpp included. You can build it with an Engine and 2 poles like you would any other object

https://www.dropbox.com/s/gmibobakfec80za/ZHIELD.pbo

 

Credit for the original code goes to the guys from original BB 1.2.

Link to comment
Share on other sites

you could potentially use a combination of items to be craftable to like a lightpost or whatever (or a pole with loudspeakers, wich would kinda make sense), like 3 timber and 2 scrap metal and right click option. But this would be more like the zombie perimiter mod

Link to comment
Share on other sites

I have it so that you require an Engine, Wheels and metal panels as well as a gem from my traders to be able to build these items. But I just used the extra_rc.hpp script found here http://epochservers.com/viewtopic.php?f=14&t=13

 

My apologies, it was about 3am when I decided to post this. 

 

Once you install the script to allow more crafted items, simply open the extra_rc.hpp file and make/edit a class to include the CDF_WarfareBUAVterminal as a craft able item. So for instance if you want to make it so clicking on an Engine would give the option to craft the Zombie Shield, you would need to have this in your extra_rc.hpp

 

    class PartEngine {
        class Zshield {
            text = "Zombie Shield";
            script = "[""CDF_WarfareBUAVterminal"",[""ItemToolbox"",""ItemEtool"],[[""PartEngine"", 1],[""bulk_ItemSandbag"", 1],[""forest_net_kit"", 1]],[0,6.5,2.5]] execVM "" LOCATION OF YOUR PLAYER_BUILD.SQF FILE ""

        };     

  };

 

Hope that helps a bit.

 

             

Link to comment
Share on other sites

I have posted a working PBO and updated the files a bit to include sounds so you know when its on and off. It will make an electrical sound, no extra files needed. 

 

I was also missing a variable in the zedshield.sqf, sorry about that.

 

No battleye filters are needed on my servers and should not be needed on yours.

Link to comment
Share on other sites

I started having a go at it as its the best way to learn, got the extra_rc working fine and iv now got as far as this line:

 

  script = "[""CDF_WarfareBUAVterminal"",[""ItemToolbox"",""ItemEtool"],[[""PartEngine"", 1],[""bulk_ItemSandbag"", 1],[""forest_net_kit"", 1]],[0,6.5,2.5]] execVM "" LOCATION OF YOUR PLAYER_BUILD.SQF FILE ""

 

Sorry and this may sound somewhat dumb, but where do you suppose the most common location would be for my PLAYER_BUILD.SQF file ?

Link to comment
Share on other sites

Sorry, I seem to assume people have custom files already, shouldn't assume anything really. Yes a custom player_build.sqf is needed, I use the one that comes in snapping anyways. That is included in my zshield pbo file that is compiled up top.

Link to comment
Share on other sites

Great! Thanks again for the update - ive got it installed but having some teething issues, i right click on the Engine, get the menu up to build the Zombie shield, but as i didnt have all the mats at the time, it didnt do anything - not even a tooltip to say im missing xxx components - i tried again once i had the mats, but it said "building already in progress" so it was still thinking its consutructing it - ive prb missed something silly like a ; off somewhere

 

dont suppose you have any ideas?

 

I took a look at your pbo, but i didnt use it as i wanted clean files like the player_build.sqf

Link to comment
Share on other sites

First look in init.sqf and make sure the the variables and compiles sqf files pointing to your custom ones. (refer to my init in pbo to see this)

 

Second make sure your custom compiles is pointing to your custom player_build and fn_selfactions that you have as well. (again see the compiles in my pbo)

 

Third make sure that in your extra_rc.hpp file that at the end of your building items that it shows the proper location for you custom player_build file (again refer to my pbo)

 

 

If you are still having issues I can have a look at your pbo for you.

Link to comment
Share on other sites

I have the zombie shields on our server but when the shield is turned on, nothing happens. I checked the variables to enable the correct settings but nothing kills or cleansup the zombies.

Im running infistar on the server so im guessing it's probably that.

Link to comment
Share on other sites

  • 1 month later...

Thankz for this new version I used the original over a year ago ( I had forgot about it)

working great with 1.0.5.1.1 and 1.6312555

 

should give some credits to the original zombie-shield, Freaking Fred, I "believe" its his work that was used in the base building

http://opendayz.net/threads/release-freds-anti-zombie-frequency-emitter-aka-zombie-shield.12340/

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
×
×
  • Create New...