Idea for a script--cutting down trees

Hey guys,

Just wanted to throw out an idea here, see if anyone could manage this... Looking for a way to take down trees in the woods without having to, for example, ram it with a ural.

My idea relates to harvesting wood with the hatchet--is there a way to make it so that when you harvest wood, after you hit the limit of wood piles you can harvest, the tree will disappear and be replaced by the little tree stump model (or just no tree at all)?

This would be useful for vehicles that are stuck in-between trees, such as helicopters that would get their blades damaged--one could simply harvest all of the wood from the surrounding trees and safely remove the vehicle.

Anyone think this can be done?
 
i dont know if its possible to delete them as they are part of the base map, but they can defo be knocked down with scripts...
if you have any coding experience i'd take a look at epoch as they have that feature when harvesting wood...
 
I do not mean completely removing them from the map, i just mean for the duration of gameplay between restarts. Just a script that would recognize: 15/15 wood has been harvested (which it does already), therefore turn tree into tree stump model (which exist, I see them all the time), then upon restart the tree will be back how it was.

Just would be convenient for when you have a heli or something trapped between some trees that disable it from taking off as the rotors would clip the tree, now making all helis that are found viable opportunities to obtain a helicopter. Biggest annoyance for me is about the fact that hills/inclines make vehicles slide down them is when the chopper slides far enough that the blades go into the treeline and all of a sudden your perfectly repaired heli is now not able to be used, so why not have the option to just cut down the trees you know?

Also, I am on DayZ 1.8.0.3, not Epoch, and my coding experienced is pretty much just limited to taking scripts that have already been written and integrating them into my server lol.
 
Dayzmod 1.8 basically already has the code there for you, its just that the line to damage the trees is commented out.

player_chopWood.sqf

After this line

Code:
        if (_proceed) then {

Add this:

Code:
            if("" == typeOf _tree) then {
                _tree setDamage 1;
            };

And in your compiles point to the new player_chopWood.sqf eg

Code:
    player_chopWood = compile preprocessFileLineNumbers "fixes\player_chopWood.sqf";
 
Last edited:
Dayzmod 1.8 basically already has the code there for you, its just that the line to damage the trees is commented out.

player_chopWood.sqf

After this line

Code:
        if (_proceed) then {

Add this:

Code:
            if("" == typeOf _tree) then {
                _tree setDamage 1;
            };

And in your compiles point to the new player_chopWood.sqf eg

Code:
    player_chopWood = compile preprocessFileLineNumbers "fixes\player_chopWood.sqf";

Question: Do i make a copy of the player_chopWood.sqf and place that in the missions folder?
Why isn't it enough to just change the code in player_chopWood.sqf and save and the repack?

Thanks.
 
Question: Do i make a copy of the player_chopWood.sqf and place that in the missions folder?
Why isn't it enough to just change the code in player_chopWood.sqf and save and the repack?

Thanks.
Player_chop wood is a client side file from dayzcode.pbo you have to override its definition in the mission file or other clients wouldn't have the modified code and would still use the unmodified one.

Copy it somewhere in the mission folder and if you don't have compiles.sqf in there from other things just add this line below the compiles.sqf one in init.sqf

player_chopWood = compile preprocessFileLineNumbers "fixes\player_chopWood.sqf";

(assuming you placed it in a fixes folder in the mission pbo.
 
Back
Top