Mods / CivBastion

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

Latest release (for Vintage Story 1.20.3, potentially outdated):
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

 

 

Mod Version For Game version Downloads Release date Changelog Download 1-click mod install*
1.4.0 220 Feb 1st at 5:54 PM civbastion-1.4.0.zip 1-click install
  • Recompile for 1.20
  • Fix the protected area highlight being off by 1 block to the south and east
1.3.0 372 Jan 9th 2024 at 2:50 AM civbastion-1.3.0.zip 1-click install
  • Update to 1.19
  • Right clicking a bastion with an empty hand will highlight its protected area
1.2.1
1.18.0 - 1.18.1 1.18.2 - 1.18.3
917 May 15th 2023 at 12:59 PM civbastion-1.2.1.zip 1-click install
  • Fix ore bombs being able to explode reinforced blocks
1.2.0 387 Apr 25th 2023 at 2:01 AM civbastion-1.2.0.zip 1-click install

- Update to 1.18

1.1.0 450 Oct 18th 2022 at 1:14 AM civbastion-1.1.0.zip 1-click install
  • Prevent water from flowing into an active Bastion field
1.0.5 616 Jul 22nd 2022 at 2:19 PM civbastion-1.0.5.zip 1-click install
  • Fixed sheep not being milkable
1.0.4 787 Jun 7th 2022 at 12:23 PM civbastion-1.0.4.zip 1-click install

Updated default placementCooldown to 5.5s up from 2s, since the block itself takes 5s to break with a pick. Existing users will need to update the mod config file if they want the new value

1.0.3 638 Apr 22nd 2022 at 10:56 PM civbastion-1.0.3.zip 1-click install

- Removed the test condition from CanPlayerAccess that I forgot to remove, so now they actually work again

1.0.2 389 Apr 12th 2022 at 12:12 PM civbastion-1.0.2.zip 1-click install

more asset file cleanup

1.0.1 357 Mar 31st 2022 at 1:06 PM civbastion-1.0.1.zip 1-click install

clean up the shapes asset files and use texturesByType instead of shapeByType

1.0.0
1.16.3 - 1.16.4-rc.1
430 Mar 13th 2022 at 11:29 PM civbastion-1.0.0.zip 1-click install
  • prevent ore bombs from detonating if they would damage blocks within any bastion field
  • apply bucket interaction patch to PrimitiveSurvival metal buckets, if available
1.0.0-rc.2
1.16.3 - 1.16.4-rc.1
328 Mar 10th 2022 at 10:46 PM civbastion-1.0.0-rc.2.zip 1-click install
  • block prevention also works with water
  • add a /bastion command to show nearby bastions the player has access to
1.0.0-rc.1
1.16.3 - 1.16.4-rc.1
343 Mar 10th 2022 at 2:12 AM civbastion-1.0.0-rc.1.zip 1-click install
  • rotate the bastion and bastionbase gui models to a more interesting angle
  • verify that the recipes actually work
1.0.0-pre.7
1.16.3 - 1.16.4-rc.1
347 Mar 8th 2022 at 1:59 AM civbastion-1.0.0-pre.7.zip 1-click install

more expensive citybastion recipe

1.0.0-pre.6
1.16.3 - 1.16.4-rc.1
346 Mar 7th 2022 at 3:26 AM civbastion-1.0.0-pre.6.zip 1-click install

updated recipe

1.0.0-pre.5
1.16.3 - 1.16.4-rc.1
372 Mar 5th 2022 at 7:38 PM civbastion-1.0.0-pre.5.zip 1-click install

city+vault bastions

new, more interesting model

recipes

1.0.0-pre.4
1.16.3 - 1.16.4-rc.1
343 Mar 3rd 2022 at 1:51 AM civbastion-1.0.0-pre.4.zip 1-click install
  • fix to make cooldown timers per player
  • nicer thirdperson block appearance
1.0.0-pre.3
1.16.3 - 1.16.4-rc.1
336 Mar 2nd 2022 at 1:20 AM CivBastion.zip 1-click install

Behaves closer to how civclassic bastions worked

1.0.0-pre.2
1.16.3 - 1.16.4-rc.1
351 Feb 27th 2022 at 4:01 PM civbastion.zip 1-click install
  • add server config
1.0.0-pre.1
1.16.3 - 1.16.4-rc.1
340 Feb 27th 2022 at 2:33 AM Empty civbastion.zip 1-click install

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

💬 Xel , 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?

💬 Xel , 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! 💪

 

💬 Xel , 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)