Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. Emulation
  3. Arma III
  4. Tutoriels
  5. Système de craft par EdgeKiller

Système de craft par EdgeKiller

Scheduled Pinned Locked Moved Tutoriels
10 Posts 5 Posters 6.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • vfrzV
    vfrzV
    vfrz
    wrote on last edited by
    #1

    <p>Bonsoir tout le monde !</p>
    <p> </p>
    <p>Ce soir je vous partage un système de craft que j'ai créer complétement moi même, donc exclusif !</p>
    <p> </p>
    <p>Petit aperçu : </p>
    <p> </p>
    <p>https://www.youtube.com/watch?v=BJegFHppdkc</p>
    <p> </p>
    <p><u>A faire :</u></p>
    <p>- Traduire le script en allemand/italien/portugais</p>
    <p>- Système de filtrage pour les vêtements/armes etc...</p>
    <p></p><p>• Fichier "Functions.h", mettez ceci dans la class "Action" :</p>
    <pre class="ipsCode prettyprint">
    class craftAction {};
    </pre>
    <p>Dans la class "Config" :</p>
    <pre class="ipsCode prettyprint">
    class craftCfg {};
    </pre>
    <p>Puis dans la class "Player_Menu" : </p>
    <pre class="ipsCode prettyprint">
    class craft {};
    class craft_update {};
    </pre>
    <p>• Fichier "dialog\MasterHandler.h", ajoutez :</p>
    <pre class="ipsCode prettyprint">
    #include "craft.hpp"
    </pre>
    <p>• Fichier "dialog\player_inv.hpp", remplacez :</p>
    <pre class="ipsCode prettyprint">
    class ButtonAdminMenu : Life_RscButtonMenu {
    idc = 2021;
    text = "$STR_PM_AdminMenu";
    onButtonClick = "createDialog ""life_admin_menu"";";
    x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
    y = 0.805;
    w = (6.25 / 40);
    h = (1 / 25);
    };
    </pre>
    <p>Par :</p>
    <pre class="ipsCode prettyprint">
    class ButtonAdminMenu : Life_RscButtonMenu {
    idc = 2021;
    text = "$STR_PM_AdminMenu";
    onButtonClick = "createDialog ""life_admin_menu"";";
    x = 0.1 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
    y = 0.805;
    w = (6.25 / 40);
    h = (1 / 25);
    };
    </pre>
    <p>Puis en dessous ajoutez ceci :</p>
    <pre class="ipsCode prettyprint">
    class ButtonCraft : Life_RscButtonMenu {
    idc = 2025;
    text = "$STR_PM_Craft";
    onButtonClick = "createDialog ""Life_craft"";";
    x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
    y = 0.805;
    w = (6.25 / 40);
    h = (1 / 25);
    };
    </pre>
    <p>• Fichier "stringtable.xml", ajoutez :</p>
    <pre class="ipsCode prettyprint">
    <Package name="Craft">
    <Key ID="STR_CRAFT_Title">
    <Original>Crafting Menu</Original>
    <English>Crafting Menu</English>
    <German>Crafting Menu</German>
    <French>Menu de Crafting</French>
    <Italian>Crafting Menu</Italian>
    <Portuguese>Crafting Menu</Portuguese>
    </Key>
    <Key ID="STR_PM_CraftStats">
    <Original>Object to craft</Original>
    <English>Object to craft</English>
    <German>Object to craft</German>
    <French>Objet à crafter</French>
    <Italian>Object to craft</Italian>
    <Portuguese>Object to craft</Portuguese>
    </Key>
    <Key ID="STR_PM_CraftMaterials">
    <Original>Materials needed</Original>
    <English>Materials needed</English>
    <German>Materials needed</German>
    <French>Materiaux requis</French>
    <Italian>Materials needed</Italian>
    <Portuguese>Materials needed</Portuguese>
    </Key>
    <Key ID="STR_CRAFT_Button">
    <Original>Craft !</Original>
    <English>Craft !</English>
    <German>Craft !</German>
    <French>Craft !</French>
    <Italian>Craft !</Italian>
    <Portuguese>Craft !</Portuguese>
    </Key>
    <Key ID="STR_PM_NoMaterial">
    <Original>You do not have all the required materials !</Original>
    <English>You do not have all the required materials !</English>
    <German>You do not have all the required materials !</German>
    <French>Vous n'avez pas tous les matériaux requis !</French>
    <Italian>You do not have all the required materials !</Italian>
    <Portuguese>You do not have all the required materials !</Portuguese>
    </Key>
    <Key ID="STR_CRAFT_Process">
    <Original>You have crafted : %1</Original>
    <English>You have crafted : %1</English>
    <German>You have crafted : %1</German>
    <French>Vous avez crafté : %1</French>
    <Italian>You have crafted : %1</Italian>
    <Portuguese>You have crafted : %1</Portuguese>
    </Key>
    </Package>
    </pre>
    <p>Et ceci dans le package "Player_Menu" :</p>
    <pre class="ipsCode prettyprint">
    <Key ID="STR_PM_Craft">
    <Original>Craft</Original>
    <English>Craft</English>
    <German>Craft</German>
    <French>Craft</French>
    <Italian>Craft</Italian>
    <Portuguese>Craft</Portuguese>
    </Key>
    </pre>
    <p>• Dans le dossier "dialog" créer un fichier nommé "craft.hpp" :</p>
    <pre class="ipsCode prettyprint">
    /*
    File: craft.hpp
    Description: Crafting System
    Created by 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;
    	};
    
    	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;
    	};
    
    	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;
    	};
    
    	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;
    			};
    		};
    	};
    
    	class ButtonCraft : Life_RscButtonMenu {
    		idc = 672;
    		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) 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);
    	};
    };
    

    };
    </pre>
    <p>• Dans le dossier "core/actions", créer un fichier nommé "fn_craftAction.sqf" :</p>
    <pre class="ipsCode prettyprint">
    /*
    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 &lt; _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)) &lt; _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 &lt; _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;
    </pre>
    <p>• Dans le dossier "core/pmenu", créer un fichier nommé "fn_craft.sqf" :</p>
    <pre class="ipsCode prettyprint">
    /*
    File: fn_craft.sqf
    Description: Crafting System
    Created by EdgeKiller
    Coder: EdgeKiller
    */
    private["_dialog","_inv","_config","_itemInfo"]; //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

    _config = ["weapon"] call life_fnc_craftCfg;
    {
    _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 select 1);
    </pre>
    <p>• Dans le dossier "core/pmenu", créer un fichier nommé "fn_craft_update.sqf" :</p>
    <pre class="ipsCode prettyprint">
    /*
    File: fn_craft_update.sqf
    Description: Crafting System
    Created by EdgeKiller
    Coder: EdgeKiller
    */
    private["_dialog","_inv","_mats","_item","_struct","_str","_invSize","_matsNeed","_matsNum","_config"]; //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)];

    _config = ["weapon"] call life_fnc_craftCfg;
    {

    if(_item == _x select 0)then
    {
    	_matsNeed = _x select 1;
    	_invSize = count _matsNeed;
    	for [{_i = 0},{_i &lt; _invSize - 1},{_i = _i + 2}] do {
    		_str = [_matsNeed select _i] call life_fnc_varToStr;
    		_matsNum = _matsNeed select _i+1;
    		_struct = _struct + format["%1x %2&lt;br/&gt;",_matsNum,_str];
    
    	};
    };
    

    } foreach (_config select 1);

    if(_struct == "") then
    {
    _struct = "No material needed";
    };

    _mats ctrlSetStructuredText parseText format["
    <t size='0.8px'>
    %1
    </t>
    ",_struct];

    </pre>
    <p>• Pour finir dans le dossier "core/config", créer un fichier "fn_craftCfg.sqf" :</p>
    <pre class="ipsCode prettyprint">
    #include <macro.h>
    /*
    File: fn_craftCfg.sqf
    Author: EdgeKiller

    Description:
    Master configuration file for the crafting menu.
    

    */
    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]],]
    ["hgun_P07_F", ["life_inv_goldbar",2,"life_inv_copperr",1]],
    ["SMG_01_F", ["life_inv_goldbar",6,"life_inv_copperr",3,"life_inv_ironr",3,"life_inv_diamondr",1]]

    				]
    			];
    		};
    	};
    };
    

    };
    </pre>
    <p>Il s'agit du fichier du config, qui comprend donc les crafts, le script fonctionne pour les armes/habits/accessoires, tous les items de Arma 3. Il y a deux exmples de craft, je pense qu'il est assez facil de comprendre comment ca marche, donc je ne vais pas vous l'expliquer !</p>
    <p> </p>
    <p>Crédits : EdgeKiller</p>
    <p> </p>
    <p>Si vous utilisez ce système, merci de mettre les crédits 🙂 </p>
    <p> </p>
    <p>ENJOY !</p>

    1 Reply Last reply
    1
    • H
      H
      hallwalter
      wrote on last edited by
      #2

      <p>Salut, je vien ici pour te dire grand bravo pour ce que tu a fait, j'ai trouvé ton post sur un autre poste ( altisdev ).</p>
      <p> </p>
      <p>et trouvé se site la sur ta page d info de ta chaine youtube 🙂 </p>
      <p> </p>
      <p>J'ai suivi tes tutos d altislife qui mont beaucoup aidé, et ton script est juste magnifique mec, je les mis sur mon serveur, et comme promit je mettrai le droit d auteur en tout gros sur l intro de mon serveur (Script réaliser par EdgeKiller ) et dans les description car franchement je peut pas me permettre de pas le faire apres ce que tu a fait juste énorme le boulot respect mec.</p>
      <p> </p>
      <p>tout fonctionne niquel mise a part dans l interface les mot ne s'affiche pas, apres j'ai peu etre oublié un truck.</p>
      <p> </p>
      <p>Encore une fois bravo pour ton boulot, 1er script que j'ai vut d'aussi bien fait.</p>

      1 Reply Last reply
      0
      • vfrzV
        vfrzV
        vfrz
        wrote on last edited by
        #3

        <p>Merci beaucoup pour ton message, envoi moi ton Skype en message privé, ça sera plus simple pour parler 😉 </p>

        1 Reply Last reply
        0
        • H
          H
          hallwalter
          wrote on last edited by
          #4

          <p>salut EdgeKiller mon skype est steppyng1 je serai heureux de parlé avec l auteur de ce ouf de scrypt 🙂 </p>

          1 Reply Last reply
          0
          • E
            E
            Eloha
            Membre d'honneur
            wrote on last edited by
            #5

            <p>Je connais pas Arma mais ça à l'air d'être du bon boulot ! GG ! 🙂 </p>

            1 Reply Last reply
            0
            • vfrzV
              vfrzV
              vfrz
              wrote on last edited by
              #6

              <p>Merci 🙂 </p>

              1 Reply Last reply
              0
              • H
                H
                hallwalter
                wrote on last edited by
                #7

                <p>Rien que pour ce qu'il a fait ce monsieur a mériterai largement d'acheté arma 3 🙂 </p>

                1 Reply Last reply
                0
                • S
                  S
                  subherox
                  wrote on last edited by
                  #8

                  <p>salut sympas se que tu as fais, comme d'habitude tu fais du bon travail 🙂 </p>

                  1 Reply Last reply
                  0
                  • vfrzV
                    vfrzV
                    vfrz
                    wrote on last edited by
                    #9

                    <p>Merci à vous deux 🙂 </p>

                    1 Reply Last reply
                    0
                    • X
                      X
                      Xolox1263
                      wrote on last edited by
                      #10

                      <p>Alors pour moi, j'ai fait tout ce que tu as dit, et le problèmes, c'est que Craft est a la place de Sync Data, et la case Craft est noire.</p>
                      <p>Dès que je clique dessus, sa m'affiche: Resource Life_Craft not found.</p>
                      <p>Help plz 🙂 </p>

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups