Jump to content

Recommended Posts

   This is Enhanced Vehicle Deployment - retooled for deploying mounted weapons.

 

   I do not take credit for any of the script.  I just made a how-to because a few people asked for it.

 

http://youtu.be/oASs2_RUX88

     Features:

  • Right click on gems to deploy mounted weapons.  Emerald excluded.
  • Easy to configure any way you want.
  • Topaz = DSHkM .50 cal
  • Citrine = M2 .50 cal
  • Amethyst = KORD .50 cal
  • Sapphire = AGS Grenade Launcher
  • Ruby = MK19 Grenade Launcher
  • Obsidian = GMG Grenade Launcher
  • The .50 cal guns have optional tripod sizes: high or mini.
  • The grenade launchers just have minitripods.
  • Most of the ammunition for these weapons can be found in ammo crates.  Excluding KORD ammo.
  • Repack Weapon into gem form.  Deploy and repack as many times as you want.
  • Anyone can pack the weapons if it's unlocked.  Requires a toolbox
  • Also allows packing of M240 nests into M240Nest_Kit. Requires a toolbox
  • Stop deployment by moving.
  • Prevent packing of destroyed deployable vehicles.
  • Prevent packing of locked vehicles.
  • Materials are dropped on the ground when packing like the other remove actions (workbench, wreckage, weapons crates) instead of automatically added to the player's inventory.
  • Remove ammo from all vehicles when deployed.

   Credits

  • oOSmokyOo for on which EVD was developed from.
  • maca134 for his wonderful Right Click Options to Items script.
  • TheVampire whose DZMS gave plenty of ideas on how to rework this script.
  • [VB]AWOL whose code in player_craftItem.sqf and remove.sqf were referenced for some parts of the deployment script.
  • [VB]AWOL whose player_build.sqf was used for building the weapons.
  • TheFarix whose release: is the foundation of this how-to.
  • SiothieGaming whose Remove Weapons Script allows better customization of vehicles.

   Requirements

  • Right Click Options Script and knowledge how it works.  I don't know a link to one, so you have to find it yourself.
  • Remove Weapons/Ammunition/Thermal from Vehicle Script and how it works
  • Custom variables.sqf and knowledge how it works.
  • Custom fn_selfActions.sqf and knowledge how it works.
  • Knowledge of and how it works.

   Installation

 

      Step 1.  Install Right Click Options Script, and install Remove Weapons/Ammo Script.

 

      Step 2.  Open your fnc_remWepSG.sqf (Remove Weapons/Ammo Script) and change it to this:

	//Remove Weapon SiothieGaming german Youtubechannel: http://www.youtube.com/user/SiothieGaming
{
	if (_object isKindof "KORD") then {
         _object setVehicleAmmo 0;
		 _ownerID = "0";
	};
	if (_object isKindof "KORD_high") then {
         _object setVehicleAmmo 0;
		 _ownerID = "0";
	};
	if (_object isKindof "DSHkM_Mini_TriPod") then {
         _object setVehicleAmmo 0;
		 _ownerID = "0";
	};
	if (_object isKindof "DSHKM_Gue") then {
         _object setVehicleAmmo 0;
		 _ownerID = "0";
	};
	if (_object isKindof "M2HD_mini_TriPod") then {
         _object setVehicleAmmo 0;
		 _ownerID = "0";
	};
	if (_object isKindof "MK19_TriPod") then {
         _object setVehicleAmmo 0;
		 _ownerID = "0";
	};
	if (_object isKindof "M2StaticMG_US_EP1") then {
         _object setVehicleAmmo 0;
		 _ownerID = "0";
	};
	if (_object isKindof "AGS_RU") then {
         _object setVehicleAmmo 0;
		 _ownerID = "0";
	};
	if (_object isKindof "BAF_GMG_Tripod_D") then {
         _object setVehicleAmmo 0;
		 _ownerID = "0";
	};
	
} forEach vehicles; 

                    Save it and repack your dayz_server.pbo.

 

      Step 3.  In your extra_rc.hpp (Extra Right Click Script), add this:

    class ItemSapphire {
	    class AGS {
			text = "Build AGS Grenade Launcher";
			script = "execVM 'Scripts\AGS_RU.sqf'";
		};
    };
	class ItemObsidian {
	    class GMG {
			text = "Build GMG Grenade Launcher";
			script = "execVM 'Scripts\BAF_GMG_Tripod_D.sqf'";
		};
    };
	class ItemTopaz {
	    class bigDSHkM {
			text = "Build DSHkM w/ TriPod";
			script = "execVM 'Scripts\DSHkM_Gue.sqf'";
		};
		class smallDSHkM {
			text = "Build DSHkM w/ MiniTriPod";
			script = "execVM 'Scripts\DSHkM_Mini_TriPod.sqf'";
		};
    };
	class ItemRuby {
	    class MK19 {
			text = "Build MK19 Grenade Launcher";
			script = "execVM 'Scripts\MK19_TriPod.sqf'";
		};
    };
	class ItemCitrine {
	    class bigM2 {
			text = "Build M2 50cal w/ TriPod";
			script = "execVM 'Scripts\M2StaticMG_US_EP1.sqf'";
		};
		class smallM2 {
			text = "Build M2 50cal w/ MiniTriPod";
			script = "execVM 'Scripts\M2HD_mini_TriPod.sqf'";
		};
    };
	class ItemAmethyst {
	    class bigKORD {
			text = "Build KORD 50cal w/ TriPod";
			script = "execVM 'Scripts\KORD_high.sqf'";
		};
		class smallKORD {
			text = "Build KORD 50cal w/ MiniTriPod";
			script = "execVM 'Scripts\KORD.sqf'";
		};
    };

 

      Step 4.  In your custom variables.sqf, find this:

dayz_allowedObjects = StaticVehicleArray + ["TentStorage","TentStorageDomed","TentStorageDomed2", "VaultStorageLocked", "Hedgehog_DZ", "Sandbag1_DZ","BagFenceRound_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","Generator_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ","WoodFloor_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodStairsRails_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","MetalFloor_DZ","WoodRamp_DZ","GunRack_DZ","FireBarrel_DZ","WoodCrate_DZ","Scaffolding_DZ"];

                   And add "StaticVehicleArray + " without the quotes, as I did.

 

 

      Step 5. Again in variables.sqf, above dayz_allowedObjects = StaticVehicleArray + ... add this:

StaticVehicleArray = ["M240Nest_DZ","AGS_RU","MK19_TriPod","BAF_GMG_Tripod_D","M2StaticMG_US_EP1","M2HD_mini_TriPod","KORD_high","KORD","DSHkM_Mini_TriPod","DSHKM_Gue"];

    Step 6.  Again in variables.sqf find this line:

DZE_isRemovable = ["Fence_corrugated_DZ","ParkBench_DZ","Plastic_Pole_EP1_DZ","FireBarrel_DZ","Scaffolding_DZ"];

                  and remove "M240Nest_DZ", as I did.

 

 

    Step 7.  Again in variables.sqf find this line:

	DZE_safeVehicle = StaticVehicleArray + ["ParachuteWest","ParachuteC"];

                 and add "StaticVehicleArray + " without the quotes, as I did.

 

 

     Step 8.  In your custom fn_selfActions.sqf, find this:

      // All Traders

and above it add:

//Pack Vehicles
	if (_typeOfCursorTarget in StaticVehicleArray and _hasToolbox and !(locked _cursorTarget) and (damage _cursorTarget < 1)) then {
		if (s_player_packvehicle < 0) then {
			s_player_packvehicle = player addAction ["Pack Vehicle", "Scripts\static_pack.sqf",_cursorTarget, 0, false, true, "",""];
		};
	} else {
		player removeAction s_player_packvehicle;
		s_player_packvehicle = -1;
	};

 

     Step 9.  In your init.sqf, find this:

MaxMineVeins = 0;

                    and set it to 0, as I did.  Or at least a very low number.

 

 

     Step 10.  Download the attachment and copy the Scripts folder to your mission pbo, where the init.sqf is.

 

Dropbox

 

Notes:

More then one player can deconstruct and get items from a single ore vein.  So groups of players can easily exploit them for gems if you do not limit the MaxMineVeins.

You can spawn in mine veins using Gold_Vein_DZE for missions or events or well defended areas for rewards.

You can add the gems and the ammo to the traders.

If you want something to give the sledgehammer new meaning, consider this: I've played with it and about 95%+ of the time it just breaks the tools anyway.  Otherwise I would recommend finding some new creative use for the sledge, rather than removing it.

If I can find a good item to use for searchlights I will add it to the download.  You could I guess change the KORD to be searchlight.  Feel free to change things to suit your needs.

I know that this could have been done in 3 files or less, instead of 11. I admit I am a very novice at this.  It's the best I could do at the moment. 

I've tested it on my server and seems to be working on 1.0.5.1/125402

Edited by Brockie
Link to comment
Share on other sites

**RESERVED**

 

I was tired when I released this and I forgot to add the Remove Ammo script.  So I updated Step 1 and Step 2, the requirements and the credits. 

 

If anyone has this installed, get this script for removing ammo and unlocking the vehicles at restart:

 

http://opendayz.net/threads/release-remove-weapons-ammunition-thermal-from-vehicle-epoch-version.18044/

 

Just install that and do Step 2.

Link to comment
Share on other sites

Hmm  I do not use the default EVD and I have never tried to merge the two.  But when I get some time in the next couple days I will try to figure it out and make an update.  Sorry for the inconvenience.

Link to comment
Share on other sites

its some thing to do with fn_self_actions.sqf

 

THis is my code:

 
They both conflict. If the bike deploy script doesnt see a bike. It removes the menu. Then the gun deploy script sees it and activates the menu.
 
Easy fix would be to change s_player_packvehicle to something else.
//Pack Vehicles
if (_typeOfCursorTarget in EVDVehicleArray and _hasToolbox and !(locked _cursorTarget) and (damage _cursorTarget < 1)) then {
if (s_player_packvehicle < 0) then {
s_player_packvehicle = player addAction ["Pack Vehicle", "custom\EVD\EVD_pack.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_packvehicle;
s_player_packvehicle = -1;
};


//Pack Vehicles
if (_typeOfCursorTarget in StaticVehicleArray and _hasToolbox and !(locked _cursorTarget) and (damage _cursorTarget < 1)) then {
if (s_player_packvehicle < 0) then {
s_player_packvehicle = player addAction ["Pack Vehicle", "scripts\static_pack.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_packvehicle;
s_player_packvehicle = -1;
};


// All Traders
Link to comment
Share on other sites

 

its some thing to do with fn_self_actions.sqf

 

THis is my code:

 
//Pack Vehicles
if (_typeOfCursorTarget in EVDVehicleArray and _hasToolbox and !(locked _cursorTarget) and (damage _cursorTarget < 1)) then {
if (s_player_packvehicle < 0) then {
s_player_packvehicle = player addAction ["Pack Vehicle", "custom\EVD\EVD_pack.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_packvehicle;
s_player_packvehicle = -1;
};


//Pack Vehicles
if (_typeOfCursorTarget in StaticVehicleArray and _hasToolbox and !(locked _cursorTarget) and (damage _cursorTarget < 1)) then {
if (s_player_packvehicle < 0) then {
s_player_packvehicle = player addAction ["Pack Vehicle", "scripts\static_pack.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_packvehicle;
s_player_packvehicle = -1;
};


// All Traders

 

 

Yup I can see the problem too, but I don;t know which way is the best to address it yet.

 

In particular it is this part this is giving the problem:

player removeAction s_player_packvehicle;
s_player_packvehicle = -1;

Those lines are what make the option go away, and because it is the same in both scripts, duplicated it is a problem.

 

Try this: 

//Pack Vehicles
if (_typeOfCursorTarget in EVDVehicleArray and _hasToolbox and !(locked _cursorTarget) and (damage _cursorTarget < 1)) then {
if (s_player_packvehicle < 0) then {
s_player_packvehicle = player addAction ["Pack Vehicle", "custom\EVD\EVD_pack.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
if (_typeOfCursorTarget in StaticVehicleArray and _hasToolbox and !(locked _cursorTarget) and (damage _cursorTarget < 1)) then {
if (s_player_packvehicle < 0) then {
s_player_packvehicle = player addAction ["Pack Vehicle", "scripts\static_pack.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_packvehicle;
s_player_packvehicle = -1;
};

Link to comment
Share on other sites

BTW, when you look at the gun. You get the pack vehicle option. You might wanna change that to Pack Gun.

 

Also When your cursor moves away from the target. You still have the pack option. Also if its already packed. You still have the option. This was a problem in Original EVD too. Is there a fix? 

Link to comment
Share on other sites

Yes there is a fix.  If the option to pack is not going away find this:

 
player removeAction s_player_packtent;
s_player_packtent = -1;
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
player removeAction s_player_studybody;
s_player_studybody = -1;

and under it put this:

player removeAction s_player_packvehicle;
s_player_packvehicle = -1;

Although, I just want to say that mine doesn't have this issue.  My option to pack disappears with a quickness as soon as I look away from the guns.  But this should help I think

Link to comment
Share on other sites

  • 3 weeks later...

@AG.Ndogg97 this is definitely possible, you would need to change the values in extra_rc.hpp to something like this:

 
class ItemSapphire {
     class AGS {
            text = "Build AGS Grenade Launcher";
            script = "execVM 'Scripts\AGS_RU.sqf'";
        };
     class GMG {
            text = "Build GMG Grenade Launcher";
            script = "execVM 'Scripts\BAF_GMG_Tripod_D.sqf'";
        };
     class MK19 {
            text = "Build MK19 Grenade Launcher";
            script = "execVM 'Scripts\MK19_TriPod.sqf'";
        };
};
  
    class ItemTopaz {
         class bigDSHkM {
            text = "Build DSHkM w/ TriPod";
            script = "execVM 'Scripts\DSHkM_Gue.sqf'";
        };
        class smallDSHkM {
            text = "Build DSHkM w/ MiniTriPod";
            script = "execVM 'Scripts\DSHkM_Mini_TriPod.sqf'";
        };
        class bigM2 {
            text = "Build M2 50cal w/ TriPod";
            script = "execVM 'Scripts\M2StaticMG_US_EP1.sqf'";
        };
        class smallM2 {
            text = "Build M2 50cal w/ MiniTriPod";
            script = "execVM 'Scripts\M2HD_mini_TriPod.sqf'";
        };
         class bigKORD {
            text = "Build KORD 50cal w/ TriPod";
            script = "execVM 'Scripts\KORD_high.sqf'";
        };
        class smallKORD {
            text = "Build KORD 50cal w/ MiniTriPod";
            script = "execVM 'Scripts\KORD.sqf'";
        };
};

That way all grenade launchers can be built with sapphires and all MGs with Topazes 

 

Thats the theory of it! I would give it a crack but I just broke my dev server trying to use the remove ammo script :P so I cannot be much more help than this 

Link to comment
Share on other sites

Hi Nice script, But is there a way of making the guns once deployed they cant be re-packed up?

 

The reason I have a lot of missions on my server and I can see some one buying one and just setting it up 5-600 meters away and killing all AI in mission in 10 second, So I just want to know if Gun can be fixed in the placed position and not be removed.

MegaZ

Link to comment
Share on other sites

Hi Nice script, But is there a way of making the guns once deployed they cant be re-packed up?

 

The reason I have a lot of missions on my server and I can see some one buying one and just setting it up 5-600 meters away and killing all AI in mission in 10 second, So I just want to know if Gun can be fixed in the placed position and not be removed.

MegaZ

remove the part you added in self actions and boom.

Link to comment
Share on other sites

Thats the theory of it! I would give it a crack but I just broke my dev server trying to use the remove ammo script :P so I cannot be much more help than this 

 

If you need help with it send me a PM and I can try to help

Link to comment
Share on other sites

@AG Ndogg97

 

I am guessing the script worked? Glad I could be of assstance! I am not a coder or scripter at all  :P I have just messed around with this stuff and picked up a thing or two along the way. Keep trying to implement scripts, read the forums extensively and ask questions.The community is pretty darn good in that sense.

 

@Brockie

 

Thanks mate, for some reason my Infistar stopped working entirely (Although it loaded successfully in the RPT etc.) I reverted to a previous version of my mission in my github and it solved the issue. I cannot be 100% certain that the issue was related to the remove ammo script but it was the last addition before things got weird. The author does warn of a game break relating to the remove thermal aspect of the mod hence my suspicion. Either way I am back on track now pushing ahead with my server.

Link to comment
Share on other sites

Anyone else having the remove ammo script work when you initially deploy the mounted weapon but after restart the weapons have full ammo?

 

fnc_remWepSG.sqf

if (_object isKindof "KORD_high") then {
_object setVehicleAmmo 0;
         _ownerID = "0";

In particular the _ownerID = "0" section is what I believe is causing the issue...when I removed that section it seemed to work fine.

 

Is there any particular reason that particular line of code was added? I cannot seem to work out what it would really achieve?

Link to comment
Share on other sites

Anyone else having the remove ammo script work when you initially deploy the mounted weapon but after restart the weapons have full ammo?

 

fnc_remWepSG.sqf

if (_object isKindof "KORD_high") then {
_object setVehicleAmmo 0;
         _ownerID = "0";

In particular the _ownerID = "0" section is what I believe is causing the issue...when I removed that section it seemed to work fine.

 

Is there any particular reason that particular line of code was added? I cannot seem to work out what it would really achieve?

 

Nope.  When I restart my server the remove ammo script takes care of all my mounted weapons and custom vehicles.

 

Go back to the installation of that script and take another look at the part that says:

 

 

 

Go to your server_monitor.sqf, server_publishVehicle2.sqf and server_publishVehicle3.sqf and add this

Code (Text):
            //Remove Weapon by SiothieGaming start

            call fnc_remWepSG;

            //Remove Weapon by SiothieGaming end

 

 

Pretty sure you missed the server_monitor.sqf or one of the publishVehicle files.

 

_ownerID = "0"; is what makes it unlocked.

 

BTW I use infiSTAR with this and it is no issue at all.  My best guess is that someone had made changes to your antihack but never refreshed the PBO? maybe... that could explain it suddenly not working.  

Link to comment
Share on other sites

I definitely got server_monitor.sqf, and the publishVehicle2 and 3 done. I never had the items lock after restarts even after I removed that piece of code. Are they supposed to give you a key when you create them?

 

I am wiping my server and going to try this all again fresh.  

Link to comment
Share on other sites

Nope, they do not give a key when you build them. This uses a modified player_build.sqf (renamed for each gun) and building in epoch does not give keys. If you modified those files you might be able to make it give you keys but I personally do not want to go there. I prefer that they be unlocked, sorry. A vehicle with _ownerID = 0 will be unlocked. When you build a gun I think I put it in the code for when you build it. Take a look in the gun build code for the same line about owner ID. If i'm right tthat is why they are unlocked all the time. So you would need to take out those lines too. I'm at work right now, so I'll take a look later. For server restarts it is the server_monitor that would be calling the FNC_wepRemSG. Please post your server monitor.sqf and your FNC_wepRemSG in a spoiler or on pastebin, or you can pm me.

And just to make it clear this is not a release by me, it is just a how to for modifying the existing scripts but I have no plans to make new versions. I will still gladly help where I can but my knowledge of the coding is still novice at best.

Link to comment
Share on other sites

Thanks Brockie, I appreciate the help. I know you did not write the original scripts but you at least have a better understanding of their workings than I do :D

 

I am rebuilding slowly as we speak doing 1 mod at a time and ensuring I use version control so errors are easier to trace. If I get super stuck I will paste the requested code, however I find that perseverance really does pay off with this stuff as you learn a lot more. I had this all working before and I did something silly and thus had to restart.

 

My ultimate aim here is to switch out the KORD for the spotlight (simple enough and you already made mention of this) and then for emeralds (assuming that I do not use the emerald interior designer) I was going to attempt to implement laptops and loudspeakers for the CCTV mod. Easy enough to implement once the base code is all installed as it is just configuration and watching for the right syntax. I like the fact that you included the "pack" script which really makes for interesting times.

 

As a side note, do you have any idea how to implement these items with Raymix's SnapBuildPro? I need to watch his 30min tutorial on the player_build.sqf file and how it works but there must be a way of running the construction aspects of this through that mod. 

 

Enough of my rambling! I will let you (any anyone else interested in this) know how I progress.

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
  • Discord

×
×
  • Create New...