Possible? Arrow Creation

Bungle

Member
Hi All,

I am no scriptwriter so I am posting here to see if people would be willing and/or if its possible to create a arrowcreate.sqf and link it in the fn_selfactions inclusive in the Mission.bpo, allowing a player to create maybe 2/3 arrows out of a woodpile. Providing they have a hunting knife.

The script would be triggered by a right click option on the knife/woodpile or even a scroll option if both items are present and it would make the player sit for a period of 20/30seconds then stand replacing the woodpile with said arrows, making it only useful really in non combat situations.

This would increase the ability to truly live off the land without the use of a melee weapon as your primary.

If anyone is interested please reply here.

P.S Apologies if this idea has already been posted and is not possible.

Thanks for reading.
 
No one? I think it would be a nice addition.

Thinking about it some more, perhaps also needing metal scrap and being close a fireplace could be an option, taking a bit longer and crafting say a whole quiver.

Any takers, would be willing to employ some talented scriptwriters and help as long as its not too costly.

I will see what I can craft and get the ball rolling maybe.

Cheers,

Bungle
Lead Dayz Server Admin
www.dayzmadhouse.com
 
Right click options require modifications to the config.cpp of where that object resides, Only way to do this without that modification would be to have a constant scroll wheel options available when all the items required to make it where present.
 
Right clicking in the inventory is a custom addition made by DayZ.
There may be a way to add it, but it has not been implemented yet.
 
This is actually a really good idea and if there is any sort of mod created around it I would love to implement it into my server!
 
What about a scroll effect in fn_selfactions or fn_damageactions if both elements are present?

*Insert Coder here*

-- Self Bloodbag Scripts Call used as example only once again not a coder and don't yet know the language that well --
s_action_createarrow = -1;

if(!player and "ItemWoodpile" in magazines player and ItemKnife in toolbelt then {
s_action_createarrow = player addAction ["Create Arrows", "Scripts\createarrow.sqf",[player], 0, true, true, "", "'ItemWoodpile' in magazines player",3, true, true, "", "'Arrow' in magazines player"];
a_action_createarrow = 1;
};

if(s_action_createarrow > 0) then {
player removeAction s_action_createarrow;
s_action_createarrow = -1;


Even if that is close would still need someone to create the actual createarrow.sqf to animate the player like bandaging for 30'seconds with a break function in scroll to cancel if you are in danger.

Cheers,
Bungle
 
What about a scroll effect in fn_selfactions or fn_damageactions if both elements are present?

*Insert Coder here*

-- Self Bloodbag Scripts Call used as example only once again not a coder and don't yet know the language that well --
s_action_createarrow = -1;

if(!player and "ItemWoodpile" in magazines player and ItemKnife in toolbelt then {
s_action_createarrow = player addAction ["Create Arrows", "Scripts\createarrow.sqf",[player], 0, true, true, "", "'ItemWoodpile' in magazines player",3, true, true, "", "'Arrow' in magazines player"];
a_action_createarrow = 1;
};

if(s_action_createarrow > 0) then {
player removeAction s_action_createarrow;
s_action_createarrow = -1;


Even if that is close would still need someone to create the actual createarrow.sqf to animate the player like bandaging for 30'seconds with a break function in scroll to cancel if you are in danger.

Cheers,
Bungle
It's possible.
It would probably fit neatly if you had a "Player Menu" action when actions such as this could be committed.
Then you could slip in some more features in the future.
 
If anyone once again would be willing to spend some time on a "Crafting" Menu and add this into it THAT would be neato with ability expansions in the future to create more items/traps.. even add them into the base building mod currently in a future release? Keep the hype and great work a lot more possibilities yet to explore with DayZ and Arma II.
 
This is an intriguing idea. However, wood and a knife seem too simple. I would incorporate feathers somehow as well. Probably have to edit the code for that though.

Too keep it simple the script above is damn close.

If you want to talk more about this hit me up.


Other wise, for a mission based script, I'll take a shot at it and post if I come up with anything.
 
Here is what should work. Untested at the moment.

fn_selfActions.sqf


Code:
//fn_self_actions.sqf additon for Craft Arrow - TorturedChunk - MC
 
_hasWoodPile = "PartWoodPile" in magazines player;
 
    //Allow Player to Craft Arrows
    if(_hasWoodPile and _hasKnife and _canDo) then {
        if (s_player_craftarrow < 0) then {
            s_player_craftarrow = player addAction [localize "str_actions_craft_arrow", "\z\addons\dayz_code\actions\craft_arrow.sqf",[], 1, false, true, "", ""];
        };
    } else {
        player removeAction s_player_craftarrow;
        s_player_craftarrow = -1;
    };
 
 
 
    //This goes farther down in the file. Only displaying for education purposes.
    player removeAction s_player_craftarrow;
    s_player_craftarrow = -1;
// MC





craft_arrow.sqf
Code:
// Craft Arrow Script - TorturedChunk - MC
private["_hasWood","_hasKnife","_qty"];
 
_hasWood = "PartWoodPile" in magazines player;
_hasKnife = "ItemKnife" in items player;
 
if (_hasWood and _hasKnife) then {
 
    _qty = {_x == "PartWoodPile"} count magazines player;
   
    if ("PartWoodPile" in magazines player) then {
        for "_x" from 1 to _qty do {
            player removeMagazine "PartWoodPile";
            player addMagazine "WoodenArrow";
           
        player playActionNow "Medic";   
        sleep 5;
        _dis=10;
        _sfx = "z_chopwood_0";
        [player,_sfx,0,false,_dis] call dayz_zombieSpeak; 
        [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
        };
        cutText [format[(localize  "str_player_crafted_arrow"),_qty], "PLAIN DOWN"];
    };   
} else {
    cutText [localize "str_actions_craft_arrow_req", "PLAIN DOWN"];
};
//MC



You can change a few things here.

1. Change the Strings to static display values (ie. "Craft Arrow") or whatever.

2. Change the amount of arrows you can get out of 1 wood pile

3. Keep or remove the sound of chopping wood. :)

4. Change the location of "craft_arrow.sqf"



Other than that it should work. I have yet to test it as I am at work. If you have time check it out. I can test it later.
 
I came up with something similar except for some reason the craft option would only come up when I had some other target, even if I put it near the top of the file, also I wanted to start the base of a crafting system so this is what I came up with.

I use
Code:
sleep 1;
[] execVM "craft-it.sqf";

In my init.sqf to use this

craft-it.sqf
Code:
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,true,true,"",""];
} else {
player removeAction s_player_cando;
s_player_cando = -1;
};
};

craft_menu.sqf
Code:
pathtocraft = "craft\";
EXECscript1 = 'player execVM "'+pathtocraft+'%1"';
 
 
craftmenu =
[
["",true],
["Craft Arrow", [2],  "", -5, [["expression", format[EXECscript1,"arrow.sqf"]]], "1", "1"],
["", [-1], "", -5, [["expression", ""]], "1", "0"],
["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
];
 
 
showCommandingMenu "#USER:craftmenu";

craft/arrow.sqf
Code:
private["_hasKnife","_count","_canBuild"];
 
 
_hasKnife = "ItemKnife" in items player;
_count = {_x == "PartWoodPile"} count magazines player;
 
if (_count > 2) then {
_canBuild = true;
} else {
_canBuild = false;
};
 
if (_canBuild and _hasKnife) then {
for [{z = 0},{z < 3},{z = z + 1}] do {
player removeMagazine "PartWoodPile";
};
player playActionNow "Medic";
sleep 6;
player addMagazine "WoodenArrow";
cutText ["You have built an arrow", "PLAIN DOWN"];
 
} else {
cutText ["You cannot build an arrow", "PLAIN DOWN"];
};

This was a quick build, I did not add the sound or alert zombie code as you did Tortured, which I think should be added. I also have issues when you disconnect to lobby and come back that the option is gone, just have to tweak the script to always run. The idea here is to have the craft_menu cycle through your inventory and present all options eventually, at the moment the arrow option is hardcoded in.

Your code does work Tortured, except the SFX is "chopwood". and the options only shows up on targets that take other actions.
 
Yea, I wondered if the cursor would be an issue. If I implement this, it will be in the code and can assign the script to a right click option. The sound should work with 1.7.6.1. But either way, Enjoy :)
 
Awesome Work Guys, I will test them as soon as I can. A craft Menu.. The possibilities!!

Would it be as easy as changing arrow.sqf to need Scrap Metal as well and then craft 4 Arrows?
 
Something Like:


private["_hasKnife","_countwood","_countmetal","_canBuild"];

_hasKnife = "ItemKnife" in items player;
_countwood = {_x == "PartWoodPile"} count magazines player;
_countmetal = {_x == "PartGeneric"} count magazines player;

if (_countwood > 2 & _countmetal > 2) then
{ _canBuild = true; } else
{ _canBuild = false; };

if (_canBuild and _hasKnife) then
{ for [{z = 0},{z < 3},{z = z + 1}] do
{ player removeMagazine "PartWoodPile";
player removeMagazine "PartGeneric";
};

player playActionNow "Medic"; sleep 6;
player addMagazine "WoodenArrow","WoodenArrow","WoodenArrow","WoodenArrow";

cutText ["You have built 4 arrows", "PLAIN DOWN"]; } else {

cutText ["You cannot build arrows", "PLAIN DOWN"]; };
 
I suppose that would work. I assume scrap metal is for the tips :)


I would probably just add it as a requirement to do the script and remove it from magazines like the wood pile.

That's just me :)
 
Tortured, you said you would assign the action to a DIK key code instead of having it on the menu the whole time, but is there a way to ensure it is always there, I tried a while {true} and it did not work.
 
For DayZ Mercenary, I would add my craft_arrow.sqf to an item via dayz_equip.pbo/cfgMagazines. Just like right clicking your matches (DayZ Vanilla) to make fire.

For those that do mission side scripts, a player menu like above would be easier.
 
Back
Top