Zen's Firewood Piles - ZenarchistCode/ZenModPack GitHub Wiki

download

What Is This?

This mod adds the ability to harvest firewood from static wood piles and reserves.

You can harvest firewood with your hands, but it takes longer and has the chance to cut you if you're not wearing gloves.

Using a tool like an axe or hatchet is much faster, doesn't have a chance to cut you, but will damage your tool over time.

Wood piles have a limited supply that can be configured by server owners. Once that supply is exhausted, the wood pile cannot be harvested anymore.

How It Works:

The mod spawns invisible objects on every wood pile on the map based on the objects you define in the json config.

By default the mod will automatically detect the static object types that contain these words in their classname: _woodreserve, _woodpile_forest, _woodpile1, _woodpile2

For each wood pile object type you can configure the chance of bleeding, the minimum & maximum wood quantity you can harvest before the pile turns rotten, the damage done to gloves and the damage done to tools (axes etc). You can also configure the message sent to players when the wood pile is exhausted (so you can translate it to other languages).

Note: When you run your server for the first time after installing the mod, the mod will take some time to automatically detect all the wood piles and save them to the json config located in profiles/Zenarchist/ZenFirewoodConfig.json.

Depending on the map and how many wood piles are on it, I recommend waiting at least a couple of minutes for the json config to update. Once it has updated, you may want to restart your server one more time as the server seems to lag out for a while after detecting all the objects initially.

Once the mod has analyzed the map and detected all the firewood piles it will save their locations to the json config and the next restart will not lag at all. Set DebugOn to 1 in the json config to see the firewood objects visually - by default they spawn invisible, but changing this to 1 will spawn them in as red rectangles so you can confirm they are working.

If you add new wood piles or have some other reason to want to re-scan the map for wood piles, set DumpObjectLocations to 1 in the json config file. And if you want to temporarily disable the wood piles for any reason, set SpawnFirewoodObjects to 0.

It works with the vanilla static objects and any bldr_ objects placed with the DayZ Editor or spawned in with the json/init.c/etc methods.

This means you can place fire wood piles out on the ice on Namalsk for example, and you can create fires out of wood piles at military bases etc.

So check out the source code if you're wanting to add dynamic interactions to other static objects other than fire wood piles.

ZenFirewoodConfig.json

%server_profile/Zenarchist/ZenFirewoodConfig.json

{
    "ConfigVersion": "1", // Don't touch this
    "LogsOn": 0, // Turns text logs on/off
    "DebugOn": 0, // Turn on/off debug objects (leave off unless debugging/adding new WoodTypes objects)
    "DumpObjectLocations": 0, // Re-dump the firewood locations (leave off unless changing maps etc)
    "SpawnFirewoodObjects": 1, // Turn on/off the firewood pile spawning
    "NoWoodLeftMessage": "It seems the wood left in this pile is wet and rotten, I can't use this...", // The message for no more wood
    "WoodTypes": [
        {
            "TypeName": "_woodreserve", // The static object classname to attach this to
            "MinWood": 0, // The minimum amount of wood randomly spawned on this pile
            "MaxWood": 6, // The maximum amount of wood randomly spawned on this pile
            "ChanceOfBleed": 0.33000001311302187, // Chance of getting a bleed if not wearing gloves
            "DamageGloves": 10.0, // Damage to gloves when harvesting wood
            "DamageTool": 10.0, // Damage to hatchet/axe/etc when harvesting wood
            "Offset": [ // 3D position offset of this object when attached to static woodpile obj
                0.0,
                0.0,
                0.0
            ],
            "Orient": [ // 3D orientation offset of this object when attached to static woodpile obj
                0.0,
                0.0,
                0.0
            ]
        },
        {
            "TypeName": "_woodpile_forest", // A different static wood pile object
            "MinWood": 0,
            "MaxWood": 6,
            "ChanceOfBleed": 0.33000001311302187,
            "DamageGloves": 10.0,
            "DamageTool": 10.0,
            "Offset": [ // Different offset required for this obj
                0.0,
                0.30000001192092898,
                0.0
            ],
            "Orient": [ // Different orientation required (use DebugOn to see the object rotation)
                90.0,
                0.0,
                90.0
            ]
        }
    ],
    "WoodPositions": [] // List of automatically-detected static firewood locations. Don't touch this.

Master Config

To disable this mod set "ZenFireWood": 0 in %server_profile/Zenarchist/Utilities/ZenModPackConfig.json

⚠️ **GitHub.com Fallback** ⚠️