Feral Heart

Help & Guidance => Game Help => Topic started by: ScribbleKibble on October 04, 2016, 03:14:26 am

Title: Partly invisible presets in FH
Post by: ScribbleKibble on October 04, 2016, 03:14:26 am
I just started preset making and I've been wondering, how would you make a preset partially invisible? I want to make a preset with a stump leg. I've seen it done before but I can't find any tutorials on it. Anyone know the magical secret of invisible presets? XD
Title: Re: Partly invisible presets in FH
Post by: Vwang on October 04, 2016, 03:17:08 am
Here's a pile of codes for it.
http://www.feral-heart.com/smf/index.php?topic=26062.0
Title: Re: Partly invisible presets in FH
Post by: D-ead7Dog on October 04, 2016, 03:20:55 am
Now that you've been given the code here is a tutorial to finish it off!
https://www.youtube.com/watch?v=F1KzhPtCg5M

-OR-
written up.
Transparent
-Oh, the wonders of making body parts disappear!

Start with your preset/object.
(http://i1195.photobucket.com/albums/aa400/xRuby1234x/FH%20and%20IT%20Album/preset_2.png)
(This is preset 2 for the purpose of this tutorial, but I repeat, IT'S NOT MINE. Kay? Kay. c:)

Now, all you do is open your preset in Photoshop or GIMP, like you would any other time.
But this time, we need to make sure you have an alpha channel of transparency enabled. To do this, simply go to Layers >> Transparency >> Add Alpha Channel, like so for GIMP;
(https://i.gyazo.com/80ab760473cade75a6a857e29cc276c8.png) (https://i.gyazo.com/80ab760473cade75a6a857e29cc276c8.png)
Fullsize Image (https://i.gyazo.com/80ab760473cade75a6a857e29cc276c8.png)
If the option is not available, it usually means you already have it enabled, so you should be all good!
Now just erase the part(s) you want to be gone. I'm going to erase the midsection.
(https://i.gyazo.com/25e88e2b7ea33c54b0b24f2fb4d45fbf.png) (https://i.gyazo.com/25e88e2b7ea33c54b0b24f2fb4d45fbf.png)
Now, and this is important, save your image, AS A .PNG. Why, you might ask? First of all, I always use .png just because .jpg doesn't always look as well on presets, but second, .jpg DOES NOT support transparency. And look at that, we just used transparency! So guess what, we need a .png. c:
Once you've saved as a .png, open your material code, which should look something like this as default;
Code: [Select]
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
}
}
}
}
Now, you need to change whatever part is using transparency to .png instead of .jpg, but for me, all my stuff is in .png anyway, so I'm going to go ahead and switch it all.
Code: [Select]
material preset_#_bodyMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#head.png
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#head.png
}
}
}
}
material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.png
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.png
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
texture_unit
{
texture preset_#tail.png
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#mane.png
}
}
}
}
Now, before we save and test, we should make sure that we have the actual transparency code in there, which is this simple line;
alpha_rejection greater_equal 128
which gets placed above all the texture_unit lines. Or at least all the ones you're using transparency on.
So, you can do that manually if you're only doing a few body parts, but if you're doing them all, then take it from me;
Code: [Select]
material preset_#_bodyMatL
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#head.png
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#head.png
}
}
}
}
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
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#tail.png
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#mane.png
}
}
}
}
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.
^ Only if you're using the code I just gave you, because I use # signs in it where your actual preset's number should be.
So since I'm using preset 2, this is what I'd be doing;
(https://i.gyazo.com/b83b889ce2b9d5fad8d960ba89d9f091.png) (https://i.gyazo.com/b83b889ce2b9d5fad8d960ba89d9f091.png)
But you'd be using whatever number preset you're doing.

Now, make sure you SAVE your material file, then go ahead and close it. Once we take a look ingame, you should have something like this! - Eep!
(https://i.gyazo.com/d23a1b6d4e2624c84ae5c88c85edfbcb.png) (https://i.gyazo.com/d23a1b6d4e2624c84ae5c88c85edfbcb.png)
Have fun with it!

-OR- [simple version]
When you get to the part you want "invisible" make sure you put all the layers into one bundle is it's just one layer.
Right click and click "Alpha Channel".
Erase the part you want gone.
Save and Export it.
Go into the material file and replace what you have with this
Quote
material preset_#_bodyMatL
{
   technique
   {
      pass
      {
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_#body.png
         }
      }
   }
}
material preset_#_bodyMatR
{
   technique
   {
      pass
      {
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_#body.png
         }
      }
   }
}
material preset_#_headMatL
{
   technique
   {
      pass
      {
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_#head.png
         }
      }
   }
}
material preset_#_headMatR
{
   technique
   {
      pass
      {
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_#head.png
         }
      }
   }
}
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
         }
      }
   }
}
material preset_#_tailMat
{
   technique
   {
      pass
      {
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_#tail.png
         }
      }
   }
}
material preset_#_maneMat
{
   technique
   {
      pass
      {
         cull_hardware none
         cull_software none
         alpha_rejection greater_equal 128
         texture_unit
         {
            texture preset_#mane.png
         }
      }
   }
}
[/quote][/spoiler]
[DO NOT FORGET TO GO INTO THE MATERIAL FILE AND CHANGE THE CODE TO TRANSPARENT OTHERWISE IT WON'T WORK AND YOU WILL HAVE A WHITE AREA WHERE IT SHOULD BE INVISIBLE.]
Title: Re: Partly invisible presets in FH
Post by: Kerriki on October 04, 2016, 03:33:10 am
Moving this to the game help board ^^
Title: Re: Partly invisible presets in FH
Post by: ScribbleKibble on October 05, 2016, 12:36:21 am
Thanks for the help!