hjyydkl122 Posted October 30, 2016 Share Posted October 30, 2016 Author Name: EdgeKiller Credits To: B4v4r!4n_Str!k3r & sebi1106 Original Post: Link Here step 1: opens the file and add the following / functions.hpp there under the "class action". class craftAction {}; and the following under the "class player _ menu": class craft {}; class craft_update {}; class craft_updateFilter {}; and the following under the "class config. class craftCfg {}; step 2: opens the file / dialogue / masterhandler.h and adds to it the following: #include "craft.hpp" step 3: opens the file / dialogue / player _ inv.hpp and adds the following there under "class controls". class ButtonCraft : Life_RscButtonMenu { idc = 2025; text = "$STR_PM_Craft"; onButtonClick = "closeDialog 0; createDialog ""Life_craft"";"; x = 0.42 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH)); y = 0.805; w = (6.25 / 40); h = (1 / 25); }; step 4: opens the file / stringtable.xml and adds that: <Package name="Craft"> <Key ID="STR_CRAFT_Title"> <Original>Baumenü</Original> </Key> <Key ID="STR_PM_CraftStats"> <Original>Sachen zum Bauen</Original> </Key> <Key ID="STR_PM_CraftMaterials"> <Original>Benötigte Sachen</Original> </Key> <Key ID="STR_CRAFT_Button"> <Original>Bauen!</Original> </Key> <Key ID="STR_PM_NoMaterial"> <Original>Du hast nicht alle Baumaterialen!</Original> </Key> <Key ID="STR_CRAFT_Process"> <Original>Du hast folgendes hergestellt: %1</Original> </Key> <Key ID="STR_CRAFT_FILTER_Weapon"> <Original>Waffen</Original> </Key> <Key ID="STR_CRAFT_FILTER_Uniform"> <Original>Kleidung</Original> </Key> <Key ID="STR_CRAFT_FILTER_Backpack"> <Original>Rucksäcke</Original> </Key> <Key ID="STR_CRAFT_FILTER_Item"> <Original>Items</Original> </Key> <Key ID="STR_CRAFT_AR_Backpack"> <Original>Du hast bereit einen Rucksack! Pack den alten erstmal weg.</Original> </Key> <Key ID="STR_CRAFT_AR_Uniform"> <Original>Du hast bereits etwas an! Mach dich nackt und versuch es nochmal.</Original> </Key> </Package> and the package, the player _ menu ": <Key ID="STR_PM_Craft"> <Original>Craften</Original> </Key> creates the file and adds it to craft.hpp / dialogue. /* File: craft.hpp Description: Crafting System Created by EdgeKiller Coder: EdgeKiller */ class Life_craft { idd = 666; name= "life_craft"; movingEnable = false; enableSimulation = true; onLoad = "[] spawn life_fnc_craft"; class controlsBackground { class Life_RscTitleBackground:Life_RscText { colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"}; idc = -1; x = 0.1; y = 0.2; w = 0.8; h = (1 / 25); }; class MainBackground:Life_RscText { colorBackground[] = {0, 0, 0, 0.7}; idc = -1; x = 0.1; y = 0.2 + (11 / 250); w = 0.8; h = 0.6 - (22 / 250); }; }; class controls { class Title : Life_RscTitle { colorBackground[] = {0, 0, 0, 0}; idc = 667; text = "$STR_CRAFT_Title"; x = 0.1; y = 0.2; w = 0.6; h = (1 / 25); }; class craftListHeader : Life_RscText { idc = 668; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5}; text = "$STR_PM_CraftStats"; sizeEx = 0.04; x = 0.105; y = 0.26; w = 0.275; h = 0.04; }; //Craft list class craftList : life_RscListBox { idc = 669; sizeEx = 0.030; onLBSelChanged = "[] spawn life_fnc_craft_update"; x = 0.105; y = 0.31; w = 0.275; h = 0.44; }; //Materials list header class materialListHeader : Life_RscText { idc = 670; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5}; text = "$STR_PM_CraftMaterials"; sizeEx = 0.04; x = 0.395; y = 0.26; w = 0.275; h = 0.04; }; //Materials list class materialList : Life_RscControlsGroup { idc = 671; w = 0.275; h = 0.44; x = 0.395; y = 0.30; class Controls { class mats : Life_RscStructuredText { idc = 672; sizeEx = 0.020; text = ""; x = 0; y = 0; w = 0.27; h = 0.44; }; }; }; //FILTER class FilterList : Life_RscCombo { idc = 673; colorBackground[] = {0,0,0,0.7}; onLBSelChanged = "[] call life_fnc_craft_updateFilter"; x = 0.69; y = 0.32; w = (6.25 / 30); h = (1 / 25); }; //Craft button class ButtonCraft : Life_RscButtonMenu { idc = 674; text = "$STR_CRAFT_Button"; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5}; onButtonClick = "if(!(life_is_processing && life_action_inUse)) then {[] spawn life_fnc_craftAction};"; x = 0.69; y = 0.26; w = (6.25 / 40); h = (1 / 25); }; class CloseButtonKey : Life_RscButtonMenu { idc = -1; text = "$STR_Global_Close"; onButtonClick = "closeDialog 0;"; x = 0.1; y = 0.8 - (1 / 25); w = (6.25 / 40); h = (1 / 25); }; }; }; step 5: creates the file and adds it to craft.hpp / dialogue. /* File: craft.hpp Description: Crafting System Created by EdgeKiller Coder: EdgeKiller */ class Life_craft { idd = 666; name= "life_craft"; movingEnable = false; enableSimulation = true; onLoad = "[] spawn life_fnc_craft"; class controlsBackground { class Life_RscTitleBackground:Life_RscText { colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"}; idc = -1; x = 0.1; y = 0.2; w = 0.8; h = (1 / 25); }; class MainBackground:Life_RscText { colorBackground[] = {0, 0, 0, 0.7}; idc = -1; x = 0.1; y = 0.2 + (11 / 250); w = 0.8; h = 0.6 - (22 / 250); }; }; class controls { class Title : Life_RscTitle { colorBackground[] = {0, 0, 0, 0}; idc = 667; text = "$STR_CRAFT_Title"; x = 0.1; y = 0.2; w = 0.6; h = (1 / 25); }; class craftListHeader : Life_RscText { idc = 668; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5}; text = "$STR_PM_CraftStats"; sizeEx = 0.04; x = 0.105; y = 0.26; w = 0.275; h = 0.04; }; //Craft list class craftList : life_RscListBox { idc = 669; sizeEx = 0.030; onLBSelChanged = "[] spawn life_fnc_craft_update"; x = 0.105; y = 0.31; w = 0.275; h = 0.44; }; //Materials list header class materialListHeader : Life_RscText { idc = 670; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5}; text = "$STR_PM_CraftMaterials"; sizeEx = 0.04; x = 0.395; y = 0.26; w = 0.275; h = 0.04; }; //Materials list class materialList : Life_RscControlsGroup { idc = 671; w = 0.275; h = 0.44; x = 0.395; y = 0.30; class Controls { class mats : Life_RscStructuredText { idc = 672; sizeEx = 0.020; text = ""; x = 0; y = 0; w = 0.27; h = 0.44; }; }; }; //FILTER class FilterList : Life_RscCombo { idc = 673; colorBackground[] = {0,0,0,0.7}; onLBSelChanged = "[] call life_fnc_craft_updateFilter"; x = 0.69; y = 0.32; w = (6.25 / 30); h = (1 / 25); }; //Craft button class ButtonCraft : Life_RscButtonMenu { idc = 674; text = "$STR_CRAFT_Button"; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5}; onButtonClick = "if(!(life_is_processing && life_action_inUse)) then {[] spawn life_fnc_craftAction};"; x = 0.69; y = 0.26; w = (6.25 / 40); h = (1 / 25); }; class CloseButtonKey : Life_RscButtonMenu { idc = -1; text = "$STR_Global_Close"; onButtonClick = "closeDialog 0;"; x = 0.1; y = 0.8 - (1 / 25); w = (6.25 / 40); h = (1 / 25); }; }; }; step 6: creates the file fn _ craftaction.sqf and adds it in / core / actions. #include "..\..\script_macros.hpp" /* File: fn_craftAction.sqf Author: EdgeKiller Description: Master handling for crafting an item. */ private["_dialog","_item","_itemInfo","_oldItem","_newItem","_upp","_itemName","_ui","_progress","_pgText","_cP","_allMaterial","_matsNeed","_invSize","_handledItem","_itemFilter","_backpackOldItems","_weight","_weightUsedItems"]; disableSerialization; _dialog = findDisplay 666; if((lbCurSel 669) == -1) exitWith {hint localize "STR_ISTR_SelectItemFirst";}; _item = lbData[669,(lbCurSel 669)]; _allMaterial = true; _itemFilter = lbData[673,(lbCurSel 673)]; _matsNeed = 0; _config = [_itemFilter] call life_fnc_craftCfg; life_action_inUse = true;//Lock out other actions during processing. { if (_item == _x select 0)then { _matsNeed = _x select 1; _invSize = count _matsNeed; for [{_i=0},{_i<_invSize-1},{_i=_i+2}] do { _matsNum = _matsNeed select _i+1; if ((ITEM_VALUE(_matsNeed select _i)) < _matsNum) then {_allMaterial = false;}; }; }; } foreach (_config); _newItem = _item; diag_log format ["%1",_allMaterial]; if (!_allMaterial) exitWith {hint localize "STR_PM_NoMaterial"; life_action_inUse = false;}; //Some checks if ((count _matsNeed) == 0) exitWith {life_action_inUse = false;}; if (_itemFilter == "backpack" && backpack player != "") exitWith { hint localize "STR_CRAFT_AR_Backpack"; life_action_inUse = false; }; if (_itemFilter == "uniform" && uniform player != "") exitWith { hint localize "STR_CRAFT_AR_Uniform"; life_action_inUse = false; }; if (_itemFilter == "weapon") then { if (!(player canAdd _newItem) || currentWeapon player != "") exitWith { hint localize "STR_NOTF_NoRoom"; life_action_inUse = false; }; }; if (_itemFilter == "item") then { _weight = [_item] call life_fnc_itemWeight; _weightUsedItems = 0; for [{_i=0},{_i<(count _matsNeed)-1},{_i=_i+2}] do { _matsNum = _matsNeed select _i+1; _weightUsedItems = _weightUsedItems + (([(_matsNeed select _i)] call life_fnc_itemWeight) * _matsNum); diag_log format ["%1 - %2",(_matsNeed select _i),_weightUsedItems]; }; if ((life_carryWeight - _weightUsedItems + _weight) > life_maxWeight) exitWith { hint localize "STR_NOTF_NoRoom"; life_action_inUse = false; }; }; _oldItem = _matsNeed; if (_itemFilter == "item") then { _itemName = localize M_CONFIG(getText,"VirtualItems",_newItem,"displayName"); } else { _itemInfo = [_newItem] call life_fnc_fetchCfgDetails; _itemName = _itemInfo select 1; }; life_is_processing = true; _upp = format["Baue %1",_itemName]; closeDialog 0; //Setup our progress bar. disableSerialization; 5 cutRsc ["life_progress","PLAIN"]; _ui = uiNameSpace getVariable "life_progress"; _progress = _ui displayCtrl 38201; _pgText = _ui displayCtrl 38202; _pgText ctrlSetText format["%2 (1%1)...","%",_upp]; _progress progressSetPosition 0.01; _cP = 0.01; _removeItemSuccess = true; _invSize = count _oldItem; for [{_i=0},{_i<_invSize-1},{_i=_i+2}] do { _handledItem = (_oldItem select _i); if(!([false,_handledItem,_oldItem select _i+1] call life_fnc_handleInv)) exitWith {_removeItemSuccess = false;}; }; if (!_removeItemSuccess) exitWith {5 cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;}; for "_i" from 0 to 1 step 0 do { sleep 0.3; _cP = _cP + 0.01; _progress progressSetPosition _cP; _pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp]; if(_cP >= 1) exitWith {}; }; if (_itemFilter == "backpack") then { if(backpack player == "") then { player addBackpack _newItem; } else { hint localize "STR_CRAFT_AR_Backpack"; life_is_processing = false; life_action_inUse = false; }; }; if (_itemFilter == "uniform") then{ if(uniform player == "") then{ player addUniform _newItem; } else { hint localize "STR_CRAFT_AR_Uniform"; life_is_processing = false; life_action_inUse = false; }; }; if (_itemFilter == "weapon") then{ if(player canAdd _newItem) then{ player addItem _newItem; } else { if(currentWeapon player == "") then{ player addWeapon _newItem; } else { 5 cutText ["","PLAIN"]; for [{_i=0},{_i<_invSize-1},{_i=_i+2}] do { _handledItem = (_oldItem select _i); [true,_handledItem,_oldItem select _i+1] call life_fnc_handleInv; }; life_is_processing = false; life_action_inUse = false; }; }; }; if (_itemFilter == "item") then{ _handledItem = _newItem; [true,_handledItem,1] call life_fnc_handleInv; }; 5 cutText ["","PLAIN"]; titleText[format[localize "STR_CRAFT_Process",_itemName],"PLAIN"]; [0] call SOCK_fnc_updatePartial; life_is_processing = false; life_action_inUse = false; step 7: creates the file fn _ craft.sqf and adds it in / core / pmenu: /* File: fn_craft.sqf Description: Crafting System Created by EdgeKiller Coder: EdgeKiller */ private["_dialog","_inv","_itemInfo","_filter"]; //Declare all private variables if(!dialog) then { //Verify if the window is open createDialog "Life_craft"; }; disableSerialization; //Disable Serialization if(life_is_processing) exitWith{ closeDialog 2001; closeDialog 0; }; _dialog = findDisplay 666; //find the craft dialog/window _inv = _dialog displayCtrl 669; //find the listbox of items can be created lbClear _inv; //clear the listbox _filter = _dialog displayCtrl 673; _filter lbAdd localize "STR_CRAFT_FILTER_Weapon"; _filter lbSetData[(lbSize _filter)-1,"weapon"]; _filter lbAdd localize "STR_CRAFT_FILTER_Uniform"; _filter lbSetData[(lbSize _filter)-1,"uniform"]; _filter lbAdd localize "STR_CRAFT_FILTER_Backpack"; _filter lbSetData[(lbSize _filter)-1,"backpack"]; _filter lbAdd localize "STR_CRAFT_FILTER_Item"; _filter lbSetData[(lbSize _filter)-1,"item"]; _filter lbSetCurSel 0; step 8: creates the file fn _ craft _ update.sqf and adds it in / core / pmenu: #include "..\..\script_macros.hpp" /* File: fn_craft_update.sqf Description: Crafting System Created by EdgeKiller Coder: EdgeKiller */ private["_dialog","_inv","_mats","_item","_struct","_str","_invSize","_matsNeed","_matsNum","_config","_itemFilter"]; //Declare all private variables disableSerialization; //Disable Serialization _dialog = findDisplay 666; //find the craft dialog/window _inv = _dialog displayCtrl 669; //find the listbox of items can be created _mats = _dialog displayCtrl 672; _struct = ""; if ((lbCurSel 669) == -1) exitWith {hint localize "STR_ISTR_SelectItemFirst";}; _item = lbData[669,(lbCurSel 669)]; _itemFilter = lbData[673,(lbCurSel 673)]; _config = [_itemFilter] call life_fnc_craftCfg; { if (_item == _x select 0) then { _matsNeed = _x select 1; _invSize = count _matsNeed; for [{_i = 0},{_i < _invSize - 1},{_i = _i + 2}] do { _str = M_CONFIG(getText,"VirtualItems",(_matsNeed select _i),"displayName"); _matsNum = _matsNeed select _i+1; _struct = _struct + format["%1x %2<br/>",_matsNum,(localize _str)]; }; }; } foreach (_config); if (_struct == "") then { _struct = "Es wird nichts benötigt"; }; _mats ctrlSetStructuredText parseText format[" <t size='0.8px'> %1 </t> ",_struct]; step 9: creates the file fn _ craft _ updatefilter.sqf and adds it in / core / pmenu: #include "..\..\script_macros.hpp" /* File: fn_craft_updateFilter.sqf Description: Crafting System Created by EdgeKiller Coder: EdgeKiller */ disableSerialization; private["_list","_filter","_dialog","_inv","_mats","_filterBox","_item","_itemFilter"]; _dialog = findDisplay 666; //find the craft dialog/window _inv = _dialog displayCtrl 669; //find the listbox of items can be created _mats = _dialog displayCtrl 672; _filterBox = _dialog displayCtrl 673; _itemFilter = lbData[673,(lbCurSel 673)]; lbClear _inv; _struct = ""; _config = [_itemFilter] call life_fnc_craftCfg; { if(_itemFilter == "item") then{ _str = localize M_CONFIG(getText,"VirtualItems",(_x select 0),"displayName"); _inv lbAdd format["%1",_str]; //add a gun to the listbox _inv lbSetData[(lbSize _inv)-1,_x select 0]; //set the data of the gun } else { _itemInfo = [_x select 0] call life_fnc_fetchCfgDetails; _inv lbAdd format["%1",_itemInfo select 1]; //add a gun to the listbox _inv lbSetData[(lbSize _inv)-1,_itemInfo select 0]; //set the data of the gun _inv lbSetPicture[(lbSize _inv)-1,_itemInfo select 2]; }; } foreach (_config); _inv lbSetCurSel 0; _item = lbData[669,(lbCurSel 669)]; _config = [_itemFilter] call life_fnc_craftCfg; { if(_item == _x select 0)then { _matsNeed = _x select 1; _invSize = count _matsNeed; for [{_i = 0},{_i < _invSize - 1},{_i = _i + 2}] do { _str = M_CONFIG(getText,"VirtualItems",(_matsNeed select _i),"displayName"); _matsNum = _matsNeed select _i+1; _struct = _struct + format["%1x %2<br/>",_matsNum,(localize _str)]; }; }; } foreach (_config); _mats ctrlSetStructuredText parseText format[" <t size='0.8px'> %1 </t> ",_struct]; step 10: creates the file fn _ craftcfg.sqf and adds it in / core / config. #include "..\..\script_macros.hpp" /* File: fn_craftCfg.sqf Author: EdgeKiller Description: Master configuration file for the crafting menu. */ private["_craft","_return"]; _craft = [_this,0,"",[""]] call BIS_fnc_param; if(_craft == "") exitWith {closeDialog 0}; //Bad shop type passed. switch(_craft) do { case "weapon": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["hgun_P07_F", ["diamond_cut",2,"copper_refined",1]] ]; if(FETCH_CONST(life_adminlevel) > 0) then { _return pushBack ["SMG_01_F", ["copper_refined",3,"iron_refined",3,"diamond_cut",1]]; }; }; case "uniform": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["U_IG_Guerilla1_1", ["copper_refined",1]] ]; }; case "backpack": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["B_Carryall_oli", ["diamond_cut",1]] ]; }; case "item": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["iron_refined", ["copper_refined",2]], ["diamond_cut", ["copper_refined",1,"iron_refined",1]] ]; }; }; _return; My English is not very good I'm from China. Script Apply to 4.4 2 Quote Link to comment Share on other sites More sharing options...
B4v4ri4n_Strik3r Posted October 30, 2016 Share Posted October 30, 2016 thanks at @AlaskaVet and @AmaZiinG @hjyydkl122 i have nothing against that you rewrote this tutorial in english, but please credit me and sebi1106 and before ask him for his permission: Quote Sebi1106 schrieb: Hiermit untersage ich wie immer die Verbreitung dieser Daten und die des von mir verfassten Tutorials in anderen Foren ohne vorher mein Einverständnis dazu einzuholen. Quote Link to comment Share on other sites More sharing options...
armagod Posted October 30, 2016 Share Posted October 30, 2016 5 hours ago, B4v4ri4n_Strik3r said: thanks at @AlaskaVet and @AmaZiinG @hjyydkl122 i have nothing against that you rewrote this tutorial in english, but please credit me and sebi1106 and before ask him for his permission: Quote Sebi1106 schrieb: Hiermit untersage ich wie immer die Verbreitung dieser Daten und die des von mir verfassten Tutorials in anderen Foren ohne vorher mein Einverständnis dazu einzuholen. isnt edgekiller the original creator as it was originally posted on old forums as per the files File: fn_craft_updateFilter.sqf Description: Crafting System Created by EdgeKiller Coder: EdgeKiller Quote Link to comment Share on other sites More sharing options...
SwAtRaNgEr Posted October 30, 2016 Share Posted October 30, 2016 What does this actual do? Quote Link to comment Share on other sites More sharing options...
IceEagle132 Posted October 31, 2016 Share Posted October 31, 2016 33 minutes ago, SwAtRaNgEr said: What does this actual do? Allows you to craft guns and such. 1 Quote Link to comment Share on other sites More sharing options...
B4v4ri4n_Strik3r Posted October 31, 2016 Share Posted October 31, 2016 11 hours ago, armagod said: isnt edgekiller the original creator as it was originally posted on old forums as per the files File: fn_craft_updateFilter.sqf Description: Crafting System Created by EdgeKiller Coder: EdgeKiller Thats true, maybe i also should add "orginally created by EdgeKiller" but I have ported it to 4.4 and fixed some stuff. And at the time I wrote it, I thought it's enough to credit sebi Quote Link to comment Share on other sites More sharing options...
Iceman Posted November 23, 2016 Share Posted November 23, 2016 (edited) Been looking at this and was trying to think of a way to add vehicles to the list. Edited November 23, 2016 by Iceman Quote Link to comment Share on other sites More sharing options...
Sir Custard Of Cream Posted November 23, 2016 Share Posted November 23, 2016 7 hours ago, Iceman said: Been looking at this and was trying to think of a way to add vehicles to the list. same also vests and helmets wont work on the clothing section do You know how?? Quote Link to comment Share on other sites More sharing options...
Iceman Posted November 23, 2016 Share Posted November 23, 2016 3 hours ago, Sir Custard Of Cream said: same also vests and helmets wont work on the clothing section do You know how?? yea adding those I can do but the vehicles are being a bit more tricky. Quote Link to comment Share on other sites More sharing options...
Iceman Posted November 23, 2016 Share Posted November 23, 2016 23 minutes ago, Iceman said: In stringtable.xml add <Key ID="STR_CRAFT_FILTER_Headgear"> <Original>Headgear</Original> </Key> <Key ID="STR_CRAFT_FILTER_Vest"> <Original>Vest</Original> </Key> After <Key ID="STR_CRAFT_FILTER_Backpack"> <Original>Backpacks</Original> </Key> In the same file add </Key> <Key ID="STR_STR_CRAFT_AR_Vest"> <Original>You already have something on!.</Original> </Key> <Key ID="STR_CRAFT_AR_Headgear"> <Original>You already have something on!.</Original> </Key> After <Key ID="STR_CRAFT_AR_Uniform"> <Original>You already have something on!.</Original> </Key> Then in core\config\fn_craftcfg.cfg add case "vest": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["V_Rangemaster_belt", ["diamond_cut",1]] ]; }; case "headgear": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["H_Bandanna_camo", ["diamond_cut",1]] ]; }; After case "backpack": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["B_Carryall_oli", ["diamond_cut",1]] ]; }; In core\actions\fn_craftactions.sqf add if (_itemFilter == "vest" && vest player != "") exitWith { hint localize "STR_CRAFT_AR_Vest"; life_action_inUse = false; }; if (_itemFilter == "headgear" && headgear player != "") exitWith { hint localize "STR_CRAFT_AR_Headgear"; life_action_inUse = false; }; After if (_itemFilter == "uniform" && uniform player != "") exitWith { hint localize "STR_CRAFT_AR_Uniform"; life_action_inUse = false; }; Then in the same file add if (_itemFilter == "vest") then{ if(vest player == "") then{ player addVest _newItem; } else { hint localize "STR_CRAFT_AR_Vest"; life_is_processing = false; life_action_inUse = false; }; }; if (_itemFilter == "headgear") then{ if(headgear player == "") then{ player addHeadgear _newItem; } else { hint localize "STR_CRAFT_AR_Headgear"; life_is_processing = false; life_action_inUse = false; }; }; After if (_itemFilter == "uniform") then{ if(uniform player == "") then{ player addUniform _newItem; } else { hint localize "STR_CRAFT_AR_Uniform"; life_is_processing = false; life_action_inUse = false; }; }; Then in the core\pmenu\fn_craft.sqf add _filter lbAdd localize "STR_CRAFT_FILTER_Headgear"; _filter lbSetData[(lbSize _filter)-1,"headgear"]; _filter lbAdd localize "STR_CRAFT_FILTER_Vest"; _filter lbSetData[(lbSize _filter)-1,"vest"]; After _filter lbAdd localize "STR_CRAFT_FILTER_Backpack"; _filter lbSetData[(lbSize _filter)-1,"backpack"]; Then your done just edit the fn_craftcfg.cfg to your liking. This adds the vest and headgear. 1 Quote Link to comment Share on other sites More sharing options...
Marcus McGee Posted January 27, 2017 Share Posted January 27, 2017 Its working, but then i press "craft" to make the item. i does not do or say anything... 1 Quote Link to comment Share on other sites More sharing options...
Sir Custard Of Cream Posted January 28, 2017 Share Posted January 28, 2017 How would i speed up the crafting time as it is really long and i cant find the line to make it quicker Quote Link to comment Share on other sites More sharing options...
temma Posted February 20, 2017 Share Posted February 20, 2017 Quote Its working, but then i press "craft" to make the item. i does not do or say anything... mpmission\core\actions\fn_craftaction.sqf line19 if (_item == _x select 0)then { change this if (_item == _x select 0) then { Quote Link to comment Share on other sites More sharing options...
Gamezoneita Posted March 8, 2017 Share Posted March 8, 2017 On 27/1/2017 at 9:12 PM, Marcus McGee said: Its working, but then i press "craft" to make the item. i does not do or say anything... Hi I have the same problem On 20/2/2017 at 6:51 AM, temma said: mpmission\core\actions\fn_craftaction.sqf line19 if (_item == _x select 0)then { change this if (_item == _x select 0) then { this not work Can you help me? Quote Link to comment Share on other sites More sharing options...
Bl4cKSh4d6W Posted March 28, 2017 Share Posted March 28, 2017 Hi, I follow this tutorial step by step but in craft menu it doesn't display any item to craft. Does anyone knows how to fix it? I'm using 4.4R4 regards Quote Link to comment Share on other sites More sharing options...
erBradipo Posted April 18, 2017 Share Posted April 18, 2017 (edited) i have an issue whit that script when i enter in a server to craft i see the gun but the materials are named to "any" i don't know why. but i think i'ts becouse i must set a other weapons. Any can help me whit that i post the screen shot of my file. i use a 4.4 r3 #include "..\..\script_macros.hpp" private["_craft"]; _craft = [_this,0,"",[""]] call BIS_fnc_param; if(_craft == "") exitWith {closeDialog 0}; //Bad shop type passed. switch(_craft) do { case "weapon": { switch(true) do { default { ["Weapons", [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["arifle_AKM_F", ["barrel",1,"gear",3,"woodRefined",3,"steel",2]], ["gear", ["alluminiumRefined",2]], ["barrel", ["steel",3]], ["steel", ["ironRefined",1,"alluminiumRefined",1]], ["polimer", ["plastic",3,"_glass",1]] ] ]; }; }; }; }; class gear { variable = "gear"; displayName = "Ingranaggio"; weight = 1; buyPrice = -1; sellPrice = -1; illegal = false; edible = -1; icon = "icons\ico_gear.paa"; }; class polimer { variable = "polimer"; displayName = "Polimero"; weight = 1; buyPrice = -1; sellPrice = -1; illegal = false; edible = -1; icon = "icons\ico_polimer.paa"; }; class barrel { variable = "barrel"; displayName = "Canna in acciaio"; weight = 1; buyPrice = -1; sellPrice = -1; illegal = false; edible = -1; icon = "icons\ico_barrel.paa"; }; class plastic { variable = "plastic"; displayName = "STR_Item_Plastic"; weight = 2; buyPrice = -1; sellPrice = 5000; illegal = false; edible = -1; icon = "icons\ico_plastic.paa"; }; class steel { variable = "steel"; displayName = "Acciaio"; weight = 3; buyPrice = -1; sellPrice = -1; illegal = false; edible = -1; icon = "icons\ico_steel.paa"; }; /* File: fn_craftAction.sqf Author: EdgeKiller Description: Master handling for crafting an item. */ private["_dialog","_item","_itemInfo","_oldItem","_newItem","_upp","_itemName","_ui","_progress","_pgText","_cP","_allMaterial","_matsNeed","_invSize","_handledItem"]; disableSerialization; _dialog = findDisplay 666; if((lbCurSel 669) == -1) exitWith {hint localize "STR_ISTR_SelectItemFirst";}; _item = lbData[669,(lbCurSel 669)]; _allMaterial = true; _matsNeed = 0; if(!(player canAdd _item)) exitWith {hint localize "STR_NOTF_NoRoom";}; _config = ["weapon"] call life_fnc_craftCfg; { if(_item == _x select 0)then { _matsNeed = _x select 1; _invSize = count _matsNeed; for [{_i = 0},{_i < _invSize - 1},{_i = _i + 2}] do { _str = [_matsNeed select _i] call life_fnc_varToStr; _matsNum = _matsNeed select _i+1; if((missionNamespace getVariable (_matsNeed select _i)) < _matsNum) exitWith {_allMaterial = false;}; }; }; } foreach (_config select 1); if(!_allMaterial) exitWith {hint localize "STR_PM_NoMaterial";}; //Error checking if((count _matsNeed) == 0) exitWith {}; //Setup vars. _oldItem = _matsNeed; _newItem = _item; _itemInfo = [_newItem] call life_fnc_fetchCfgDetails; _itemName = _itemInfo select 1; _upp = format["Crafting %1",_itemName]; //Some more checks if((count _oldItem) == 0) exitWith {}; closeDialog 0; //Setup our progress bar. 5 cutRsc ["life_progress","PLAIN"]; _ui = uiNameSpace getVariable "life_progress"; _progress = _ui displayCtrl 38201; _pgText = _ui displayCtrl 38202; _pgText ctrlSetText format["%2 (1%1)...","%",_upp]; _progress progressSetPosition 0.01; _cP = 0.01; _removeItemSuccess = true; _invSize = count _oldItem; for [{_i = 0},{_i < _invSize - 1},{_i = _i + 2}] do { _handledItem = [_oldItem select _i,1] call life_fnc_varHandle; if(!([false,_handledItem,_oldItem select _i+1] call life_fnc_handleInv)) exitWith {_removeItemSuccess = false;}; }; if(!_removeItemSuccess) exitWith {5 cutText ["","PLAIN"]; life_is_processing = false;}; [] call life_fnc_p_updateMenu; life_is_processing = true; while{true} do { sleep 0.3; _cP = _cP + 0.01; _progress progressSetPosition _cP; _pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp]; if(_cP >= 1) exitWith {}; }; _invSize = count _oldItem; if(!(player addItem _item)) exitWith { 5 cutText ["","PLAIN"]; for [{_i = 0},{_i < _invSize - 1},{_i = _i + 2}] do { _handledItem = [_oldItem select _i,1] call life_fnc_varHandle; [true,_handledItem,_oldItem select _i+1] call life_fnc_handleInv; }; life_is_processing = false; }; 5 cutText ["","PLAIN"]; titleText[format[localize "STR_CRAFT_Process",_itemName],"PLAIN"]; life_is_processing = false; Edited April 18, 2017 by erBradipo Quote Link to comment Share on other sites More sharing options...
erBradipo Posted April 19, 2017 Share Posted April 19, 2017 (edited) 10 hours ago, Deadlesszombie said: @erBradipodid you define the plastic and aluminum? yes i have defined Edited April 19, 2017 by erBradipo Quote Link to comment Share on other sites More sharing options...
Shimakaze Posted July 18, 2017 Share Posted July 18, 2017 #include "..\..\script_macros.hpp" /* File: fn_craftCfg.sqf Author: EdgeKiller Description: Master configuration file for the crafting menu. */ private["_craft","_return"]; _craft = [_this,0,"",[""]] call BIS_fnc_param; if(_craft == "") exitWith {closeDialog 0}; //Bad shop type passed. switch(_craft) do { case "weapon": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["KA_Glock_17_Single", ["pistolbody",1,"pipe",1,"iron_refined",1]], ["KA_17Rnd_9x19_Mag", ["oil_processed",1,"copper_refined",1]], ["arifle_KA_SKS_F", ["RifleBody",1,"pipe",2,"iron_refined",1]], ["10Rnd_762x39_US", ["oil_processed",1,"iron_refined",1]], ["KA_SG_552", ["RifleBody",1,"pipe",2,"iron_refined",3,"toolkit",1]], ["KA_SIG_30rnd_M856_Tracer_Red_mag", ["oil_processed",1,"iron_refined",2]], ["APS", ["pipe",2,"iron_refined",3]], ["26Rnd_566x150_MPS", ["oil_processed",2,"iron_refined",1]], ["KA_WA2000", ["pipe",2,"iron_refined",1,"riflebody",3,"toolkit",1]], ["KA_6Rnd_300win_Mag", ["oil_processed",2,"iron_refined",1]], ["optic_KHS_old", ["pipe",2,"toolkit",1]], ["optic_aco", ["iron_refined",2,"toolkit",1]] ]; if(FETCH_CONST(life_adminlevel) > 0) then { _return pushBack ["SMG_01_F", ["copper_refined",3,"iron_refined",3,"diamond_cut",1]]; }; }; case "uniform": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["U_B_T_FullGhillie_tna_F", ["bag",5,"copper_refined",1]], ["TRYK_U_B_PCUHsW8", ["bag",10]], ["TRYK_U_B_PCUODHs", ["bag",10]], ["TRYK_U_B_PCUGs_gry_R", ["bag",10]], ["U_IG_Guerilla1_1", ["copper_refined",1]], ["H_ShemagOpen_tan", ["bag",2]], ["H_ShemagOpen_khk", ["bag",2]], ["k_hrebel_1", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_2", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_3", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_4", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_5", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_6", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_7", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_8", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_9", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_10", ["bag",10,"iron_refined",2,"copper_refined",3]] ]; }; case "backpack": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["B_Carryall_oli", ["bag",6,"copper_refined",1]], ["TRYK_B_Carryall_blk", ["bag",6,"copper_refined",1]], ["TRYK_B_Carryall_wh", ["bag",6,"copper_refined",1]], ["TRYK_B_Alicepack", ["bag",4]], ["TRYK_B_Coyotebackpack_BLK", ["bag",4,"iron_refined",1]], ["TRYK_B_Coyotebackpack", ["bag",4,"iron_refined",1]], ["TRYK_B_Coyotebackpack_OD", ["bag",4,"iron_refined",1]], ["TRYK_B_Kitbag_Base", ["bag",4,"iron_refined",1]], ["B_Bergen_tna_F", ["bag",15,"iron_refined",1,"copper_refined,2]] ]; }; case "item": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["pipe", ["iron_refined",2]], ["pistolbody", ["iron_refined",1,"pipe",1]], ["RifleBody", ["iron_refined",3,"pipe",2]], ["goldbar", ["diamond_cut",10,"oil_processed",2]], ["cocaine_processed", ["bag",2,"drugbox",1,"cocaine_unprocessed",3]], ["marijuana", ["bag",2,"drugbox",1,"cannabis",3]], ["heroin_processed", ["bag",2,"drugbox",1,"heroin_unprocessed",3]] ]; }; }; _return; I checked everthing but seem like it's not work ingame ? Quote Link to comment Share on other sites More sharing options...
Deadongaming Posted August 29, 2017 Share Posted August 29, 2017 {"16Rnd_9x21_Mag","",{"iron_unrefined",1,"gunpowder",3},"","",0}, is it possible to use 1 iron ore , 3 gunpowder to create a stack of bullets instead of 1? Quote Link to comment Share on other sites More sharing options...
Deadongaming Posted August 29, 2017 Share Posted August 29, 2017 (edited) On 7/18/2017 at 1:33 PM, Shimakaze said: #include "..\..\script_macros.hpp" /* File: fn_craftCfg.sqf Author: EdgeKiller Description: Master configuration file for the crafting menu. */ private["_craft","_return"]; _craft = [_this,0,"",[""]] call BIS_fnc_param; if(_craft == "") exitWith {closeDialog 0}; //Bad shop type passed. switch(_craft) do { case "weapon": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["KA_Glock_17_Single", ["pistolbody",1,"pipe",1,"iron_refined",1]], ["KA_17Rnd_9x19_Mag", ["oil_processed",1,"copper_refined",1]], ["arifle_KA_SKS_F", ["RifleBody",1,"pipe",2,"iron_refined",1]], ["10Rnd_762x39_US", ["oil_processed",1,"iron_refined",1]], ["KA_SG_552", ["RifleBody",1,"pipe",2,"iron_refined",3,"toolkit",1]], ["KA_SIG_30rnd_M856_Tracer_Red_mag", ["oil_processed",1,"iron_refined",2]], ["APS", ["pipe",2,"iron_refined",3]], ["26Rnd_566x150_MPS", ["oil_processed",2,"iron_refined",1]], ["KA_WA2000", ["pipe",2,"iron_refined",1,"riflebody",3,"toolkit",1]], ["KA_6Rnd_300win_Mag", ["oil_processed",2,"iron_refined",1]], ["optic_KHS_old", ["pipe",2,"toolkit",1]], ["optic_aco", ["iron_refined",2,"toolkit",1]] ]; if(FETCH_CONST(life_adminlevel) > 0) then { _return pushBack ["SMG_01_F", ["copper_refined",3,"iron_refined",3,"diamond_cut",1]]; }; }; case "uniform": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["U_B_T_FullGhillie_tna_F", ["bag",5,"copper_refined",1]], ["TRYK_U_B_PCUHsW8", ["bag",10]], ["TRYK_U_B_PCUODHs", ["bag",10]], ["TRYK_U_B_PCUGs_gry_R", ["bag",10]], ["U_IG_Guerilla1_1", ["copper_refined",1]], ["H_ShemagOpen_tan", ["bag",2]], ["H_ShemagOpen_khk", ["bag",2]], ["k_hrebel_1", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_2", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_3", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_4", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_5", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_6", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_7", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_8", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_9", ["bag",10,"iron_refined",2,"copper_refined",3]], ["k_hrebel_10", ["bag",10,"iron_refined",2,"copper_refined",3]] ]; }; case "backpack": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["B_Carryall_oli", ["bag",6,"copper_refined",1]], ["TRYK_B_Carryall_blk", ["bag",6,"copper_refined",1]], ["TRYK_B_Carryall_wh", ["bag",6,"copper_refined",1]], ["TRYK_B_Alicepack", ["bag",4]], ["TRYK_B_Coyotebackpack_BLK", ["bag",4,"iron_refined",1]], ["TRYK_B_Coyotebackpack", ["bag",4,"iron_refined",1]], ["TRYK_B_Coyotebackpack_OD", ["bag",4,"iron_refined",1]], ["TRYK_B_Kitbag_Base", ["bag",4,"iron_refined",1]], ["B_Bergen_tna_F", ["bag",15,"iron_refined",1,"copper_refined,2]] ]; }; case "item": { _return = [ //[Object classname, [item #1,quantity item #1,item #2,quantity item #2]],] ["pipe", ["iron_refined",2]], ["pistolbody", ["iron_refined",1,"pipe",1]], ["RifleBody", ["iron_refined",3,"pipe",2]], ["goldbar", ["diamond_cut",10,"oil_processed",2]], ["cocaine_processed", ["bag",2,"drugbox",1,"cocaine_unprocessed",3]], ["marijuana", ["bag",2,"drugbox",1,"cannabis",3]], ["heroin_processed", ["bag",2,"drugbox",1,"heroin_unprocessed",3]] ]; }; }; _return; I checked everthing but seem like it's not work ingame ? what version of altis life are you running? there is a newer version on Native, but you'd have to translate it. Edited August 29, 2017 by Deadongaming Quote Link to comment Share on other sites More sharing options...
Herbeth Posted October 27, 2017 Share Posted October 27, 2017 Has anyone tested on life 5.0? is working? Quote Link to comment Share on other sites More sharing options...
=[BMG]= Gbutome Posted November 4, 2017 Share Posted November 4, 2017 working in 5.0??? Quote Link to comment Share on other sites More sharing options...
dont cry:) Posted February 4, 2018 Share Posted February 4, 2018 not working for me on 5.0 plz help. whenever I press craft nothing happens. I can speak french too. I'm trying to understand the script and fix it by myself to learn but I'm just not good enough for it... Quote Link to comment Share on other sites More sharing options...
dont cry:) Posted February 5, 2018 Share Posted February 5, 2018 15 hours ago, Deadlesszombie said: send the error log? There's none. Like everything works. Except whenever I press the craft button nothing happens. I can't craft the items Quote Link to comment Share on other sites More sharing options...
Audacious Posted March 20, 2018 Share Posted March 20, 2018 Anybody have a modification to craft automatic x Items? That i can add a number how many items i want to craft. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.