Zen's Chicken Coops - ZenarchistCode/ZenModPack GitHub Wiki

download

What Is This?

This mod adds the ability to harvest chicken feathers from chicken coops (used for crafting crossbow bolts as of DayZ update 1.21).

It's based on my Firewood mod that allows players to harvest firewood from firewood piles, pretty much just copy & pasted that mod and adapted the classnames to work with chicken coops.

There is a JSON config that allows you to specify what objects count as chicken coops and how many feathers can be harvested from each (feather quantity resets on server restarts).

How It Works:

The mod spawns invisible objects on every chicken coop 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: _chickencoop, _hutch

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 chicken coops on Namalsk for example, and players can harvest feathers from them.

The server may take a while to scan the map for chicken coops when you first run the mod (usually within 1-2 minutes). After the mod scans the map for chicken coops it will save the locations of them all so the next reboot will be much faster.

If you need to re-scan the map for chicken coops (eg. after adding custom coops with the DayZ Editor) then set DumpObjectLocations to 1 in the config. And if you need to temporarily disable the chicken coops for any reason without deleting the locations, just set SpawnChickenCoops to 0 and the next restart will not allow harvesting feathers from the coops.

The message displayed when a chicken coop runs out of feathers is also in the config for other language compatibility ("NoFeathersLeftMessage").

And finally, each chicken coop object has its own config. MinFeathers and MaxFeathers allows you to specify the min and max quantity of feathers per coop per server restart (using the default settings, small coops will spawn between 0 and 10 feathers and large hutches will spawn between 0 and 30 feathers).

MaxFeathersPerCollect allows you to specify how many feathers can be found per action performed (default is between 1-3 for small coops and 1-6 for large hutches).

Some maps might have more coops than others, so you should tweak these values depending on how easy you want players to be able to make crossbow bolts on your server.

WIth the default settings, if the player is not wearing gloves there is a small chance of cutting themselves (10% or 0.1) - this can be adjusted or disabled by tweaking ChanceOfBleed (set to 0 to disable).

DamageGloves is how much damage to deal to gloves if they are worn (there is no chance of bleeding if gloves are worn).

Don't touch Offset or Orient, those are just there to allow you to add new chicken coop objects in the future if required. Offset is the location offset to place the invisible chicken coop action object on top of the static coop object, and orientation is the orientation offset. Turn DebugOn to 1 to see the actual coop action objects as a red hologram if required.

ZenChickenCoopsConfig.json

%server_profile/Zenarchist/ZenChickenCoopsConfig.json

{
    "ConfigVersion": "1", // Don't touch this
    "LogsOn": 0, // Turn on/off text logs (for debugging)
    "DebugOn": 0, // Turn on/off debug objects (leave off unless debugging)
    "DumpObjectLocations": 0, // Re-dump the coop locations (leave off unless changing maps etc)
    "SpawnChickenCoops": 1, // Turn on/off the chicken coop spawning
    "NoFeathersLeftMessage": "It seems there are no feathers left...", // The message for no more feathers
    "CoopTypes": [ // The list of chicken coop types
        {
            "TypeName": "_chickencoop", // The static object classname to attach this to
            "ObjectName": "Zen_ChickenCoop", // The invisible coop to attach this to (this one is small)
            "MinFeathers": 0, // Minimum feathers you can get from this coop
            "MaxFeathers": 10, // Maximum feathers (randomly decides a quantity between these values on server startup)
            "MaxFeathersPerCollect": 3, // Maximum feathers you can collect from 1 action rotation (random between 1 and this)
            "ChanceOfBleed": 0.05000000074505806, // Chance of getting a cut while searching for feathers
            "DamageGloves": 5.0, // Damage to gloves after search action is complete
            "Offset": [ // 3D position offset for this item when attached to the static chicken coop object
                0.0,
                0.0,
                0.0
            ],
            "Orient": [ // 3D orientation offset for this item when attached to the static chicken coop object
                90.0,
                0.0,
                0.0
            ]
        },
        {
            "TypeName": "_hutch",
            "ObjectName": "Zen_ChickenCoop2", // Slightly larger invisible chicken coop object for hutches
            "MinFeathers": 0,
            "MaxFeathers": 30,
            "MaxFeathersPerCollect": 6,
            "ChanceOfBleed": 0.05000000074505806,
            "DamageGloves": 5.0,
            "Offset": [
                0.0,
                0.800000011920929,
                0.20000000298023225
            ],
            "Orient": [
                90.0,
                0.0,
                0.0
            ]
        }
    ],
    "CoopPositions": [] // List of automatically-detected chicken coop locations. Don't touch this.

Master Config

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

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