Space Engineers

Space Engineers

331 ratings
Color Replacer Blocks
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Block, Script
File Size
Posted
265.028 KB
May 30, 2018 @ 11:29am
1 Change Note ( view )

Subscribe to download
Color Replacer Blocks

Description
Meridius_IX has retired from modding. Click Here[gist.github.com] for more details.

Description

This mod adds a pair of blocks (Small and Large Grid Variants) that allow you to recolor multiple blocks of the same color at once.


How It Works - Basic Functionality

- Place both blocks (Color Targeter and Color Replacer) onto your desired grid.
- Paint the 'Color Targeter' block with the color you want to have replaced.
- Paint the 'Color Replacer' block with the new color you want to replace the old one with.
- In the Terminal menu of the 'Color Replacer', press the 'Replace Targeter Colors' button to initiate the color swap.

If you have multiple 'Color Targeter' blocks on your grid, the replacer will read each of them and replace their designated colors. The 'Color Replacer' will skip any 'Color Targeter' block that are turned Off. Use caution.


How It Works - Stored Colors

- The 'Color Replacer' block can store 2 colors in its Custom Data field, which can later be called to replaced.
- In the 'Color Replacer' block terminal menu, pressing the 'Store Color 1' button will save the Replacers current color as Color 1.
- In the 'Color Replacer' block terminal menu, pressing the 'Store Color 2' button will save the Replacers current color as Color 2.
- In the 'Color Replacer' block terminal menu, pressing the 'Replace Stored Colors' will replace all colors matching Color 1 with Color 2.


Toolbar Actions

The buttons in the 'Color Replacer' block terminal menu are also available to be assigned to the toolbar of your cockpit, or other automation blocks such as the Timer Block, Sensor Block, Etc.



Programmable Block Support

You can use the programmable block to control the 'Color Replacer' as well. Here's some example code below:

//Basic Block Commands var colorReplacer = GridTerminalSystem.GetBlockWithName("Color Replacer") as IMyArtificialMassBlock; //The color replacer used artificial mass as its template block. colorReplacer.ApplyAction("ReplaceTargeterColors"); //Replace Targeter Block Colors With This Blocks Color colorReplacer.ApplyAction("ReplaceStoredColors"); //Replace Colors Stored In This Replacer CustomData colorReplacer.ApplyAction("StoreFirstColor"); //Stores Replacers Color As First Color in CustomData colorReplacer.ApplyAction("StoreSecondColor"); //Stores Replacers Color As Second Color in CustomData //Manually Set Stored Colors var colorA = new Vector3(0,0,0); //Set manually or get from another block var colorB = new Vector3(0,0,0); //Set manually or get from another block colorReplacer.CustomData = colorA.ToString() + "\n" + colorB.ToString();


Modular Encounters Collection Links

Click Here For The General FAQ About The Mods I Curate.[gist.github.com]
Click Here For My Rules Regarding Mod Republishing.[gist.github.com]
Click Here For The Modular Encounters Admin and Modders Guide.[gist.github.com]
Click Here To Join The Modular Encounters Collection Discord Server.[discord.gg]
Click Here If You'd Like To Support My Work On Patreon.[www.patreon.com]
104 Comments
The Kingfish May 3, 2022 @ 3:02pm 
WOLOLO
Torsión Testicular Feb 23, 2022 @ 11:16am 
WOLOLOOOOOOOOOO
LORD SARUMAN Nov 19, 2021 @ 10:32am 
WOLOLO
Meridius_IX / Lucas  [author] Aug 25, 2020 @ 11:23am 
[SKG]Simonokles - Check my workshop page, there's a version 2 of this mod that can do that :)
Shiranya Aug 25, 2020 @ 11:20am 
It would be super nice if it would also change the skins of the blocks.:missing:
Cpt Pillowy Giant Apr 4, 2020 @ 10:34am 
Is it a way to do the same with Skins?
Kara Vaki Mar 4, 2020 @ 8:25pm 
nvm i'm a dumbass XD
Kara Vaki Mar 4, 2020 @ 7:00pm 
this only recolors the targeter ;w;
Bazil T Yat Mar 4, 2020 @ 3:13am 
Can you make a version that'll recolour only one type of block? I accidentally recoloured my outer hull the same hue as my interior blocks and didn't notice until all the backups had been over-written.
SalazarWindriver Mar 1, 2020 @ 6:42am 
@bcjbna just follow the directions on this page