Jump to content
  • 0

Fast Craft Script


Assomnia

Question

Hello everyone !

I'm seeking for help for a strange problem I have with a Fast Craft Script. Basically it's a script that allows player to craft epoch stuff via GUI.
It looks like this :

fastcraft.jpg

The problem as you can see is that it doesn't show the Items Name, same for the tools needed...
I followed a (very) old tutorial which is here :

It looks different I know, but the files are not available anymore on the link provided so I had to find some other files online.

The craft itself is actually working (without checking for the right tools apparently, even if you don't have the tool required the craft works) but appart from the name and tool everything is OK.

All my folders regarding this script look like this :

fastcraft2.jpg

My Init is looking like that :
 

//Load in compiled functions
call compile preprocessFileLineNumbers "custom\Buildables\variables.sqf";

progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "custom\Buildables\Crafting_Compiles.sqf";

if (!isDedicated) then {
call compile preprocessFileLineNumbers "custom\crafting\Init.sqf";



My Description :
 

#include "custom\crafting\dialog.hpp"



My Space_interrupt :
 

if (_dikCode == 0x24) then {
    ExecVM "custom\crafting\start.sqf";
    _handled = true;
};

if (_dikCode == 0x02) then {
AAC_1 = true;
};
if (_dikCode == 0x04) then {
AAC_3 = true;
};


Compiles :

 

    player_removeObject =            compile preprocessFileLineNumbers "custom\Buildables\interior\remove.sqf";


That's it, I forgot something, can someone help me with this ? If you need any other file or stuff tell me, anything that can help I take it !

Thanks in advance

The files are here : http://www.filedropper.com/fastcraft

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Figure out a few things...

The buildable folder is actually not necessary as it is mixing the stuff together.
I think the code in the init is ok but for some reason it wont show up the name from the items...

Can someone tell me if it's coming from the crafting\init and where ?

 

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

Found this piece of code :

 

	fnc_getName = {
		if (typeName _this == "OBJECT") then { _this = typeOf _this; };

		{
			if (isClass (configFile >> _x >> _this)) exitWith { getText (configFile >> _x >> _this >> "displayName") };
			_this
		} forEach ["CfgVehicles","CfgWeapons","CfgMagazines"];
	};

Where is it going ? ^^

Link to comment
Share on other sites

  • 0

Ok I got my thing to work finally.
No buildable folder needed, and my crafting\init :

 

  Reveal hidden contents

The problem of the correct Tools remain.

Someone to tell me where is the problem ? I can still craft items without any tools if I want...

Thanks

Link to comment
Share on other sites

  • 0

@Assomnia maybe you can make your own.

i made something similar a few time ago you can see through the files :

  Reveal hidden contents

the workshop works with hpp menus and scroll menus....

if u want craft using right click action then here you have a script base: (see lines in red to entry your values)

  Reveal hidden contents

or more easy use the mudzarelli mod:

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

Hello Juan !
Thanks for your answer. Unfortunately I'm very bad in coding stuff myself :/. I have to look on your tutorial explaining the base of scripting
I already have the Deploy anything script.
In addition to that I just wanted this Craft Menu to work  to save time when assembling all the materials to create something. Skip the animation thing + having the recipe in front of the player to see what's missing. Once build it goes directly in inventory of backpack or vehicle. Its very handy.
Even tho your workshop looks cool and I will try it out, I'd like this menu to work properly.
The script somehow don't care if I have the tools or not, can you help me to find the mistake in the code ?
Also, do you know from where it get's the recipes ? And if we can add or change them ? Dayz_server I assume but not sure
Thanks
 

Edited by Assomnia
UPD
Link to comment
Share on other sites

  • 0
  On 11/28/2016 at 8:38 AM, Assomnia said:

Hello Juan !
Thanks for your answer. Unfortunately I'm very bad in coding stuff myself :/. I have to look on your tutorial explaining the base of scripting
I already have the Deploy anything script.
In addition to that I just wanted this Craft Menu to work  to save time when assembling all the materials to create something. Skip the animation thing + having the recipe in front of the player to see what's missing. Once build it goes directly in inventory of backpack or vehicle. Its very handy.
Even tho your workshop looks cool and I will try it out, I'd like this menu to work properly.
The script somehow don't care if I have the tools or not, can you help me to find the mistake in the code ?
Also, do you know from where it get's the recipes ? And if we can add or change them ? Dayz_server I assume but not sure
Thanks
 

Expand  

see im not sure but this part do the check about items to craft and remove the materiales.

for "_i" from 1 to _amount do {
            _mags = magazines player;

            _gotRequired = {
                _item = _x select 0;
                _quantity = _x select 1;
                _count = { _x == _item } count _mags;
                _count >= _quantity
            } count _itemsIn;

            if (_gotRequired < count _itemsIn) exitWith {};

            {
                _item = _x select 0;
                _quantity = _x select 1;
                for "_x" from 1 to _quantity do {
                    player removeMagazine _item;
                };
            } count _itemsIn;

            {
                _item = _x select 0;
                _quantity = _x select 1;
                for "_x" from 1 to _quantity do {
                    player addMagazine _item;
                };
            } count _itemsOut;

            _crafted = _crafted + 1;
        };

        if (_crafted > 0) then {
            systemChat format ["<Crafting> Crafted %1 x %2 in Inventory.", _crafted, (_itemsOut select 0 select 0) call fnc_getName];
        } else {
            systemChat "<Crafting> Insufficient items.";
        };
    };

heres the epoch original player_craftItems.sqf

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

but i still thinking is much easier make your own :D

for example if u only wanna save time in craft actions.

i write it for craft clothes in a dress bench... just try to replace by your items required and items out.

  Reveal hidden contents

so you can use this base for made all you want to craft.

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...