Jump to content

[release] 1.0.5.1 - Weapon Attachment Mod 1.1.0 - Remove/Add attachments to weapons


Recommended Posts

instead of calling from bottom of mission init

 

could i call from my custom compiles instead like so?

 

2icbocy.png

if they are at the end after all of the vanilla dayz stuff then that *"should** be okay. i notice you have some of the path changed, just make sure you rename all the relative paths in the scripts or else they wont be found

Link to comment
Share on other sites

sorry, my blind eyes!!!

 

// use the hint version of the weapon mod inventory? change to false if it conflicts with your debug monitor. */
DZE_WEAPON_MOD_USE_HINT_INVENTORY = false;

 

Is it possible to use right click for GPS only to scan players, vehicles and zombies around???

 

b_560_95_1.png

Link to comment
Share on other sites

This script is great.  Not only is it something that I've wanted and been waiting for, and it works great, but it's also a great replacement for my old right click option script!

 

 

Just one thing I noticed.  I tried to format my config.sqf similar to this: (but for custom building script)

 

 

DZE_CLICK_ACTIONS = [

["ItemZombieParts","Smear Guts on you","[] execVM ""custom\walkamongstthedead\smear_guts.sqf"";","true"],
["ItemWaterbottle","Wash zombie guts","[] execVM ""custom\walkamongstthedead\usebottle.sqf"";","true"]
];

 

 

with brackets [] execVM and double quotes ""on each side"" of script path

Didn't work, in-game nothing would happen the first time I tried, and second time I tried it would say 'building already in progress' or something

 

I removed the brackets, so just execVM now, changed the double quotes back to single apostrophe 'on each side' and it worked!

 

Thank you!

Link to comment
Share on other sites

Would this work?

Its a simple buy scripts, used to be triggered via selfactions

 

private["_part_out","_part_in","_qty_out","_qty_in","_textPartIn","_textPartOut","_qty","_needed","_started","_finished","_animState","_isMedic","_abort","_removed","_tradeCounter","_total_trades","_humanityGain","_humanity""_mod","_old","_new","_upg","_selected","_message","_wait","_waited","_inventory","_muzzles"];

// [part_out,part_in, qty_out, qty_in,];
 
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
 
//_activatingPlayer = getPlayerUID player;
_mod = "Suppressor";
_part_out = _mod;
_part_in = "ItemGoldBar";
_qty_out = 1;
_qty_in = 1;
// _buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
//_traderID = (_this select 3) select 7;
 
_qty = {_x == _part_in} count magazines player;
 
// find total number of possible trades
_total_trades = floor (_qty / _qty_in);
 
if(_total_trades < 1) exitWith { 
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
DZE_ActionInProgress = false;
};
 
_abort = false;
_tradeCounter = 0;
 
// trade all items
for "_x" from 1 to _total_trades do {
 
_removed = 0;
 
_tradeCounter = _tradeCounter + 1;
 
if(_total_trades == 1) then {
cutText [format[(localize "str_epoch_player_105"),_tradeCounter,_total_trades] , "PLAIN DOWN"];
} else {
cutText [format[(localize "str_epoch_player_187"),_tradeCounter,_total_trades] , "PLAIN DOWN"];
};
[1,1] call dayz_HungerThirst;
player playActionNow "PutDown";
 
sleep 0.1;
 
 
_qty = {_x == _part_in} count magazines player;
if (_qty >= _qty_in) then {
 
_removed = _removed + ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
if (_removed == _qty_in) then {
 
 
for "_x" from 1 to _qty_out do {
_inventory = player getVariable["WeaponModInventory",[]];
player setVariable ["WeaponModInventory",_inventory + [_mod],true];
 
};
 
cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
 
} else {
 
// Return items from botched trade.
for "_x" from 1 to _removed do {
player addMagazine _part_in;
};
_abort = true;
};
 
} else {
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
};
 
sleep 1;
_abort = true;
if(_abort) exitWith {};
};
 
 

DZE_ActionInProgress = false;

Link to comment
Share on other sites

Would this work?

Its a simple buy scripts, used to be triggered via selfactions

 

private["_part_out","_part_in","_qty_out","_qty_in","_textPartIn","_textPartOut","_qty","_needed","_started","_finished","_animState","_isMedic","_abort","_removed","_tradeCounter","_total_trades","_humanityGain","_humanity""_mod","_old","_new","_upg","_selected","_message","_wait","_waited","_inventory","_muzzles"];

// [part_out,part_in, qty_out, qty_in,];
 
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
 
//_activatingPlayer = getPlayerUID player;
_mod = "Suppressor";
_part_out = _mod;
_part_in = "ItemGoldBar";
_qty_out = 1;
_qty_in = 1;
// _buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
//_traderID = (_this select 3) select 7;
 
_qty = {_x == _part_in} count magazines player;
 
// find total number of possible trades
_total_trades = floor (_qty / _qty_in);
 
if(_total_trades < 1) exitWith { 
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
DZE_ActionInProgress = false;
};
 
_abort = false;
_tradeCounter = 0;
 
// trade all items
for "_x" from 1 to _total_trades do {
 
_removed = 0;
 
_tradeCounter = _tradeCounter + 1;
 
if(_total_trades == 1) then {
cutText [format[(localize "str_epoch_player_105"),_tradeCounter,_total_trades] , "PLAIN DOWN"];
} else {
cutText [format[(localize "str_epoch_player_187"),_tradeCounter,_total_trades] , "PLAIN DOWN"];
};
[1,1] call dayz_HungerThirst;
player playActionNow "PutDown";
 
sleep 0.1;
 
 
_qty = {_x == _part_in} count magazines player;
if (_qty >= _qty_in) then {
 
_removed = _removed + ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
if (_removed == _qty_in) then {
 
 
for "_x" from 1 to _qty_out do {
_inventory = player getVariable["WeaponModInventory",[]];
player setVariable ["WeaponModInventory",_inventory + [_mod],true];
 
};
 
cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
 
} else {
 
// Return items from botched trade.
for "_x" from 1 to _removed do {
player addMagazine _part_in;
};
_abort = true;
};
 
} else {
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
};
 
sleep 1;
_abort = true;
if(_abort) exitWith {};
};
 
 

DZE_ActionInProgress = false;

 

Is this modified code from the traders that buy empty bottles? If so then I think it should work.

 

Hi would this work for overpoch guns, would i be able to make the edits needed. 

How hard would it be.

 

Many thanks

Yes it's totally possible to set this up for overpoch -- unfortunately I only went through and mapped all the guns for vanilla Epoch.

 

On github it explains how to set up the mappings.

Link to comment
Share on other sites

  • 3 months later...
  • 3 months later...
  • 1 month later...
  • 1 year later...
  • 1 month later...

was this built to depend on the deployanything mod? This is the error i am getting after intalling the weaponmod...

Spoiler

Error in expression <ssing!";
};
if (DZE_CLICK_ACTIONS_BUILD != DZE_CRV_DEPLOYABLE) exitWith {
diag_l>
  Error position: <!= DZE_CRV_DEPLOYABLE) exitWith {
diag_l>
  Error !=: Type Bool, expected Number,String,Object,Side,Group,Text,Config entry,Display (dialog),Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\addons\wmod\init.sqf, line 12

what would i need to do to get weaponmod working without it? OR a link to a 1.0.5.1 compatible version of deployanything?

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

×
×
  • Create New...