AgricultureCore
AgricultureCore AgricultureCore is the shared foundation for my Agriculture-based mods. It’s mostly meant to combine common scripts/content in one place so updates can be isolated to this mod, instead of duplicating code and files across multiple projects. In-game, it provides a configurable core plant/harvest system (driven by a plant registry and server settings) and includes shared item/effect functionality used… (more)
AgricultureCore AgricultureCore is the shared foundation for my Agriculture-based mods. It’s mostly meant to combine common scripts/content in one place so updates can be isolated to this mod, instead of duplicating code and files across multiple projects. In-game, it provides a configurable core plant/harvest system (driven by a plant registry and server settings) and includes shared item/effect functionality used by related mods. Features Core plant registry system via AC_RegisterPlant() and g_AG_PlantRegistry for registered plant types (GrowTime, CropCount, InitialYield, minute-based grow time option, and fertilize behavior flags). Modded plant lifecycle behavior (registered plants) Custom growth timing and maturity calculations for registered plants. Spoil timing controlled by a server setting (MinutesToPlantSpoiling). Infestation chance set to 0.0 in the PlantBase constructor. Fertilization can affect crop count and yield based on registry flags and fertility/harvesting efficiency. Modded harvesting behavior Harvest action is gated so it only executes when a plant exists and has crops. Harvest spam protection (5-second cooldown) to prevent repeated harvest processing. Harvest spawns crop items up to the plant’s crop count and sets created items to maximum quantity. If the plant is spoiled, harvested edible items are set to the rotten food stage where applicable. Optional plant removal after harvest (RemovePlantAfterHarvest). Plant removal behavior Optional PlantMaterial drop when removing a plant, controlled by EnablePlantMaterialDrop (quantity scales with current plant material quantity). Persistence Saves/loads crop state, crop count, and current yield (server-side). Exposes yield accessors (GetCurrentYield/SetCurrentYield). Server configuration + client sync Server loads a JSON config, supports versioning/backup of outdated configs, and validates minimum values. Clients request the config at mission start and receive it via RPC so client-side scripts can use the server’s settings. Optional server/client debug logging toggles via config. Smokable base + smoke particle support AC_SmokableBase provides a network-synced smoking state and synchronized health value. Smoke particles are started/stopped and tuned based on smoke state (SMOKING / INACTIVE / NOT_SMOKING). Includes a registered particle entry: AC_SMOKE (from "AgricultureCore/Particles/" "smoke") and an EffSmoke effect that uses it. Rolling papers items Adds AC_RollingPapers (and Green/Silver variants) with quantity (0–20) and an "AC_RollingPapers" inventory slot/proxy. Cigarette pack item Adds AC_CigarettePack_Empty (crafted loot category) using the vanilla cigarette pack model with custom textures/material damage states. Installation Subscribe to the mod on the Workshop. Enable AgricultureCore in the DayZ Launcher (client and server). Restart the server/client after enabling. Configuration AgricultureCore uses a JSON configuration (loaded server-side) and sends the active settings to clients on mission start. Config fields present: EnableServerDebugLogging EnableClientDebugLogging RemovePlantAfterHarvest EnablePlantMaterialDrop MinutesToPlantSpoiling SecondsToFertilizeUsingPlantMaterial SecondsToFertilizeUsingGardenLime Compatibility Uses vanilla cultivation scripting (requires DZ_Gear_Cultivation as an addon dependency). Modifies core behavior for PlantBase and ActionHarvestCrops; any other mod that also overrides these may conflict depending on load order and implementation. You may repack this mod, although I don't recommend it because if I update it, and you aren't fast enough updating your repacked version, it may mess up CannabisPlus, DrugsPlus, and/or GardeningPlus. Credits Author: IceBlade
No file I/O on hot paths, no timers created per event, no per-player-per-frame hooks.
1 chain break, all on specific classes the mod replaces wholesale — matters only if another mod patches the same classes.
less than 0.001% of each server frame at 100 players (0.000 ms/s). Counts hook dispatch and timers only, not what the hooks do inside. Methodology.
Structural load of the 328 scripted mods analyzed, lightest on the left. This mod's bar is lit; 6 others share it. Ranked list.
Lifecycle hooks carry 81% of this mod's structural load. 0.000 ms/s in all.
4 hooks · 0.000008 ms/s
| Lifecycle hooksrun when an entity is created, loaded or deleted | 4 hooks | 0.000008 ms/s | 81% | MissionServer.OnInit, PlantBase.OnStoreLoad, PlantBase.OnStoreSave and 1 more |
Counts how often each hook is dispatched and how many timers stay alive, not what the code inside does. Some rates are order-of-magnitude estimates; the methodology lists which.
Chain breaks, by consequence
1 override that skip super(), ranked by how much they can affect. On any server a break replaces vanilla's behaviour on that method and silences every earlier-loaded mod hooking it.
RemovePlantEx
Only this class is affected. Matters only if another mod in your stack patches the same class.
1 class
PlantBase1 location
AgricultureCore.pbo::scripts\4_world\entities\gardenbase\plantbase.c:136Other findings
super() only on some paths · 4 · warning
- ActionHarvestCrops.OnExecuteClient calls super.OnExecuteClient() only on some paths — on the others the chain below this mod is dropped.
AgricultureCore.pbo::scripts\4_world\AgricultureCore.c:11 - ActionHarvestCrops.OnExecuteServer calls super.OnExecuteServer() only on some paths — on the others the chain below this mod is dropped.
AgricultureCore.pbo::scripts\4_world\AgricultureCore.c:19 - PlantBase.Harvest calls super.Harvest() only on some paths — on the others the chain below this mod is dropped.
AgricultureCore.pbo::scripts\4_world\entities\gardenbase\plantbase.c:78 - PlantBase.Init calls super.Init() only on some paths — on the others the chain below this mod is dropped.
AgricultureCore.pbo::scripts\4_world\entities\gardenbase\plantbase.c:14
- ActionHarvestCrops.OnExecuteClient calls super.OnExecuteClient() only on some paths — on the others the chain below this mod is dropped.
Which vanilla methods the mod hooks, which of them drop the chain, how often each hook fires, and which risky calls sit inside hot hooks.
How long hook bodies take, network cost, or engine-side load. Measured across live fleets, most server lag comes from the engine and world state, not mod script chains — a light footprint does not clear a mod of lag, and a heavy one does not convict it. Methodology.
Everything else
All 17 overrides
Surface is the dispatch tier the rubric can price (— = unpriced); server is whether the override exists on a dedicated server; super() shows whether the vanilla chain is preserved on a server.
| method | surface | server | super() | where |
|---|---|---|---|---|
ActionConstructor.RegisterActions |
— | yes | ✓ | AgricultureCore.pbo::scripts\4_world\classes\useractionscomponent\actionconstructor.c:3 |
ActionHarvestCrops.OnExecuteClient |
— | yes | conditional | AgricultureCore.pbo::scripts\4_world\AgricultureCore.c:11 |
ActionHarvestCrops.OnExecuteServer |
— | yes | conditional | AgricultureCore.pbo::scripts\4_world\AgricultureCore.c:19 |
CAContinuousFertilizeGardenSlot.Setup |
— | yes | ✓ | AgricultureCore.pbo::scripts\4_world\classes\useractionscomponent\actions\continuous\cacontinuousfertilizegardenslot.c:6 |
MissionGameplay.OnInit |
T3 | yes | ✓ | AgricultureCore.pbo::scripts\5_mission\MissionGameplay.c:5 |
MissionGameplay.OnMissionStart |
T3 | yes | ✓ | AgricultureCore.pbo::scripts\5_mission\MissionGameplay.c:17 |
MissionServer.OnInit |
T3 | yes | ✓ | AgricultureCore.pbo::scripts\5_mission\MissionServer.c:5 |
ModItemRegisterCallbacks.RegisterHeavy |
— | yes | ✓ | AgricultureCore.pbo::scripts\4_world\entities\manbase\AC_ItemInHands.c:4 |
PlantBase.Init |
— | yes | conditional | AgricultureCore.pbo::scripts\4_world\entities\gardenbase\plantbase.c:14 |
PlantBase.Harvest |
— | yes | conditional | AgricultureCore.pbo::scripts\4_world\entities\gardenbase\plantbase.c:78 |
PlantBase.RemovePlantEx |
— | yes | ✗ none | AgricultureCore.pbo::scripts\4_world\entities\gardenbase\plantbase.c:136 |
PlantBase.OnStoreLoad |
T3 | yes | ✓ | AgricultureCore.pbo::scripts\4_world\entities\gardenbase\plantbase.c:155 |
PlantBase.OnStoreSave |
T3 | yes | ✓ | AgricultureCore.pbo::scripts\4_world\entities\gardenbase\plantbase.c:169 |
PlayerBase.Init |
— | yes | ✓ | AgricultureCore.pbo::scripts\4_world\entities\manbase\AC_PlayerBase.c:10 |
PlayerBase.OnPlayerLoaded |
— | yes | ✓ | AgricultureCore.pbo::scripts\4_world\entities\manbase\AC_PlayerBase.c:16 |
PlayerBase.EEKilled |
T3 | yes | ✓ | AgricultureCore.pbo::scripts\4_world\entities\manbase\AC_PlayerBase.c:27 |
PluginRecipesManager.RegisterRecipies |
— | yes | ✓ | AgricultureCore.pbo::scripts\4_world\classes\recipes\pluginrecipesmanagerbase.c:3 |
Dispatch surfaces and timers the grade prices
| surface | tier | rate (Hz) | rate source | ms/s |
|---|---|---|---|---|
PlantBase.OnStoreLoad | T3 | 0.1 | placeholder | 0.0000 |
PlantBase.OnStoreSave | T3 | 0.1 | placeholder | 0.0000 |
PlayerBase.EEKilled | T3 | 0.1 | placeholder | 0.0000 |
MissionServer.OnInit | T3 | 0.1 | placeholder | 0.0000 |
Includes 0.000 ms/s from placeholder-rated surfaces.
Load-order constraints (CfgPatches)
What each PBO declares: its addon identity and the addons it requires to be loaded first (requiredAddons). A partial load-order signal from the mod's own metadata.
AgricultureCore.pbo
AC_EmptyBagsrequiredVersion 0.1 — requiresDZ_DataAC_EmptyBagsrequiredVersion 0.1 — requiresDZ_DataAC_BricksrequiredVersion 0.1 — requiresDZ_DataAC_BricksrequiredVersion 0.1 — requiresDZ_DataAC_CigarettepacksrequiredVersion 0.1 — requiresDZ_Data,DZ_Gear_MedicalAC_CigarettepacksrequiredVersion 0.1 — requiresDZ_Data,DZ_Gear_MedicalAC_ComposterrequiredVersion 0.1 — requiresDZ_Data,DZ_Gear_Cultivation,DZ_Gear_Consumables,AgricultureCoreAC_ComposterrequiredVersion 0.1 — requiresDZ_Data,DZ_Gear_Cultivation,DZ_Gear_Consumables,AgricultureCoreAgricultureCorerequiredVersion 0.1 — requiresDZ_Data,DZ_Scripts,DZ_Gear_CultivationAgricultureCorerequiredVersion 0.1 — requiresDZ_Data,DZ_Scripts,DZ_Gear_CultivationAC_RollingpaperrequiredVersion 0.1 — requiresDZ_DataAC_RollingpaperrequiredVersion 0.1 — requiresDZ_Data
census 1.1 · findings 1.1 · hash 300622766cbaa0e1