DayZ
125 个评价
Zens Persistent Trees
2
   
奖励
收藏
已收藏
取消收藏
Type: Mod, Server
文件大小
发表于
更新日期
12.940 KB
2022 年 12 月 23 日 上午 12:47
2023 年 10 月 23 日 下午 11:24
6 项改动说明 ( 查看 )

订阅以下载
Zens Persistent Trees

描述
What Is This?

This small and simple mod adds persistent trees to DayZ.

Requires Community Framework to work.

How Does It Work?

Whenever a player cuts down a tree or bush, the server will save that info to a JSON config file when the server shuts down.

Upon the next restart, the script will cut down any trees that were cut down on the previous session.

You can specify how long a tree or bush takes to respawn (in seconds) in the JSON config. By default it's set to 3 real-life days.

Depending on your server type and population, you might want to increase or decrease this respawn period if the JSON file gets too large and you experience issues like slow shut-downs/start-ups when the mod is saving or loading the config file. I run a 1 week respawn on my servers without any issues.

You can also specify whether or not to save hard trees, soft trees, hard bushes and/or soft bushes.

The mod saves the "health" of each tree/bush, so for example, if a tree gives out 2 logs and a player cuts 1 log, the tree will be saved as 50% health. Then if a player cuts the tree before the respawn time is reached (3 days by default), they will only get 1 log before the tree falls down.

If a tree or bush is cut down completely, then on the next restart it will be cut down again.

When the server starts up it checks the timer for each saved tree, and if the timer has expired, it removes the entry from the config file and the tree will not be touched (essentially "respawning" it).

This mod is intended for hardcore servers, it makes basebuilding and survival a little more challenging and interesting by not being able to farm all the trees around your base after each restart making logs, planks and firewood a more valuable resources in some circumstances. And just makes the world feel more "lived in" across server restarts.

Only catch is you can no longer use cut-down trees or bushes to track players, but if a player leaves sticks/logs/firewood behind then you know it was cut down recently as these do not spawn when my mod cuts down the trees.

Installation Instructions:

Install this mod like any other mod - copy it into your server's root directory, add it to your launch parameters, and make sure to copy the .bikey into your server keys.

This mod should be able to run as a server-side mod, but this hasn't been tested. If it doesn't work as a server mod, just repack it into your server pack.

The mod requires Community Framework in order to work as it uses CF's UNIX timestamp function to set the tree respawn timer.

When you run your server for the first time after installing the mod, a JSON config file will be created in your server profile folder under "Zenarchist/ZenTreesConfig.json".

You can adjust the following parameters:

"ConfigVersion": "1" // Don't touch this or it will reset your config file.
"TimeToRespawn": 259200 // How many seconds until the tree "respawns".
"TreeHard": 1 // Set to 0 to disable saving hard/large tree health.
"TreeSoft": 1 // Set to 0 to disable saving soft/small tree health.
"BushHard": 1 // Set to 0 to disable saving hard/large bush health.
"BushSoft": 1 // Set to 0 to disable saving soft/small bush health.
"CutTrees":[] // This will be a list of saved trees when cut.

Repack & Source Code:

Unfortunately due to lack of time I can't maintain all of my mods all of the time. I do my best, but these mods are offered as-is. If there's a problem, you have the source code and my permission to fix it yourself and upload a fixed version to the workshop without any credit necessary. It's all free.

You can repack this mod if you like, and do anything else you want with it for that matter. The source code is on my GitHub at www.zenarchist.com

Learn Modding

Want to learn how to make your own mods? Check out my guides on YouTube: https://www.youtube.com/@Zenarchist

Buy Me A Coffee / Contact Me:

All my mods are free and open source, but it takes an enormous amount of time to put some of these mods together. If I've helped you out, please consider helping me buy my next coffee! I don't expect it, but I very much appreciate it.

To contact me you can send me a message there too - I get an insane amount of messages so it's the best way for me to filter out the noise and focus on people who are willing to support my work with a coffee first:

https://buymeacoffee.com/zenarchist

Enjoy!
热门讨论 查看全部(1)
1
2024 年 7 月 22 日 上午 10:37
Fix for servers not using #shutdown for reboots
[iUK]DrSteeeve
59 条留言
st4v0 1 月 23 日 下午 12:09 
TimeToRespawn": 0,would this setting stop the trees and bushes from respawning as that's what I'm after,thanks
marcelunzen 2024 年 11 月 27 日 上午 2:11 
Sobald ich diesen mod aktiviere bleibt im launcher die modliste leer ...
Endergoth 2024 年 10 月 3 日 上午 10:56 
Added with pleasure to the DarkMoon server.
robertistvansarkadi 2024 年 9 月 19 日 上午 11:55 
Thank you.
in comment:
ac_val650 2023. márc. 18., 23:35 
Method ist work:

Kill_Server.bat

@echo off
taskkill /im DayZServer_x64.exe
stop
RoY 2024 年 7 月 25 日 上午 9:38 
anyone one know if this mod is working with scheduled restarts?
Shaggoth (Ищезаяц) 2024 年 6 月 28 日 下午 2:53 
MidZ woksdhsaooooow server free spins x1000 loot pay to win server agrrees
Endergoth 2024 年 6 月 28 日 下午 2:44 
DarkMoon server lovels it! (Address: 88.99.164.150:2302).
HRPZ-TheKombatWombat 2023 年 11 月 29 日 下午 1:31 
Great mod btw...heads up the server side mod does infact work mate. Thank you.
[iUK]DrSteeeve 2023 年 11 月 29 日 上午 8:47 
Have made an issue on the github,
MastaHigginZ 2023 年 11 月 28 日 下午 2:36 
GetZenTreesConfig().Save();

You can try add this in CAContinuousMineWood before #endif line.
Config will be updated after each cutting action.