Visuals Modifier

v0.2.0·Updated 2024-07-09

Allows the modification of materials at runtime based on configuration files.

About this mod Author’s original text

Visuals Modifier

Allows the modification of materials at runtime based on configuration files. This mod can be used with or without WackysDatabase.

Features

  • Modify material properties values at runtime.
  • File watcher support for realtime material updates based on file changes, these will effect existing prefabs already in the world.
  • Realtime effects based on proximity, time, and biome.
  • Includes support for WackysDatabase
  • ServerSync

Initial Workflow

  • Run _describe in the console to export a description of an items materials. The file will be exported to./BepInEx/config/Visuals/Describe_.yml. See an example output below.
  • Make note of the material properties as these are the values you can modify.
  • Create a new file:./BepInEx/config/Visuals/Visual_.yml
  • Inside the file start by setting the prefab name:
  • From here there are a few different things you can do, the customizations can be as lite as you need them to be.

Customizations

  • Update all materials with a single configuration.
  • Updating specific materials with a more precise configuration targeting each individual material.
  • Update an underlying texture of a material
  • Add a material change based on a realtime effect
  • Update a light on an item

Results

VSCode - Intellisense

There is now a defined JSON schema that can be used with the VSCode YAML extension in order to provide more information while configurating items.

Example

Installation

  • Install the 'YAML' extension
  • Open the 'Visuals' folder in VSCode
  • Go to 'Settings' in r2modman
  • Select Profile Folder
  • Select Bepinex/config/Visuals
  • Copy the folder path
  • Open workspace settings
  • + Shift + P
  • Type
  • Select Workspace Settings
  • Type
  • Select in settings.json under: Schemas
  • Make sure the file looks like this:

{

"yaml.schemas": {

" "/*",

}

}

Getting Started

Schema - Base

prefabName: string

material: # Targets all materials in the renderer

colors:: [Red (decimal), Green (decimal), Blue (decimal), Alpha (decimal)]

floats:: (decimal)

materials:

  • colors: # Targets the first material in the renderer: [Red (decimal), Green (decimal), Blue (decimal), Alpha (decimal)]

floats:: (decimal)

  • colors: # Targets the second material in the renderer: [Red (decimal), Green (decimal), Blue (decimal), Alpha (decimal)]

floats:: (decimal)

shader: # Modifies the shader used and material instances on the item

material: string (override the materials on the item to this material)

materials: array (override specific materials on the item using the materials in this array)

name: string (name of the shader)

icon: # Modify the rotation of the icon for an item

x: rotation X degrees (decimal)

y: rotation Y degrees (decimal)

z: rotation Z degrees (decimal)

light: # Modifies light renderers

color: [Red (decimal), Green (decimal), Blue (decimal), Alpha (decimal)]

range: float

Do not include changes for both 'material' & 'materials', use one or the other. This goes for the shader section as well.

Schema - Time Effect

Adding this block to the configuration file for an item will add a time based effect to the item. Where 'time' is the peak of the effect and the 'timeSpan' is the time span on either side of time where the effect starts to work.

effect:

type: Time

trigger:

time: [Hour (number), Minute (number), Second (number)]

timeSpan: [Hour (number), Minute (number), Second (number)]

material:

colors:: [Red (decimal), Green (decimal), Blue (decimal), Alpha (decimal)]

floats:: (decimal)

Time Effect - Example

prefabName: CharredFenringHelm

material:

colors:

_Color: [1, 1, 1, 1]

effect:

type: Time

trigger:

time: [0]

timeSpan: [4]

material:

colors:

_Color: [2, 1, 1, 1]

floats:

_Saturation: 0.85

Schema - Biome Effect

Adding this block to the configuration file for an item will add a biome based effect to the item. The effect will trigger when the user enters the bio

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.

File & checksum

Filename
Visuals_Modifier-0.2.0.zip
File size
329.1 KiB