Jump to content

Brick in the Wall: Seamless brick transition mod. (v1.2.1)


Milo Christiansen

Recommended Posts

Ever wish that bricks were more realistic? This mod is for you!

2018-03-14_00-01-39.thumb.png.71b50e44888e60817179ecd143e8db21.png

Enjoy bricks with seamless transitions and proper gray mortar!

Each time you place a brick block, it checks all adjacent blocks looking for other types of bricks, and overlays a transition texture as needed. For example, in the next picture the two red brick blocks were placed first, then the fire brick block placed between them. As you can see the firebrick gained the proper transitions for red brick!

2018-03-14_00-02-19.thumb.png.ef9590e8858ec320c8821f36ac72725c.png

If one of the red bricks were to be removed and a blue brick placed, the blue brick would gain the red transitions needed to match the ones on the yellow brick. This allows you to add a bit of color to your walls (and makes the mod simpler to program :P).

To install, simply place the zip in your VS "Mods" directory.

Download from the Mod Hub

Edited by Milo Christiansen
Added new version
  • Like 5
Link to comment
Share on other sites

  • 2 years later...

The code for this is pretty simple, it is unlikely that any of the core code is broken in any major way. If it doesn't work getting it working again is probably a matter of renaming a function or two.

The zip file actually includes the source code (the block behavior is shipped as an uncompiled class that the game will then compile on the fly).

Edited by Milo Christiansen
Link to comment
Share on other sites

29 minutes ago, Milo Christiansen said:

The code for this is pretty simple, it is unlikely that any of the core code is broken in any major way. If it doesn't work getting it working again is probably a matter of renaming a function or two.

The zip file actually includes the source code (the block behavior is shipped as an uncompiled class that the game will then compile on the fly).

13.3.2021 16:39:46 [Warning] [brickinthewall] Failed parsing version string '1.2' at index 3: Expected PATCH version, found end of string (best guess: 1.2.0)

13.3.2021 16:39:46 [Error] [brickinthewall] Compiler errors during compilation:

13.3.2021 16:39:46 [Error] [brickinthewall]     src\BrickTransitionBehavior.cs(17): The type or namespace name 'ModBase' could not be found (are you missing a using directive or an assembly reference?) [CS0246]

13.3.2021 16:39:46 [Error] [brickinthewall] An exception was thrown when trying to load assembly:
System.Exception: Could not compile from source files due to errors
   at Vintagestory.Common.ModCompilationContext.CompileFromFiles(ModContainer mod, IEnumerable`1 paths)
   at Vintagestory.Common.ModContainer.LoadAssembly(ModCompilationContext compilationContext, ModAssemblyLoader loader)

13.3.2021 16:39:46 [Warning] One or more source code mods failed to compile. Info to modders: In case you cannot find the problem, be aware that the game engine currently can only compile C# code until version 5.0. Any language features from C#6.0 or above will result in compile errors.

 

Link to comment
Share on other sites

  • Milo Christiansen changed the title to Brick in the Wall: Seamless brick transition mod. (v1.2.1)

I'm making use of the game's block variant system combined with the texture overlay system. Each side is a layer of three textures. The "main" texture, and two overlay transition textures. All of this is standard block definition functionality, leading the code to define all this to be quite short and simple.

However, internally this produces one "block" per variation which leads to (quite) a few thousand blocks. The vast number of consumed internal block IDs is probably why this was never implemented in the base game. (note that I'm assuming Tyron never changed the way blocks are handled internally, it could work a bit differently now)

It could be done without consuming so many block slots, but that would require a block entity per brick block which is less than ideal in some ways. It probably wouldn't actually be a performance issue, but eh...

Making the blocks take on the proper type when placed is trivial, I simply use a block behavior that checks the surroundings when placed and changes the block into the correct variant.

Edited by Milo Christiansen
Link to comment
Share on other sites

  • 1 month later...
21:46:39 [Server Error] [brickinthewall] Compiler errors during compilation:
21:46:39 [Server Error] [brickinthewall]     src\BrickTransitionBehavior.cs(71): 'BrickTransitionBehavior.BrickTransitionBehavior.GetDrops(Vintagestory.API.Common.IWorldAccessor, Vintagestory.API.MathTools.BlockPos, Vintagestory.API.Common.IPlayer, float, ref Vintagestory.API.Common.EnumHandling)': no suitable method found to override [CS0115]
21:46:39 [Server Error] [brickinthewall] An exception was thrown when trying to load assembly:
System.Exception: Could not compile from source files due to errors
   at Vintagestory.Common.ModCompilationContext.CompileFromFiles(ModContainer mod, IEnumerable`1 paths)
   at Vintagestory.Common.ModContainer.LoadAssembly(ModCompilationContext compilationContext, ModAssemblyLoader loader)

 

please update the mod

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.