Jump to content

[Release] Add Vehicle Weapons


Zoranth

Recommended Posts

Based on Hacked Vehicles release by @Bricktop and Additional code by @Hooty from here:

Spoiler

 

This is my first release
This mod and code is not all my original work. 
Credits to: 
@Bricktop for the "Hacked Vehicles" https://epochmod.com/forum/topic/43750-hacked-vehicles-1061/
@Hooty for his input in Bricktop's release on how to install it differently and to add support for Virtual Garage.

What I did is took their information and made it modular and easier to install / customize. This way, you just need to #include which weapon systems you want to add into each vehicle that you want to modify.

>> DOWNLOAD HERE <<  CURRENTLY ON HOLD DUE TO UNFORESEEN ERROR

Install Directions:

1.    Copy the Vehicle_Weapons directory into the root of your dayz_server directory

2.    Next paste

#include "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf"; 

  in dayz_server\system\sever_monitor.sqf under

Spoiler

//Dont add inventory for traps.
        if (!_isDZ_Buildable && !_isTrapItem) then {
            clearWeaponCargoGlobal _object;
            clearMagazineCargoGlobal _object;
            clearBackpackCargoGlobal _object;

3.    Then paste

#include "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf";

 in dayz_server\compile\server_publishVehicle2.sqf under

Spoiler

clearWeaponCargoGlobal  _object;
clearMagazineCargoGlobal  _object;

4.    Then paste

#include "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf";  

in dayz_server\compile\spawn_vehicles.sqf under

Spoiler

clearWeaponCargoGlobal  _veh;
clearMagazineCargoGlobal  _veh;

Installation with Virtual Garage:
If you have @salival's Virtual Garage installed then add :

#include "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf"; 

 to dayz_server\compile\garage\server_spawnVehicles.sqf under

Spoiler

    clearWeaponCargoGlobal  _object;
    clearMagazineCargoGlobal  _object;

How To Customize:

If you would like to create your very own weapons pack for a vehicle, use the following instructions:

1. Make a copy of "\z\addons\dayz_server\Vehicle_Weapons\vehicles\Generic_Add_Weapon.sqf" rename it like "<vehicle_classname>_Add_Weapons.sqf". Replace the <vehicle_classname> with the actual classname of the vehicle you want to add weapons to.

2. Comment out or Delete the Weapon_Systems that you do not want to use on your new vehicle.

3. Make a new #include "\z\addons\dayz_server\Vehicle_Weapons\vehicles\<Class_Name>_Add_Weapons.sqf"; line with your new vehicle file and add it to "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf";

4. In the new vehicle file you just made.  Rearrange the Weapon_Systems in an order that makes sense to you. For example, list all guns, then all missiles so they are grouped together in your scroll menu for easier selection.

Adding / Restricting an Ammo Type

For Weapon_Systems that have multiple ammo types, You can go into that specific file and comment out an ammo type or make an extra file with just the ammo you want if you want to restrict it from your server. Example:

In the file: "\z\addons\dayz_server\Vehicle_Weapons\Vehicles\Weapon_Systems\D81_125mm_Cannon.sqf". You could comment out an Ammo Type as shown Below.

Spoiler

/* 125mm Cannon Used on the T72 Tank*/
        _object addWeapon "D81";
//                _object addMagazine "22Rnd_125mmHE_T72";
 //               _object addMagazine "22Rnd_125mmHE_T72";
                _object addMagazine "23Rnd_125mmSABOT_T72";
                _object addMagazine "23Rnd_125mmSABOT_T72";

If you do this, you will want to save that as a new file such as : "D81_125mm_Cannon_SABOT_ONLY.sqf.

List of Vehicle Weapons and Ammo:

WARNING: Not all Weapon Systems work with all vehicles. For example, You obviously do not want to put a "GBU12_Bomb_Launcher" on an "ArmoredSUV_PMC", or "MLRS Rocket System" on the "ArmoredSUV_PMC".

These weapons spawn on the vehicle when purchased and remain after restart.  This does not work with admin spawned vehicles nor does it work (for now) with the Deploy Anything Mod.  I do not have Virtual Garage installed on my test server,so I am unable to test that but it should work.

Have Fun

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...