Mods / CivBastion

Category: #Utility
Author: Xel
Side: Both
Created: Feb 27th 2022 at 2:14 AM
Last modified: Feb 1st at 5:54 PM
Downloads: 7857
Follow Unfollow 9

Latest file for v1.20.3:
civbastion-1.4.0.zip 1-click install


Bastions for Civ servers.

City bastions protect a 101x101 square by default and prevent block reinforcing.

Vault bastions protect a 21x21 square by default and prevent block reinforcing and placing.

Right click a bastion to see what it protects.

Configuration defaults
  City Vault
protectionRadius - Protection radius in blocks 50 10
adjacencyRadius - Radius within which other bastions are considered "adjacent" 25 5
erosionFactor - Reinforcement amount removed per Protection 0.5 1
adjacentErosionFactor - Reinforcement amount removed per Protection, relative to erosionFactor, on adjacent bastions 0.5 0.5
destroyOnRemove - Whether the bastion is destroyed when its reinforcement is eroded No Yes
regenPerDay - Reinforcement strength gained per day (up to the original strength) 5 5
placementCooldown - Cooldown on reinforcement erosion, in milliseconds 5.5 seconds 5.5 seconds
Default configuration changelog

1.0.4

  • Increased placementCooldown to 5.5s up from 2s

 

 

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.4.0 29 Feb 1st at 5:54 PM Show civbastion-1.4.0.zip Install now
v1.3.0 348 Jan 9th 2024 at 2:50 AM Show civbastion-1.3.0.zip Install now
v1.2.1 874 May 15th 2023 at 12:59 PM Show civbastion-1.2.1.zip Install now
v1.2.0 353 Apr 25th 2023 at 2:01 AM Show civbastion-1.2.0.zip Install now
v1.1.0 418 Oct 18th 2022 at 1:14 AM Show civbastion-1.1.0.zip Install now
v1.0.5 584 Jul 22nd 2022 at 2:19 PM Show civbastion-1.0.5.zip Install now
v1.0.4 753 Jun 7th 2022 at 12:23 PM Show civbastion-1.0.4.zip Install now
v1.0.3 605 Apr 22nd 2022 at 10:56 PM Show civbastion-1.0.3.zip Install now
v1.0.2 351 Apr 12th 2022 at 12:12 PM Show civbastion-1.0.2.zip Install now
v1.0.1 321 Mar 31st 2022 at 1:06 PM Show civbastion-1.0.1.zip Install now
v1.0.0 398 Mar 13th 2022 at 11:29 PM Show civbastion-1.0.0.zip Install now
v1.0.0-rc.2 301 Mar 10th 2022 at 10:46 PM Show civbastion-1.0.0-rc.2.zip Install now
v1.0.0-rc.1 314 Mar 10th 2022 at 2:12 AM Show civbastion-1.0.0-rc.1.zip Install now
v1.0.0-pre.7 314 Mar 8th 2022 at 1:59 AM Show civbastion-1.0.0-pre.7.zip Install now
v1.0.0-pre.6 310 Mar 7th 2022 at 3:26 AM Show civbastion-1.0.0-pre.6.zip Install now
v1.0.0-pre.5 340 Mar 5th 2022 at 7:38 PM Show civbastion-1.0.0-pre.5.zip Install now
v1.0.0-pre.4 312 Mar 3rd 2022 at 1:51 AM Show civbastion-1.0.0-pre.4.zip Install now
v1.0.0-pre.3 308 Mar 2nd 2022 at 1:20 AM Show CivBastion.zip Install now
v1.0.0-pre.2 318 Feb 27th 2022 at 4:01 PM Show civbastion.zip Install now
v1.0.0-pre.1 306 Feb 27th 2022 at 2:33 AM Show civbastion.zip Install now

10 Comments (oldest first | newest first)

💬 Amarillo, Dec 29th 2024 at 12:09 AM

Any plan to update this mod when 1.20 is live?

💬 Halfdan, Dec 17th 2024 at 4:08 AM

Tysm! I understand the pain of the anonmity thing xD

💬 XelAuthor, Dec 17th 2024 at 1:59 AM

Hi, I'd have to move the repo and rewrite all the history to get rid of my name and im too lazy to do that haha

Heres the regen method from the BE though, edited a little to make it self contained:

private void HandleTryRegenerate(float tick)
{
var bre = Api.ModLoader.GetModSystem(); // this gets ModSystemBlockReinforcement but I cant put that in the moddb comment because html parser is bad
var reinforcement = bre.GetReinforcment(Pos); if (reinforcement == null || reinforcement.Strength == 0 || reinforcement.Strength >= originalReinforcementStrength) { return; } var totalDays = (long)Api.World.Calendar.TotalDays; if (totalDays > lastRegeneratedOnDay) { try { var daysToRegenFor = (int)(totalDays - lastRegeneratedOnDay); lastRegeneratedOnDay = totalDays; var lastPlayerName = reinforcement.LastPlayername;
// reinforcements dont store the player if they are reinforced under a group, so try to find the player by name (if possible) // or just use the nearest player if it cant find anyone so the reinforcement method doesnt explode var maybeLastPlayer = !string.IsNullOrEmpty(reinforcement.PlayerUID) ? Api.World.PlayerByUid(reinforcement.PlayerUID) : Api.World.AllPlayers.FirstOrDefault(player => player.PlayerName == lastPlayerName) ?? Api.World.NearestPlayer(Pos.X, Pos.Y, Pos.Z); var ownerGroupUid = reinforcement.GroupUid ?? 0; var newStrength = Math.Min(originalReinforcementStrength, reinforcement.Strength + (daysToRegenFor * Config.RegenPerDay)); bre.ClearReinforcement(Pos); bre.StrengthenBlock(Pos, maybeLastPlayer, newStrength, ownerGroupUid); } catch (Exception e) { // whole thing might explode if the group gets deleted somehow Api.Logger.Error($"Could not regen bastion reinforcement at {Pos}: {e}"); } } }



originalReinforcementStrength and lastRegeneratedOnDay are stored in the tree attributes and the method ticks once every 4 minutes on the server side while the block is loaded

💬 Halfdan, Dec 16th 2024 at 11:00 PM

Any chance of this being open sourced at all? I would really like to use the regen effect of block reinforcement as an update to Bulwark!

💬 Ronnie21093, Feb 22nd 2024 at 2:53 AM

So is there a command to change the protection range of the bastion? And is there a way to see how far it protects?

💬 XelAuthor, Jun 22nd 2023 at 12:43 PM

Deyv Double-headed drifters have a chance to drop a stack of 2 temporal gears 😀

💬 Deyv, Jun 20th 2023 at 5:26 AM

It would appear Bastion Gears require a stack of 2 temporal gears to create the recipe.  Temporal gears do not normally stack.  How is this achieved in game?

💬 Amarillo, May 16th 2023 at 7:50 AM

Thanks for the quick fix! 💪

 

💬 XelAuthor, May 16th 2023 at 1:40 AM

Fixed in 1.2.1, thank you

💬 Amarillo, May 15th 2023 at 8:50 AM

Hi! first of all thanks for this very powerful mod. I want to report a bug that I discovered it's generated by this mod. When adding this mod to my server the bombs can wipe reinforced blocks no matter if the block has a low or high reinforcement. Is this a bug or an intended feature? There is any way to configure that?

Thanks in advance!

(edit comment delete)