Integrating Tools - PrismaticFlower/shaderpatch GitHub Wiki

Contents

  1. Intro
  2. Install Tools
  3. Integrate Tools

Intro

Shader Patch comes with a set of tools to support custom material creation. In order to use custom materials in your mod you must integrate these tools into your munge process.

This guide will teach you how to do just that. The process should be incredibly simple, but the guide does assume that you've already installed Shader Patch and that you're familiar with (at least to a basic extent) the structure of the modtools.

Install Tools

First you're going to hit up the latest release page and look for shaderpatch-x64-tools.7z. If you're unfamiliar with .7z archives you can use the open source 7-Zip to open them.

Next you're going to go to your modtools install directory, from there you'll go into ToolsFL\bin\ and paste the files found inside the downloaded archive into it.

The tools are now installed and ready to be called from the munge scripts.

Integrate Tools

Now that we've installed our tools we're practically ready to burst from excitement! But we just have a couple things left to do before we're ready to start going crazy with our custom materials.

You can integrate the tools with any .lvl's build process but I'm only going to cover integrating with sides and worlds. But first we need to decide if we want to integrate on a per-mod basis or for all future mods we make.

Go back to your modtools install directory and now depending on if you want to integrate for all future mods or for an existing mod you'll either go into Data\_BUILD or DataMOD\_BUILD. Now if you've never messed with the munge scripts before then don't panic, pre-edited ones are linked to below that you can copy-n-paste.

Integrating for Worlds

To begin simply open up Worlds\munge_world.bat in your favourite text editor. Then go over here, copy the complete contents of the gist and replace the contents of your munge_world.bat with it.

Integrating for Sides

Almost the same as above, open up Worlds\munge_side.bat. Go over here, copy and replace.

Making Clean Work

Now because Shader Patch's integration introduces a new intermediate directory for it's munge files when you hit Clean this any munged SP textures/materials/etc won't actually be cleaned. This is annoying as manually cleaning is a pain and there are times when you do have to do a completely fresh munge.

With that in mind let's set about automating it. This is more complicated than integrating the mungers themselves because each Side, World, etc has its own clean.bat that controls what directories get cleaned. This means that if we have a world TEST and we want to add automated SP cleaning for it then we need to edit _BUILD\Worlds\TEST\clean.bat, likewise if we want to do the same thing for a side named TEST we'll need to edit _BUILD\SIDE\TEST\clean.bat.

In both cases however the edits are the same and you can find them already done to clean.bat over here.

Manual Integration

TODO: Write manual integration documentation here.

End

Assuming you took one of the above integration steps you're now all setup to start munging custom materials!