-
Notifications
You must be signed in to change notification settings - Fork 6
ZenRebuildableWells
Source: https://github.com/ZenarchistCode/ZenRebuildableWells
NOTE: This mod is included in my modpack and can be enabled/disabled via ZenRebuildableWells in ZenModPackConfig.json
This mod adds the ability to rebuild defunct wells. It requires all the attached materials + a sledgehammer or pickaxe to build, and is persistent.
The wells are the ones screenshotted above, usually found in remote areas, great for building an off-grid home!
The server config allows admins to specify how long the wells last for once rebuilt.
Make sure to add the types.xml entries included in the mod folder to prevent the wells despawning on restarts.
This mod uses the same method as my firewood piles + chicken coops mods - when the server starts up for the first time after installation, it may lag for a couple of minutes as it scans the entire map for the target static well object locations (misc_well.p3d) - it then spawns an invisible proxy object over the well with the required material attachments for building. This process only happens once (unless forced by JSON config).
There are 3 steps to the mod's functionality, it's complicated to explain in plain English but it's not really that complex:
-
The mod scans the map for the broken static well objects and spawns a persistent invisible proxy on them (
Zen_RebuildableWell) with a default lifetime of 999999 unless atypes.xmlentry is specified to override its lifetime. Usually you'd want this "rebuildable" invisible proxy to stay for an entire server wipe cycle, so 999999 is fine and you do not need to do anything if you're happy with this setup. -
Once the player "builds" the well by attaching all the required materials + using a sledgehammer/pickaxe on
Zen_RebuildableWell, that invisible object is deleted and replaced with a different invisible object which will spawn a regular vanilla well on top of it inside of the static well object on every server startup. This new invisible proxy object is calledZen_RebuiltWell_Spawnand is persistent. So, to set how long a rebuilt well lasts for, you can add atypes.xmlentry. By default theZen_RebuiltWell_Spawnentity's lifetime is also forced to 999999 within the mod's code unless it's specified in yourtypes.xml, which means with the default setup and not touching anything in your server config, a rebuilt well lasts forever until the server is wiped or an admin deletes it. -
If the well despawns for any reason, the
Zen_RebuildableWellinvisible buildable proxy respawns back on the well and players will need to rebuild it to use it again. So if you want wells to "break" after a certain period of time, add atypes.xmlentry forZen_RebuiltWell_Spawnand specify how long the well should last before requiring rebuilding.
Here's an example using the lifetime config of a vanilla Fence (which means a nearby territory flag WILL keep it alive):
<type name="Zen_RebuildableWell">
<nominal>0</nominal>
<lifetime>3888000</lifetime>
<restock>0</restock>
<min>0</min>
<quantmin>-1</quantmin>
<quantmax>-1</quantmax>
<cost>100</cost>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="1" deloot="0"/>
<category name="tools"/>
</type>Config file: profiles/Zenarchist/ZenRebuildableWellsConfig.json
{
"ConfigVersion": "1.29.1", // Don't touch
"DumpAllObjects": 0, // Force a re-dump of all well locations on map
"SpawnMapGroupPosXML": 0, // Prints mapgrouppos.xml locations to profiles root folder
"SpawnObjects": 0, // Turn on/off spawning the wells (do not touch - this is handled automatically)
"SpawnHooks": [ // List of objects to "hook" onto to spawn these rebuildable well objects
{
"TargetObjectType": "misc_well.p3d",
"SpawnObjectType": "Zen_RebuildableWell",
"SpawnObjectScale": 1.0,
"OffsetPosition": [
0.0,
0.0,
0.0
],
"OffsetOrientation": [
0.0,
0.0,
0.0
],
"ChanceOfSpawn": 1.0
}
],
"DamageTool": 100, // How much to damage the build tool (sledgehammer)
"RespawnRebuildableWells": 1, // If true, then when a rebuilt well despawns, players can re-build it
"DeleteRebuildableWells": 0, // This will delete all rebuildable wells off the map
"AllowDismantleWell": 1 // Enable/disable destroying a rebuilt well with a sledgehammer
}All my mods are open-source and published under the Mozilla Public License Version 2.0. Any mods based on my code must be open-source - no obfuscation!
You can modify/reupload/repack my mods if you like, but please credit any original authors/3D model/3rd-party asset creators, and keep in mind any future updates I make will not be automatically applied to repacked mods so make sure to check back from time to time for bugfixes and improvements.
If you find my mods useful, please consider buying me a coffee - it's not expected but very much appreciated: https://buymeacoffee.com/zenarchist
- General Setup Guide
- Core Mod Setup Guide
- ZenModPack Master Config
- Various Info
- Known Bugs & Issues
- Report Bug
My utility style mods for debugging etc.
Mods which affect game mechanics:
- ZenAlcohol
- ZenAllowMapBagSlot
- ZenAntiCombatLogout
- ZenAutoConvertStash
- ZenAutoStackItems
- ZenAutoWinterDetect
- ZenAutoRun
- ZenBasebuildingConfig
- ZenBatteryPASPersistence
- ZenBetterChatFont
- ZenBrokenGlasses
- ZenBuildingDescription
- ZenCarAttachments
- ZenCarBatteryIcon
- ZenCarCompass
- ZenCarGlovebox
- ZenCarsCutDownTrees
- ZenCanteenTablets
- ZenCatchRain
- ZenCauseOfDeath
- ZenChickenCoops
- ZenCraftingSounds
- ZenCraftRagHands
- ZenComboLocks
- ZenCombineJSON
- ZenDropRuinedClothing
- ZenDynamicZoneLoot
- ZenEarPlugs
- ZenFireFuel
- ZenFireWood
- ZenFireplaceStick
- ZenFishingConfig
- ZenFixCarAttachmentGUI
- ZenGraves
- ZenGroundCleaning
- ZenHideGearInCars
- ZenHints
- ZenHologram
- ZenHologramControls
- ZenImmersiveChatHUD
- ZenImmersiveLogin
- ZenInformWeaponStateBug
- ZenInventoryAnimation
- ZenKnifeGardens
- ZenLeftovers
- ZenLogPiles
- ZenMagObfuscation
- ZenMap
- ZenMicCheck
- ZenNotifications
- ZenOpenCansRock
- ZenPainting
- ZenPimpMyRide
- ZenRadioPlugin
- ZenRebuildableWells
- ZenRepairJSON
- ZenRepairPumps
- ZenRepairWells
- ZenServerGUI
- ZenShove
- ZenSplitUI
- ZenSleep
- ZenStaminaSlope
- ZenTerritories
- ZenWeaponEngrave
- ZenWoodHealth
- ZenZombieDoors
Mods which add gear to the game:
- ZenArtillery
- ZenBackwardsCaps
- ZenBookshelf
- ZenBunnyMasks
- ZenCamoCamp
- ZenCarWorkbench
- ZenChess
- ZenChristmasTreeCraft
- ZenConcussionGrenade
- ZenDoubleArmbands
- ZenFlask
- ZenFlint
- ZenGhillie
- ZenJameson
- ZenLadders
- ZenMusic
- ZenNotes
- ZenRaidAlarm
- ZenRaybans
- ZenRunes
- ZenStaticObjects
- ZenSwissKnife
- ZenTimeBomb
- ZenTireRack
- ZenTreasure
- ZenTreehouse
- ZenVikingAxe
- ZenZippoLighter
Mods which run purely server-side:
- ZenBloodDrips
- ZenCampSites
- ZenDynamicZoneLoot
- ZenLootCyclingDetection
- ZenNightConfig
- ZenPersistentTrees
- ZenShelterCargo
- ZenTreesplosions
- ZenZombieController
- ZenZombieConfig
- ZenJameson
My standalone mods