Item Crafting and Weapon Accessories

Please do!

Ok, success. I edited the config.bin and turned off signature verification on my server. Repacked the the dayz.pbo and set it up server side. It works! The FAL now has a nightvision scope. But only for people who have the updated dayz.pbo. Clients with the normal dayz.pbo will still connect normally, but they don't get the thermal vision.

What you do is go into @dayz and rename your dayz.pbo to dayz.old. Then place this file in the directory. Hope this works for you. Good hunting.

*update: I added switchable modes for the FAL. Normal, NV and thermal.
It is NOT necessary to run this server side, just have to make sure its set to not verify signatures.
 
Ok, success. I edited the config.bin and turned off signature verification on my server. Repacked the the dayz.pbo and set it up server side. It works! The FAL now has a nightvision scope. But only for people who have the updated dayz.pbo. Clients with the normal dayz.pbo will still connect normally, but they don't get the thermal vision.

What you do is go into @dayz and rename your dayz.pbo to dayz.old. Then place this file in the directory. Hope this works for you. Good hunting.

*update: I added switchable modes for the FAL. Normal, NV and thermal.
It is NOT necessary to run this server side, just have to make sure its set to not verify signatures.

Thank you very much!

Edit: DayZ Commander says my DayZ is corrupted. Is there some special way to change the mods pbo's?
 
I hope it serves you well. I tried to get a thermal mode for the nv goggles going, but it wouldn't work. I'll be trying a few things there, that's a concept I've wanted to implement for a while.
 
What do I do about DayZ Commander saying DayZ is corrupted? I haven't tried running the game yet so idk if it's just something I'll just have to overlook and ignore since the game will still run.
 
It loads ok for me through day z commander, but I assume it will try to overwrite the changes to "fix" the files. You can ignore what it says about being corrupted.
 
Thanks for this :)

One question ... How would you code to look for more than one of an item in a player's inventory?

For example, how would you change this line to require 2 pieces of wood in inventory ...

if (("PartWoodPile" in magazines player) && ("ItemKnife" in items player)) then {
 
That is a good question. I'm embarrassed to admit I have no idea. I wanted to have it take two cans to make a knife, for example. Having it listed twice does not work. I assume it's bracketed or something similar to how the inventory displays in other places. like (itemname, 2). But I have no idea of the syntax to make that actually work.
 
I was thinking it might require some sort of a loop that counts the woodpiles, first by checking for one, incrementing a counter, removing a woodpile from player, checking again, incrementing counter, ect, until wood is gone. Then it replaces the woodpiles that were removed for the count and you have a counter with the total number in it that you can use to see if they have two, for instance.

Hope that makes sense to you.

I'm not a coder, so this method may be way more complicated than it needs to be :)

Perhaps I'll try some different syntax in the brackets.
 
Ok guys, got another update for the FN FAL. I changed the fire mode from semi/burst to semi/full auto. Source for this script can be found here:
http://www.armaholic.com/page.php?id=11045
I just updated the relevant parts of the config.bin in dayz.pbo.
I haven't tested it much yet, but so far it's awesome. Turns that rifle into a real buzz saw. I don't know how this will work for people not running that version of the pbo, but I will test this and adjust accordingly. Here's the updated link for anyone who wants to try.
http://www.mediafire.com/?cbjzr6auj86415j
 
I'm trying to come up with a script that allows you to swap weapons from your backpack so you don't have to go through the whole inventory. I've been messing around with this script you posted here (I hope that's OK) but I can only get it to remove the weapon you have in your hands and replace it, like what your script does, but not actually swap it. I can't figure out how to command the script to remove the weapon in the backpack or even add one into it. You can check out our terrible progress here:
http://opendayz.net/threads/adding-a-custom-menu-for-tools-items.11863/
 
I'm trying to come up with a script that allows you to swap weapons from your backpack so you don't have to go through the whole inventory. I've been messing around with this script you posted here (I hope that's OK) but I can only get it to remove the weapon you have in your hands and replace it, like what your script does, but not actually swap it. I can't figure out how to command the script to remove the weapon in the backpack or even add one into it. You can check out our terrible progress here:
http://opendayz.net/threads/adding-a-custom-menu-for-tools-items.11863/
Of course I don't mind, after all I originally got this script from Fred. That sounds like a neat idea you have. I hate having to open gear to get at my backup gun. So it sounds like 2 key components to making this work will be detecting the player backpack inventory, and adding/removing from it as well. I don't know too much about it, but I do know that in the mission editor, adding stuff to a backpack is like adding gear to a crate or tent. It's the addweaponcargo command. So if I placed a spare pack on the map, I could put addweaponcargo or addmagazinecargo to place stuff inside its inventory. But I tried that in the script, and nothing happens. I'll keep trying. If I can find a solution I'll post it over there.
 
I have another question ;) Are NVGoggles considered as item? so if i wanted to add them when removed from the Fal to the players inventory would i have to change it to: player addItem ´´NVGoggles``; i guess?

And is there a possibility that you need NVG to add it to the Fal but don´t need it to remove it and that then NVG is added to your inventory? thx in advance
 
I have another question ;) Are NVGoggles considered as item? so if i wanted to add them when removed from the Fal to the players inventory would i have to change it to: player addItem ´´NVGoggles``; i guess?

And is there a possibility that you need NVG to add it to the Fal but don´t need it to remove it and that then NVG is added to your inventory? thx in advance

Yep, very possible. Here's the fn_selfactions code.

Code:
// FN ADD START
 
private ["_rifle"];
_rifle = currentWeapon player;
if ((_rifle in ["FN_FAL"]) && (player ammo _rifle == 0)  && ("NVGoggles" in weapons player)) then {
    hasRifle = true;
} else {
    hasRifle = false;
};
if (player ammo _rifle == 0) then {
    weaponSafe = true;
} else {
    weaponSafe = false;
};
if((speed player <= 1) && hasRifle && weaponSafe && _canDo) then {
    if (addNV < 0) then {
        addNV = player addAction [("<t color=""#0096ff"">" + ("Add Night Vision Scope") +"</t>"),"scripts\AddFN.sqf",_handGun,0,false,true,"", ""];
    };
} else {
    player removeAction addNV;
    addNV = -1;
};
 
// FN ADD END
 
// FN REMOVE START
 
private ["_rifle"];
_rifle = currentWeapon player;
if ((_rifle in ["FN_FAL_ANPVS4"]) && (player ammo _rifle == 0)) then {
    hasRifle = true;
} else {
    hasRifle = false;
};
if (player ammo _rifle == 0) then {
    weaponSafe = true;
} else {
    weaponSafe = false;
};
if((speed player <= 1) && hasRifle && weaponSafe && _canDo) then {
    if (RemNV < 0) then {
        RemNV = player addAction [("<t color=""#0096ff"">" + ("Remove Night Vision Scope") +"</t>"),"scripts\RemFN.sqf",_handGun,0,false,true,"", ""];
    };
} else {
    player removeAction RemNV;
    RemNV = -1;
};
 
// FN REMOVE END

As you can see, the game thinks the NvGs are a weapon. Here's the working code to update your addfn.sqf:

Code:
player playActionNow "Medic";
sleep 1;
titleText ["Adding night vision scope.","PLAIN DOWN"]; titleFadeOut 5;
 
player removeWeapon "NVGoggles";
player removeWeapon "FN_FAL";
sleep 0.01;
player addWeapon "FN_FAL_ANPVS4";
 
titleText ["You have added a night vision scope.","PLAIN DOWN"]; titleFadeOut 5;

and for remFN.sqf:
Code:
player playActionNow "Medic";
sleep 1;
titleText ["Removing night vision scope.","PLAIN DOWN"]; titleFadeOut 5;
 
 
player removeWeapon "FN_FAL_ANPVS4";
sleep 0.01;
player addWeapon "FN_FAL";
player addWeapon "NVGoggles";
 
titleText ["You have removed the night vision scope.","PLAIN DOWN"]; titleFadeOut 5;

That should do it. Hope that works for you. I tested it on mine, works well.
 
Thanks a lot i am going to test it ! ;) Should work i had everything changed but didn´t know if NVG was an item headgear or weapon.. now i know so thank you a lot! :p
 
Works perfectly thx again this community is awesome :D I am only wondering if it is possible ( i know it is i just don´t know how to code it as i am not familiar with arma scripting (modify yes but on my own no ;) ) to make the option a right-click on weapon option : so you won´t have this scrollmenu option anymore.....If someone know how to do it : thx for the answer in advance! ;)
 
Works perfectly thx again this community is awesome :D I am only wondering if it is possible ( i know it is i just don´t know how to code it as i am not familiar with arma scripting (modify yes but on my own no ;) ) to make the option a right-click on weapon option : so you won´t have this scrollmenu option anymore.....If someone know how to do it : thx for the answer in advance! ;)

That, I'm not sure of. It's certainly the ideal implementation for this, since I sometimes select remove NV when I'm trying to cycle guns. As far as I can tell, this would need to use the uiNameSpace setVariable command to work, but I'm not sure of the exact syntax to make it happen. I'll play around with it more and report back.
 
Smokey have you gotten anywhere with the NV goggles capable of having thermal? I tried going into the dayz folder of the dayz pbo (it's like inception!) and edited its settings like the scopes but it doesn't work for me.
 
Smokey have you gotten anywhere with the NV goggles capable of having thermal? I tried going into the dayz folder of the dayz pbo (it's like inception!) and edited its settings like the scopes but it doesn't work for me.
Not much farther, I'm afraid. I tried changing it in the config.bin but no go. There were a couple of things I wanted to do to the nvgs. Another was implement this script that gave you a full field of view for them instead of looking through that oval. But neither worked. NvGs must be different in some way than the rangefinder or weapon scopes.
 
Back
Top