Visuals Modifier

版本 v0.2.0·更新於 2024-07-09

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

模組介紹 作者原文

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

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。

檔案與校驗

檔案名稱
Visuals_Modifier-0.2.0.zip
檔案大小
329.1 KiB