Help & Guidance > Presets & Markings Tutorials

Updated 9/16/16 Material Coding for Beginners! Glow, metal, transparent, more!

<< < (2/33) > >>

hugrf2:
Thank you, now i can make randomized and beautiful presets, YOU ARE THANKED!  ;) Floor-O-Meter for you!  XD

hugrf2:
*Looks at preset* when i made the preset it didn't show up in-game and i followed everything and NON of the preset showed up in-game and i just edited the head to be moving or whatever!

Ruby1234:
PM me your material code and I'll look it over. c:

Dafniforfree:
wow awesome all I needed :O

Ruby1234:
EDIT January 31st, 2022: This tutorial is being updated and moved to Google! Please refer to the new version wherever possible, as it has better optimisation & overall clarity.
https://docs.google.com/document/d/1otpZc7OyhgXwbK8KPFEl4ogVCACvSptYVBNI-uuFdac/edit?usp=sharing
Ghost-This will make your presets look semi-transparent, like a ghost!

We start with a preset.



(If you don't have a preset yet, you need one. I use preset 2 for the purpose of this tutorial, but you need your own. So go get one if you dun have one.)

Now, your preset's code probably looks something like this:

--- Code: ---material preset_#_bodyMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
}
}
}
material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
texture_unit
{
texture preset_#tail.jpg
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#mane.png
}
}
}
}
--- End code ---

Well, we are going to make some changes.
First thing you want to do is make a 512x512 square of any color you want. This is going to add the ghost tint to your character, so you can make it lighter or darker depending on how you want it.
This is my ghost layer:



Once you have the color you want,
name it
preset_#ghost.png
And of course change the # to your preset's actual number.

Next, we need to change the coding.
Open your preset's material file in notepad.
Select everything, and delete it.
Copy and paste this into it:

--- Code: ---material preset_#_bodyMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
texture_unit
{
texture preset_#tail.jpg
}
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#mane.png
}
texture_unit
{
texture preset_#ghost.png
}
}
}
}
--- End code ---

Now press Ctrl+H, or go to Edit->Replace...
And type _# in the "Find what:" section.
Then in the "Replace with:" section, put an underscore:
_
and then put your preset's actual number after that. Then click Replace all.

Save and close that.

Open FH and look at your preset. It will have layered the color over it.



Now is the time to change the ghost.png if you don't like how the color turned out.

Once you have it the way you want it, we're doing some code replacing again! (Yay.)

Now there are two ways to do this. The first way makes it really bright, the second way makes it a little dimmer. So skip down to the one that you want, and we'll continue.

First way:



Open your preset's code in notepad and once again, erase it all,
and replace it with this:

--- Code: ---material preset_#_bodyMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
texture_unit
{
texture preset_#tail.jpg
}
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#mane.png
}
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
--- End code ---

Now repeat the replacing process:

--- Quote from: Me ---Now press Ctrl+H, or go to Edit->Replace...
And type _# in the "Find what:" section.
Then in the "Replace with:" section, put an underscore:
_
and then put your preset's actual number after that. Then click Replace all.
--- End quote ---

Save and close and take a look ingame!


Second way:



Open your preset's code in notepad and once again, erase it all,
and replace it with this:

--- Code: ---material preset_#_bodyMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
texture_unit
{
texture preset_#tail.jpg
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#mane.png
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
--- End code ---

Now repeat the replacing process:

--- Quote from: Me ---Now press Ctrl+H, or go to Edit->Replace...
And type _# in the "Find what:" section.
Then in the "Replace with:" section, put an underscore:
_
and then put your preset's actual number after that. Then click Replace all.
--- End quote ---

Save and close and take a look ingame!

One last thing,
if you don't like the teeth and eyes showing through,
we can fix that.
Replace your preset's eye texture with a 512x512 transparent square.

Then open the material file in notepad and look for the eye codes, which look like this:

--- Code: ---material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
ambient 0.2 0.2 0.2 1
scene_blend add
texture_unit
{
texture preset_#ghost.png
}
}
}
}
--- End code ---

We're going to highlight those sections of the code in notepad, and replace it with this code:

--- Code: ---material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#eye.png
}
}
}
}material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#eye.png
}
}
}
}
--- End code ---
Once again, repeat the replacing process:

--- Quote from: Me ---Now press Ctrl+H, or go to Edit->Replace...
And type _# in the "Find what:" section.
Then in the "Replace with:" section, put an underscore:
_
and then put your preset's actual number after that. Then click Replace all.
--- End quote ---

And now you should be all set.
The eyes and teeth will no longer show through. :3



And if you want, you can even draw on some eyes onto the head texture.
Lolz.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version