Lethal Company
You are viewing a potentially older version of this package. View Latest Version
Install

Details

Date Uploaded
2 weeks ago
Downloads
142K
Size
36KB
Dependency string
Sniper1_1-MaterialAssetRestorerCore-1.1.0

MaterialAssetRestorerCore

Moon and interior devs are likely familiar with how poorly the certain assets rip when trying to design their levels. I made this tool to attempt to restore some at runtime. It can access materials both from within the vanilla prefabs and scenes. (My thread in the LC Modding Discord)

This mod works by searching through a moon after it is loaded to replace the broken ones from modded moons/interiors with the corresponding one from vanilla. API specs and example useage below.

NOTE: IN ORDER TO ACCESS VANILLA MATERIALS FROM SCENES, THEY ARE BRIEFLY LOADED DURING StartOfRound. FROM MY TESTING THIS DID NOT CAUSE MAJOR PERMANENT ISSUES, BUT A FEW ERRORS LIKE [Error : Unity Log] Cascade Shadow atlasing has failed, only one directional light can cast shadows at a time AND OTHER WARNINGS MAY BRIEFLY LOG. AGAIN, I DO NOT BELIEVE THIS CAUSES ANY MAJOR ISSUES LONG TERM.

API Docs For Devs

Create a json file (or multiple) with the format and in the direcotry shown below. Each json contains a list of MaterialSets. A MaterialSet is made up of a BaseMaterial, which is the name of the material in the vanilla game, and a ReplaceMaterial, which is the name of the material in your mod. Often these will likely be the same name, but they don't have to be. You must also specify either a PrefabName or a SceneName so that this tool knows where to look to find the BaseMaterial.

{
    "MaterialSets": [
        {
            "BaseMaterial" : "gamematerial",
            "ReplaceMaterial" : "yourmaterial",
            "PrefabName" : "gameprefab"
        },
        {
            "BaseMaterial" : "gamematerial",
            "ReplaceMaterial" : "yourmaterial",
            "SceneName" : "gamescene"
        }
    ]
}

Project Heirarchy (NOTE: YOU MUST PLACE THE JSON FILE IN THE plugins/MaterialReplacements/ FOLDER FOR THIS TO WORK):

YourMod/
├── plugins/
│   └── MaterialReplacements/
|       └── YourJSON.json
├── README.md
├── manifest.json
├── icon.png
├── CHANGELOG.md (optional)
└── LICENSE.md (optional)

Example Usecase

WaterAssetRestorer

Before

Without

After

with

Credits

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.