Possible? Arrow Creation

The menu version works but it only works on initial logon if you disconnect to lobby and go back in it does not, or if you die, I am working on the fix for this, also mine is coded to need 3 wood piles per arrow, may be a bit much, I'll code this in to a variable so it can be easily updated.
 
Awesome work guys keep it up. If we get a menu version there are possibilities to craft other items/Recipes?

Also chuck when you say you need to look at something in your version? Do you mean player? Would it be possible to move it to a menu item on a lit fireplace? Maybe if you have a woodpile and 3 tin cans? or woodpile and scrapmetal?
 
Awesome work guys keep it up. If we get a menu version there are possibilities to craft other items/Recipes?

Also chuck when you say you need to look at something in your version? Do you mean player? Would it be possible to move it to a menu item on a lit fireplace? Maybe if you have a woodpile and 3 tin cans? or woodpile and scrapmetal?

What I wrote is based on the cursor target. So all you have to do is have the required items in your inventory and look at say, a loot pile, or a car, and the option will show. Its not the cleanest method, but it works.

A couple of my players like the idea of crafting arrows because they prefer to use the crossbow. I will probably add this to a "Right-Click" option to the wood pile or Knife in the inventory. Just like the make fire "Right-Click".

The player menu is a little out of my realm. But looking at it, if the login issue is fixed, it should work just as good for those that use this as a "fixes" method.
 
Something like this is how it would look editing the code:

dayz_equip.pbo >> cfgWeapons.hpp

Code:
    class ItemKnife : ItemCore {
        scope = public;
        displayName = $STR_EQUIP_NAME_4;
        model = "\dayz_equip\models\knife_gear.p3d";
        picture = "\dayz_equip\textures\equip_knife_ca.paa";
        descriptionShort = $STR_EQUIP_DESC_4;
       
        class ItemActions {
            class Use {
                text = $STR_ACTIONS_CRAFT_ARROW;
                script = "spawn craft_arrow;";
                use[] = {"ItemKnife"};
            };
        };
    };

This creates a "Right-Click" option on the knife and will run the craft_arrow.sqf (once I add it to the variables and strings) and if you don't have the required items, the craft_arrow.sqf will display a string in game telling you that you don't.
 
So I figured out how to keep the menu around through deaths and lobby disconnects, I have also added the recipes section that was requested. Thanks to Tortured for much of the thinking behind this. Here's what I did:

In the fixes/compiles.sqf I added a line under player_firemonitor
Code:
player_craft =compile preprocessFileLineNumbers "crafting.sqf";

And in the fixes/variables.sqf under s_player_followdog line I added
Code:
s_player_canDo =-1;

Crafting.sqf - calls the menu
Code:
// ---------------------------------------------------------------------------------------------------------
// Created by Morox
// Crafting Menu
// ---------------------------------------------------------------------------------------------------------
private["_onLadder","_canDo"];
 
_onLadder =(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
 
if(_canDo) then {
if(s_player_cando < 0) then {
s_player_cando = player addAction ["Craft", "craft_menu.sqf",[],0,false,true,"",""];
}; } else {
player removeAction s_player_cando;
};

craft_menu.sqf - contains both the recipes and the menu building

http://dayz.zombiesurvivalonline.com/files/craft_menu.txt
*rename .sqf on download

Then I created a folder called craft (it's called by craft_menu.sqf) which contains the actual actions of the crafting, currently there are 2 in the example

arrow.sqf

Code:
// ---------------------------------------------------------------------------------------------------------
// Created by Morox
// Crafting Menu
// ---------------------------------------------------------------------------------------------------------
 
//Build an arrow from 3 woodpiles
 
for [{z = 0},{z < 3},{z = z + 1}] do {
player removeMagazine "PartWoodPile";
};
player playActionNow "Medic";
_dis=10;
_sfx = "chopwood";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
player addMagazine "WoodenArrow";
cutText ["You have built an arrow", "PLAIN DOWN"];

wire.sqf

Code:
// ---------------------------------------------------------------------------------------------------------
// Created by Morox
// Crafting Menu
// ---------------------------------------------------------------------------------------------------------
 
//Build a wire fence kit from 1 Tin can
 
for [{z = 0},{z < 1},{z = z + 1}] do {
player removeMagazine "TrashTinCan";
};
player playActionNow "Medic";
_dis=10;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
player addMagazine "ItemWire";
cutText ["You have built some wire", "PLAIN DOWN"];

And the final thing to do is to modify the fixes/fn_selfActions.sqf at the very bottom of the file add
Code:
[] call player_craft;

Let me know if there are any requests or questions.
 
Back
Top