Crafting System

no, blahblahblahblah is just a default if it cannot get the variable from the AI. So the switch statements gets blahblahblah and runs the default {}; otherwise it did get a variable and runs that code within the switch.

Make sure you have the setVariable command server side.

Then if you just walk up to the different AI, you should see the "Medical" or "Weapons" etc.
Once you click on that, it should go to the next step - showing the items for that category.


I have followed your steps and double checked everything and it still isn't giving me the option to trade!
 
Ahh, I know why.
In fn_SelfAction, because of this line: if ((typeOf cursorTarget in _aitypes) and (_cursorDistance < 5)) then {

You need to add somewhere above

_cursorDistance = player distance cursorTarget;



you can also have a peek at my github, its a bunch of customization/scripts I put ontop of the Trinity mod. They can be copied out to any mod - actually a lot of these were copied over from Celle.

https://github.com/allen-k/DayZ_Trinity_Dayzhorror <- AI Traders and stuff

https://github.com/allen-k/DayZ_Celle_Manatees <- Crafting System
 
hi, this looks great and i would love to add crafting to our server
however,im a bit of a noob to scripting, so have a few questions, please be patient with me lol
does this work on dayz.st cherinus server?
and is if so, are there any changes i would need to make ?
lastly, is everything we need in the original thread? as i would like to add a lot more to this over time
thanks for any help
 
The script wasn't even supposed to be in the release section, the ones responsible for organizing the new structure thought to put it in the release section. - I only meant it to be a discussion for people with some scripting experience and to expand on it themselves using the oven.sqf back-end primarily.

But to answer your question, The script will work on any host, nothing is host dependent, you just need to know how to decompress and compress your .pbo files.
And if you follow the initial release thread instructions as well as some of the posts in this thread about missing variables - then others have already reported success.

The script was originally written for 1.7.6.1, I never transferred it to 1.7.7 cause I started working in Arma 3 Zoombies Dayz, but there is no reason for it not to work in 1.7.7, you might just need to use some brain power to get it working
 
i have got it runngin fine on first attempt :), thanks for the fast reply
only issue i have is being in just the right spot by a camp fire to get the menu up, otherwise its perfect
even added a few of my own items that we needed, all in all, great job on the script thanks
 
i have got it runngin fine on first attempt :), thanks for the fast reply
only issue i have is being in just the right spot by a camp fire to get the menu up, otherwise its perfect
even added a few of my own items that we needed, all in all, great job on the script thanks

Could you share with us the corrected version of the script for new patch 1.7.7.1?
 
This is AWSOME!! It's gonna really let me personalize my server. Thanks a lot to everyone one had a hand in this!

One question though; is there a way to break the stuff back down?

say i want "A" and i need items "B" "C" and "D" to make it. After I make it, is there a way I can put "B" "C" and "D" in the "what I want" category and put "A" in the "what i need" category and get the materials back? I was thinking of adding brackets, but it looks like they all run together, so it would automatically assume the second item was a "needed" item.
 
Also, could u give me and example of how it would look to make an m9 into and m9sd using an empty tin can, toilet paper, and a bandage? Im on dayz.st if it makes a difference. Thanks
 
Love the script, super job.

To let the player know the common name of which items are required, rather than class names, insert a fourth parameter for passing to the oven. i.e.
Code:
    manatee_craft_menu_wea set [count manatee_craft_menu_wea, player addaction [("<t color=""#FFC726"">" + ("    Satchel Charge") +"</t>"),"addons\oven.sqf",
        [
        [0,"Satchel Charge","PipeBomb",1],                //what is being returned
        [                                                //Ingredients
        [0,"1Rnd_HE_M203",3,"M203 HE"],                    //1st requirement
        [0,"HandGrenade_West",3,"M97 Hand Grenade"]        //2nd requirement
        ]
        ],
        92,false,false,"",_restriction]];                //action parameters

Then call that when checking for ingredients at the bottom of oven.sqf by replacing _itemClass3 with _itemName in the _neededString text;
Code:
} else {
    // the players gear does not match
    _neededString = [];
    {
        _itemClass3 = _x select 1;
        _itemQty3 = _x select 2;
        _itemName3 = _x select 3;
        _inUserInv3 = _itemQty3-({_x == _itemClass3} count magazines player);
        _neededString set [count _neededString, format["%1/%2 %3",_inUserInv3,_itemQty3,_itemName3]];
 
    } forEach _neededItems;
 
    cutText [format ["To make a %1 you need: %2",_makeItemName, _neededString], "PLAIN DOWN",1];
};

So if you have none of the ingredients, this returns;

To make a Satchel Charge you need 3/3 M203, 3/3 M97 Handgrenade
 
Nice addition Darce,

To answer your question about backpacks, its possible, but would require some tinkering in several files.
Where previously there was a case for weapons and magazines, 0 and 1 respectively, you'll need a case 2 for backpacks.

Therefore, in the oven, if the output is a case 2, which is backpack, it will do the addBackpack command or whatever it is yo actually give the player the backpack they are crafting.

If you want to add the item INTO the backpack, you can maybe do something like check the players inventory items or magazines, can count them.
If they are above a certain threshold, you can use something like addBackpackCargoGlobal to place it into the backpack.

Again, it all works off of cases, and the original code only accounts for weapons and magazines, so you'll need to add another case for crafting the backpacks, adding items into the backpack is a little different as mentioned above, but it can be implemented into the oven.
 
ok so I have followed the instructions, and re checked more than i care to mention, Driving me insane.
I go to a barrel, light it, nothing comes up, only Dance!, I use Blurgaming Antihack.
so , im a little stuck....
is it at a barrel, or do I have to build a fire?
how do I add the exceptions in Blurs Anti hack?
would Dance possibly be stopping it?

Any Help guys, Cheers
 
Last edited:
I believe the original code looks for a FLAME, not the barrel or fire pit itself, so anything that's actually burning.
It's been a while so I don't remember exactly now.

For any Anti-Hack, they may block "Actions"
So for any mod, where ever you see something like MyModCommand = AddAction ...........
Then you want to add MyModCommand into the list of exceptions in the anti-hack

I think in the original code, there is also an array of actions - add those variables into the similar spot in the anti-hack where it allows for players to see the "Repair" options on vehicles. (So if you already tried to add the exception, maybe you need to add it a different way as if its an array of commands and not a singular one).

Good Luck..... You could also modify the restrictions on the actions and change the activator from a flame to a barrel, or table object (epoch) if you wish.
 
Hey Allen

so i killed my anti hack as a test, still no option on mouse wheel, not sure where i have gone wrong, any help is greatly recieved, as this is now driving me nuts, if not, no worries, i appreciate the help already given.

Chrs
Lee
 
Nice script!

I cant seem to get ItemTrapTripwireCans working in this crafting system. The script is recognizing that I have all the right materials on me, but doesn't continue the crafting.

Here is a snippet from my survival.sqf

Code:
    manatee_craft_menu_sur set [count manatee_craft_menu_sur, player addaction [("<t color=""#FFC726"">" + ("    Grenade Tripwire") +"</t>"),"crafting\oven.sqf",[[0,"Grenade Tripwire","ItemTrapTripwireGrenade",1],[[0,"equip_string",1],[0,"equip_duct_tape",1],[0,"partwoodpile",1],[0,"HandGrenade_west",1]]],94,false,false,"",_restriction]];
    manatee_craft_menu_sur set [count manatee_craft_menu_sur, player addaction [("<t color=""#FFC726"">" + ("    Flare Tripwire") +"</t>"),"crafting\oven.sqf",[[0,"Flare Tripwire","ItemTrapTripwireFlare",1],[[0,"equip_string",1],[0,"equip_duct_tape",1],[0,"partwoodpile",1],[0,"HandRoadFlare",1]]],94,false,false,"",_restriction]];
    manatee_craft_menu_sur set [count manatee_craft_menu_sur, player addaction [("<t color=""#FFC726"">" + ("    Tin Can Tripwire") +"</t>"),"crafting\oven.sqf",[[0,"Tin Can Tripwire","ItemTrapTripwireCans",1],[[0,"equip_string",1],[0,"partwoodpile",1],[0,"TrashtinCan",1]]],94,false,false,"",_restriction]];

Everything else is working magically fine!
 
Back
Top