Space Engineers

Space Engineers

Not enough ratings
Block vAriant Randomizer Toolkit (Bart) [Beta]
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Script
File Size
Posted
304.923 KB
30 Mar, 2023 @ 8:32pm
1 Change Note ( view )

Subscribe to download
Block vAriant Randomizer Toolkit (Bart) [Beta]

Description
Block vAriant Randomizer Toolkit

What?

The randomizer toolkit allows modders to specify a collection of randomized variants of a block that can be seamlessly substituted in when a player places their block.

Why?

Automatic greebles. The idea being to break up walls of uniform blocks,
And the personal element: I got sick of constantly rotating Sci-fi Interior Walls to make it look more interesting.

How?

The modder creates a file called bart.xml in the /data/ folder of their mod. Inside this file gets specified the block that players are expected to place down, and which blocks (and their probabilities) will be substituted in when said block is placed.
The modder then adds this mod as a dependency when publishing.

A fully functional example mod can be found here:

An example xml can be found here:
<?xml version="1.0" encoding="utf-16"?> <BlockRandomizeGroups xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Version>0</Version> <!-- the version line. Currently not used, but if I ever make breaking changes it will go up.--> <BlockGroups> <BlockGroup> <!-- InitialBlockId is for the block that you want the player to place. The Type is the Type string of the block itself (CubeBlock). --> <!-- This block will not be seen during gameplay, it only exists to give you a block to place down.. --> <InitialBlockId Type="CubeBlock" Subtype="YourSubtypeHere" /> <Blocks> <!-- Each block that gets substitued is contained within a Block tag. As with the inital block you use the Type from the block definition. This can not be the same block as the initial block. --> <Block> <Id Type="CubeBlock" Subtype="YourSubtype2Here" /> <!-- <Weight>1</Weight> --> <!-- Weighting is optional, defaults to 1 if not present --> </Block> <Block> <Id Type="CubeBlock" Subtype="YourSubtype3Here" /> <!-- <Weight>1</Weight> --> </Block> </Blocks> </BlockGroup> </BlockGroups> <!-- OtherBartFiles specifies other files in your mod which contain randomizer groups. The syntax is the same as this file, except the linking to other files is disabled. I haven't checked yet, but you might need at least one blockgroup in each file. --> <OtherBartFiles>data\otherBart.xml</OtherBartFiles> </BlockRandomizeGroups>

Commands:

/bart enable/disable
Enables/Disables the block replacement. Intended to be used when creating blueprints/prefabs. This will persist through a save/load.
On enable it will find all the applicable blocks placed and swap them out for variants, this is not reversible, so be careful if you are in a blueprint save.

(More commands will likely come later)

Going forward:

  • Bug fixes.
  • The ability for modders to be able to adjust the lists for their blocks on the fly, through a public API.
  • The ability for modders to get the list of blocks involved and their relationships to each other, again through a public API.
  • The ability to enable/disable collections or blocks within collections based on the presence of other mods, for example having a collection with both WC/non-WC weapons, and having only those which will actually work be enabled.

Known bugs:

  • There is a slight delay in multplayer when a variant is swapped out. Not sure this is even fixable :(
  • While placing a block with dimensions greater than 1x1x1 is fine, pasting (via blueprint/other) a grid with a block with dimensions greater than 1x1x1 on to another grid ends up with it oriented/rotated incorrectly. Spawning in or pasting a grid with said block not on to another grid works fine.
  • Cannot link to other bart files more than one deep.
1 Comments
Bluestar33 27 Sep, 2024 @ 8:23am 
Wah it looks very cool!