Remove barbed wire

Shibdib

Member
Its a trollish item so I'd like to remove it.

Would simply removing it from the deployable tab in the DB be enough to keep it from being deployed?
 
Totally agree, the amount of graphical glitches they cause for one. Have been looking at adding a routine to change all wire to tank traps on server restarts..
 
I managed to remove it by replacing the barbed wire loot spawns with a ""

Theirs a tunngle thread on this but in my custom weapon spawn spawn_loot.sqf I also got rid of barbed wire spawns

Code:
private["_itemType","_iPos","_indexLootSpawn","_iArray","_iItem","_iClass","_item","_qty","_max","_tQty","_arrayLootSpawn","_canType"];
// [_itemType,_weights]
_iItem =    _this select 0;
_iClass =    _this select 1;
_iPos =        _this select 2;
_radius =    _this select 3;
_holderItem = _iItem;
switch (_iItem) do {
        case "BAF_AS50_scoped": { _holderItem = "BAF_LRR_scoped_W"};
        case "M107_DZ": { _holderItem = "SVD"};
        case "M1014": { _holderItem= "Saiga12K"};
        case "Mk_48_DZ": { _holderItem= "Pecheneg"};
        case "M4A1_AIM_SD_camo": { _holderItem = "G36K"};
        case "FN_FAL_ANPVS4": { _holderItem = "AK_107_pso"};
        case "10Rnd_127x99_m107": { _holderItem = "5Rnd_86x70_L115A1"};
        case "ItemFlashlightRed": { _holderItem = "DZ_Assault_Pack_EP1"};
        case "ItemWire": { _holderItem = ""};
        case "8Rnd_B_Beneli_74Slug": { _holderItem = "8Rnd_B_Saiga12_74Slug"};
        case "30Rnd_556x45_G36": { _holderItem = "100Rnd_762x54_PK"};
        case "2Rnd_shotgun_74Slug": { _holderItem = "8Rnd_B_Beneli_74Slug"};
        case "2Rnd_shotgun_74Pellets": { _holderItem = "8Rnd_B_Beneli_Pellets"};
    case "DMR": { _holderItem = "Huntingrifle"};
    case "20Rnd_762x51_DMR": { _holderItem = "5x_22_LR_17_HMR"};
    case "MP5SD": { _holderItem = "MP5A5"};
    case "30Rnd_9x19_MP5SD": { _holderItem = "30Rnd_9x19_MP5"};
    case "bizon_silenced": { _holderItem = "Bizon"};
    case "64Rnd_9x19_SD_Bizon": { _holderItem = "64Rnd_9x19_Bizon"};
    case "ItemMap": { _holderItem = "ItemBandage"};
        default {};
        };
_iItem = _holderItem;
switch (_iClass) do {
        default {
                //Item is food, add random quantity of cans along with an item (if exists)
                _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
                _arrayLootSpawn = [] + getArray (configFile >> "cfgLoot" >> _iClass);
                _itemType = _arrayLootSpawn select 0;
                _weights = _arrayLootSpawn call fnc_buildWeightedArray;
                _qty = 0;
                _max = ceil(random 4) + 1;
                //diag_log ("LOOTSPAWN: QTY: " + str(_max) + " ARRAY: " + str(_arrayLootSpawn));
                while {_qty < _max} do {
                        private["_tQty","_indexLootSpawn","_canType"];
                        _tQty = floor(random 1) + 1;
                        //diag_log ("LOOTSPAWN: ITEM QTY: " + str(_tQty));
                     
                        _indexLootSpawn = _weights call BIS_fnc_selectRandom;
                        _canType = _itemType select _indexLootSpawn;
                     
                        _holderItem = _canType;
                        switch (_canType) do {
                                case "10Rnd_127x99_m107": { _holderItem = "5Rnd_86x70_L115A1"};
                                case "2Rnd_shotgun_74Slug": { _holderItem = "8Rnd_B_Beneli_74Slug"};
                                case "2Rnd_shotgun_74Pellets": { _holderItem = "8Rnd_B_Beneli_Pellets"};
                case "64Rnd_9x19_SD_Bizon": { _holderItem = "64Rnd_9x19_Bizon"};
                case "30Rnd_9x19_MP5SD": { _holderItem = "30Rnd_9x19_MP5"};
                case "20Rnd_762x51_DMR": { _holderItem = "5x_22_LR_17_HMR"};
                                default {};
                                };
                        _canType = _holderItem;
                     
                        //diag_log ("LOOTSPAWN: ITEM: " + str(_canType));
                        _item addMagazineCargoGlobal [_canType,_tQty];
                        _qty = _qty + _tQty;
                };
                if (_iItem != "") then {
                        _item addWeaponCargoGlobal [_iItem,1];
                };
        };
        case "weapon": {
                //Item is a weapon, add it and a random quantity of magazines
                _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
                _item addWeaponCargoGlobal [_iItem,1];
                _mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines");
                if (count _mags > 0) then {
                        _item addMagazineCargoGlobal [(_mags select 0),(round(random 2))];
                };
        };
        case "magazine": {
                //Item is one magazine
                _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
                _item addMagazineCargoGlobal [_iItem,1];
        };
        case "object": {
                //Item is one magazine
                _item = createVehicle [_iItem, _iPos, [], _radius, "CAN_COLLIDE"];
        };
};
if (count _iPos > 2) then {
        _item setPosATL _ipos;
};


case "ItemWire": { _holderItem = ""};
 
Could you change instances of Wire spawn to somethin else by adding it into the _holderitem ?

Code:
case "ItemWire": { _holderItem = "ItemBandage"};
 
Could you change instances of Wire spawn to somethin else by adding it into the _holderitem ?

Code:
case "ItemWire": { _holderItem = "ItemBandage"};

Yup you can add any dayz item or weapon in there... so instead of wire you want beans to spawn.. then beans it is.


Note: That script above is the best anti hack I have.. swap all the highly spawned items out and now whenever someone spawns it and its in their inventory my anti hack kicks em :D


http://www.tunngle.net/community/topic/103541-dayz-loot-substitution-or-suppression-in-mpmission/

^^ the original thread
 
Yay, got it working.. Decided to test it with something rare:
mountain_dew.jpg


Can't say I have seen a can of Mountain Dew in the factory before.

One post by jwo7777777 was particularly useful for me as a beginner:

Don't change the dayz_code original unless you are making your own client release or want to experience all kinds of errors, burps, and frustrations of a non-working server to which nobody can connect.

1) You make a copy of the spawn_loot.sqf file from the dayz_code.pbo that is distributed with the client (client being the files that are in the @dayz or @dayzlingor, etc.... ) (If you dont know how to unpack a .pbo, you need cPBO.exe or Eliteness or some similar program ... poke around on the Armaholic websites for the files and how to do it.)

2) You modify the copy of spawn_loot.sqf with the changes you want.

3) You put the modified copy somewhere in the mpmission for your server. I run bliss setup. I put my spawn_loot.sqf inside <arma2 folder>/mpmissions/dayz_1.lingor/fixes/. Originally bliss builds a dayz_1.lingor.pbo in the mpmissions, but I unpack it, make my changes (and then repack it later if I want).

4) Modify your init.sqf to include spawn_loot = compile ... blah blah ... fixes\spawn_loot.sqf. Notice that the "fixes\spawn_loot.sqf" is a relative path to the init.sqf file.

5) Repack your dayz_1.lingor directory to dayz_1.lingor.pbo (if you want. If you choose to NOT repack, then delete the original dayz_1.lingor.pbo so that the server will still load the unpacked files. If you do not do this, the server will use the unchanged .pbo.)

If you do repack, then all the changed files must be part of the repack. This is why it is recommended to put your changed files in a "fixes" folder that is located under the mpmission\dayz_<instance>.<world> folder.

(For dayz server builds other than bliss, your mileage may vary. In other words, this is a general guide, not a step by step instruction.)

Thanks for the code Shibdib, has really got me on my way scripting :)
 
Back
Top