Jump to content
  • 0

Vehicle Ammo


Mercules

Question

 

[CHANGED] All armed vehicles now spawn with no ammo and on each restart. You must now find then add your own ammunition to wreak havoc. Change this with by using non "_DZE" classes of vehicles.

 

Anyone care to change this into a less ambiguous statement? I believe it means I have to go in and change all the allowed vehicles... 

Would I have to change it anywhere else?

Link to comment
Share on other sites

22 answers to this question

Recommended Posts

  • 0

it means you have to find the ammo for the vehicles as the ammo is now spawnable loot.

 

Got that from the... 

 

 

All armed vehicles now spawn with no ammo and on each restart.

 

Most people would understand I meant this part...

 

 

Change this with by using non "_DZE" classes of vehicles.

 

Not only is it poorly written but it is vague. 

Link to comment
Share on other sites

  • 0

Got that from the... 

 

 

Most people would understand I meant this part...

 

 

Not only is it poorly written but it is vague. 

 

It is indeed, kinda.

 

As far as i know, there are multiple "versions" of alot of vehicles, for example the chinook classnames:

 

CH-47F

CH-47F_DZ

CH-47F_DZE

 

So if i'm reading the statement correctly, the first and second class as seen above, should still have ammo spawning in them every restart etc (the old way), and the CH-47_DZE shouldn't spawn ammo within it anymore.

 

Next, how to change it?

 

 

I'M NOT SURE ABOUT THIS!:

 

I think you should edit the file called "dynamic_vehicle.sqf" within your missions folder. In this file you will see a list of all vehicle class names that will be spawned in your server. If i understand the statement correctly, you should edit the vehicles ending with _DZE, and replace it with classname vehicles ending with _DZ and with nothing (or something else perhaps, i don't know all class names).

 

I hope i have it the right way, and you will now understand it a little bit better.

Link to comment
Share on other sites

  • 0

Is it possible to mod custom added vehicles to spawn without ammo like the ones epoch changed already? (google ref, me to this topic)

Yes it is. The way I did it is I made a separate script (remove_ammo.sqf) and placed it in the compile folder of the server pbo. It's basic structure looks like this:

private ["_classname","_vehicle"];

_classname = _this select 0;
_vehicle = _this select 1;

if(_classname == "AAAA") then {
	_vehicle removeMagazinesTurret ["BBBB",[CCCC]];
};

AAAA = The classname of the vehicle you want to remove ammo from.

BBBB = The classname of the ammo you want removed. You can use the SIX Config Browser (http://browser.six-projects.net/cfg_vehicles/classlist?utf8=%E2%9C%93&version=63&commit=Change&options[group_by]=faction&options[sort_by]=name&options[faction]=&options[vehicleclass]=Armored) to find the ammo types each vehicle takes. Use the "vehicleclass" dropdown menu to browse different vehicle types. Everything you need should be in Air, Armored, ArmoredD, ArmoredW, Car, CarD, CarW, Ship, or static.

CCCC = The turret path of the ammo you're removing. This one's a bit tricky to find. I used a script I found to get the turret paths and typed up a reference guide for non-Epoch vehicles. Pilot-operated weapons will have a turret path of -1.

 

Here's an example to strip the F35B of all its ammo:

if(_classname == "F35B") then {
	_vehicle removeMagazinesTurret ["300Rnd_25mm_GAU12",[-1]];
	_vehicle removeMagazinesTurret ["2Rnd_GBU12",[-1]];
	_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_F35",[-1]];
};

Add another removeMagazinesTurret line for each mag type, and another if block (like the one above) for each vehicle you want to strip.

 

Once the script is done, you need to execute it from a few different scripts in your server pbo.

 

First the server_functions.sqf. This removes the ammo when vehicles first spawn. After this:

//place vehicle
_veh = createVehicle [_vehicle, _position, [], 0, "CAN_COLLIDE"];
_veh setdir _dir;
_veh setpos _position;

Add this line:

[_vehicle,_veh] execVM "\z\addons\dayz_server\compile\remove_ammo.sqf";

Next is the server_monitor.sqf. This removes the ammo after each restart. After this:

//Create it
_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
_object setVariable ["lastUpdate",time];
_object setVariable ["ObjectID", _idKey, true];

Add this:

[_type,_object] execVM "\z\addons\dayz_server\compile\remove_ammo.sqf";

Finally, the server_publishVehicle2.sqf. This is for when vehicles are purchased. After this:

clearWeaponCargoGlobal  _object;
clearMagazineCargoGlobal  _object;

Add this:

[_class,_object] execVM "\z\addons\dayz_server\compile\remove_ammo.sqf";
Link to comment
Share on other sites

  • 0

It is indeed, kinda.

 

As far as i know, there are multiple "versions" of alot of vehicles, for example the chinook classnames:

 

CH-47F

CH-47F_DZ

CH-47F_DZE

 

So if i'm reading the statement correctly, the first and second class as seen above, should still have ammo spawning in them every restart etc (the old way), and the CH-47_DZE shouldn't spawn ammo within it anymore.

 

Next, how to change it?

 

 

I'M NOT SURE ABOUT THIS!:

 

I think you should edit the file called "dynamic_vehicle.sqf" within your missions folder. In this file you will see a list of all vehicle class names that will be spawned in your server. If i understand the statement correctly, you should edit the vehicles ending with _DZE, and replace it with classname vehicles ending with _DZ and with nothing (or something else perhaps, i don't know all class names).

 

I hope i have it the right way, and you will now understand it a little bit better.

All the new DZ versions are like standard dayz armed vehicles in that they are configured with only one magazine per gun.

Link to comment
Share on other sites

  • 0

 

Yes it is. The way I did it is I made a separate script (remove_ammo.sqf) and placed it in the compile folder of the server pbo. It's basic structure looks like this:

 

 

How would i call this script inside of a .sqf that places static vehicles on the map.

_vehicle_9126 = objNull;
if (true) then
{
  _this = createVehicle ["A10", [4491.2598, 10627.088, -9.1552734e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_9126 = _this;
  _this setDir 58.767944;
  _this setPos [4491.2598, 10627.088, -9.1552734e-005];
  _this setVariable ["Sarge",1,true];

   Call removeammo.sqf //removes ammo based on vehical type.

};

I had it working once, thought i didn't need it and promptly broke it...

Link to comment
Share on other sites

  • 0

I can confirm, MrTesla's script still works in 1.0.4.  Only 2 issues I'm having,...

 

1)  Can't get the ammo out of the Commander's 240 on a Jackal (tried a few different numbers, just to experiment)  (didn't notice at first that this was a 200rnd, not 100rnd mag.)

 

2)  Anyone happen to know the Magazine type on the pook_H13_gunship?  (just went ahead and removed it off my server)

Link to comment
Share on other sites

  • 0

So,.. it would appear that the remove_ammo.sqf method is no longer working in 1.0.4.2.  I had it working perfectly in 1.0.4, then I patched to 1.0.4.2, and it's not working at all.  I double checked and all the script lines are still there.  Anyone have any ideas on what changed that this isn't working now?

Link to comment
Share on other sites

  • 0

what i have just done to remove ALL ammo from vehicles on server start-up and to spawn new vehicles from traders with no ammo is very simple.

 

go into your server_monitor.sqf file.

around line 127-130 you will find this piece of code:

 

 

if (_damage < 1) then {
//diag_log format["OBJ: %1 - %2", _idKey,_type];
 
//Create it
_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
_object setVariable ["lastUpdate",time];
_object setVariable ["ObjectID", _idKey, true];
 
 
just below the "_object setVariable ["ObjectID", _idKey, true];" line place this line of code : _object setVehicleAmmo;
 
next, go into your server_publishVehicle2.sqf file and around line 89 or so you will find this:
 
if(!_donotusekey) then {
// Lock vehicle
_object setvehiclelock "locked";
};
 
clearWeaponCargoGlobal  _object;
clearMagazineCargoGlobal  _object;
// _object setVehicleAmmo DZE_vehicleAmmo;
 
 uncomment out the last line here and replace  "DZE_vehicleAmmo" with 0
 
thats it. very simple. no extra files for your sevrer to worry about.
 
apologies if i made some typos and whatnot, im tired and my backspace key dont work -_-
Link to comment
Share on other sites

  • 0

thank you for this, works like a charm!

private ["_classname","_vehicle"];

_classname = _this select 0;
_vehicle = _this select 1;

if(_classname == "BRDM2_HQ_Gue") then {
	_vehicle removeMagazinesTurret ["100Rnd_762x54_PK",[0]];
};

_classname = _this select 0;
_vehicle = _this select 1;

if(_classname == "RHIB") then {
	_vehicle removeMagazinesTurret ["100Rnd_127x99_M2",[0]];
};

_classname = _this select 0;
_vehicle = _this select 1;

if(_classname == "M240Nest_DZ") then {
	_vehicle removeMagazinesTurret ["100Rnd_762x51_M240",[0]];
};
Link to comment
Share on other sites

  • 0

Just thought I'd share my code for removing ammo from several vehicles that I added to my server's traders. This is based on MrTesla's version: 

if(_classname == "F35B") then {
_vehicle removeMagazinesTurret ["300Rnd_25mm_GAU12",[-1]];
_vehicle removeMagazinesTurret ["2Rnd_GBU12",[-1]];
_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_F35",[-1]];
};


if(_classname == "A10_US_EP1") then {
_vehicle removeMagazinesTurret ["1350Rnd_30mmAP_A10",[-1]];
_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z",[-1]];
_vehicle removeMagazinesTurret ["4Rnd_Sidewinder_AV8B",[-1]];
_vehicle removeMagazinesTurret ["14Rnd_FFAR",[-1]];
_vehicle removeMagazinesTurret ["4Rnd_GBU12",[-1]];
_vehicle removeMagazinesTurret ["2Rnd_Maverick_A10",[-1]];
_vehicle removeMagazinesTurret ["120Rnd_CMFlare_Chaff_Magazine",[-1]];
};


if(_classname == "Su25_TK_EP1") then {
_vehicle removeMagazinesTurret ["120Rnd_CMFlareMagazine",[-1]];
_vehicle removeMagazinesTurret ["180Rnd_30mm_GSh301",[-1]];
_vehicle removeMagazinesTurret ["4Rnd_FAB_250",[-1]];
_vehicle removeMagazinesTurret ["80Rnd_S8T",[-1]];
_vehicle removeMagazinesTurret ["2Rnd_R73",[-1]];
};


if(_classname == "Mi24_D_TK_EP1") then {
_vehicle removeMagazinesTurret ["120Rnd_CMFlareMagazine",[-1]];
_vehicle removeMagazinesTurret ["57mmLauncher_128",[0]];
_vehicle removeMagazinesTurret ["128Rnd_57mm",[-1]];
_vehicle removeMagazinesTurret ["1470Rnd_127x108_YakB",[0]];
_vehicle removeMagazinesTurret ["4Rnd_AT2_Mi24D",[0]];
_vehicle removeMagazinesTurret ["AT2Launcher",[0]];
_vehicle removeMagazinesTurret ["YakB",[0]];
};


if(_classname == "AH1Z") then {
_vehicle removeMagazinesTurret ["120Rnd_CMFlareMagazine",[-1]];
_vehicle removeMagazinesTurret ["M197",[0]];
_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z",[0]];
_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z",[-1]];
_vehicle removeMagazinesTurret ["38Rnd_FFAR",[-1]];
_vehicle removeMagazinesTurret ["750Rnd_M197_AH1",[0]];
_vehicle removeMagazinesTurret ["8Rnd_Hellfire",[0]];
};


if(_classname == "AH64D") then {
_vehicle removeMagazinesTurret ["60Rnd_CMFlareMagazine",[-1]];
_vehicle removeMagazinesTurret ["FFARLauncher",[0]];
_vehicle removeMagazinesTurret ["HellfireLauncher",[-1]];
_vehicle removeMagazinesTurret ["M230",[0]];
_vehicle removeMagazinesTurret ["1200Rnd_30x113mm_M789_HEDP",[0]];
_vehicle removeMagazinesTurret ["38Rnd_FFAR",[-1]];
_vehicle removeMagazinesTurret ["8Rnd_Hellfire",[0]];
};


if(_classname == "AV8B") then {
_vehicle removeMagazinesTurret ["BombLauncher",[-1]];
_vehicle removeMagazinesTurret ["CMFlareLauncher",[-1]];
_vehicle removeMagazinesTurret ["GAU12",[-1]];
_vehicle removeMagazinesTurret ["120Rnd_CMFlare_Chaff_Magazine",[-1]];
_vehicle removeMagazinesTurret ["300Rnd_25mm_GAU12",[-1]];
_vehicle removeMagazinesTurret ["6Rnd_GBU12_AV8B",[-1]];
};


if(_classname == "KA52") then {
_vehicle removeMagazinesTurret ["120Rnd_CMFlare_Chaff_Magazine",[-1]];
_vehicle removeMagazinesTurret ["40Rnd_80mm",[-1]];
_vehicle removeMagazinesTurret ["2A42",[0]];
_vehicle removeMagazinesTurret ["12Rnd_Vikhr_KA50",[0]];
_vehicle removeMagazinesTurret ["230Rnd_30mmAP_2A42",[0]];
};


if(_classname == "KA52Black") then {
_vehicle removeMagazinesTurret ["120Rnd_CMFlare_Chaff_Magazine",[-1]];
_vehicle removeMagazinesTurret ["40Rnd_80mm",[-1]];
_vehicle removeMagazinesTurret ["2A42",[0]];
_vehicle removeMagazinesTurret ["12Rnd_Vikhr_KA50",[0]];
_vehicle removeMagazinesTurret ["230Rnd_30mmAP_2A42",[0]];
};


if(_classname == "Ka60_PMC") then {
_vehicle removeMagazinesTurret ["14Rnd_57mm",[-1]];
};


if(_classname == "AW159_Lynx_BAF") then {
_vehicle removeMagazinesTurret ["1200Rnd_20mm_M621",[-1]];
_vehicle removeMagazinesTurret ["120Rnd_CMFlareMagazine",[-1]];
_vehicle removeMagazinesTurret ["12Rnd_CRV7",[-1]];
_vehicle removeMagazinesTurret ["Laserdesignator_mounted",[0]];
_vehicle removeMagazinesTurret ["Laserbatteries",[0]];
};


if(_classname == "M2A3_EP1") then {
_vehicle removeMagazinesTurret ["1200Rnd_762x51_M240",[0]];
_vehicle removeMagazinesTurret ["210Rnd_25mm_M242_APDS",[0]];
_vehicle removeMagazinesTurret ["210Rnd_25mm_M242_HEI",[0]];
_vehicle removeMagazinesTurret ["2Rnd_TOW2",[0]];
};
Link to comment
Share on other sites

  • 0

Did something change in Epoch since this code was posted? I just put up a new server and I noticed the ammo isn't being stripped even though it's set up the same way it was long ago.

 Hi Zed I have noticed it too did you find out if anything changed.

 

Also on the vehicles you posted ie:

if(_classname == "AH1Z") then {

_vehicle removeMagazinesTurret ["120Rnd_CMFlareMagazine",[-1]];

_vehicle removeMagazinesTurret ["M197",[0]];

_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z",[0]];

_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z",[-1]];

_vehicle removeMagazinesTurret ["38Rnd_FFAR",[-1]];

_vehicle removeMagazinesTurret ["750Rnd_M197_AH1",[0]];

_vehicle removeMagazinesTurret ["8Rnd_Hellfire",[0]];

};

 

also Why is there 2 entries for 2Rnd_Sidewinder_AH1Z do we need a 0 and a -1 entry ?

EDIT found out what the 0 and -1 is  -1= Pilot/driver  and 0 = Gunner

 

Thanks

MegaZ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...