Feral Heart
Help & Guidance => Game Help => Topic started by: Bayo.Nettan on October 06, 2013, 07:02:46 pm
-
Hey, Im making a preset, and im confused on how the the fade invisible and coming back scrip works. Can anyone show me how?
-
Ruby has a topic for Glowing, Metallic, Transparent, Animated, & more for Material Coding - click me (http://www.feral-heart.com/index.php?option=com_jfusion&Itemid=2&jfile=index.php&topic=26062.0). I hope that's what you mean.
-
Nope. Already looked at that. None of them have fading script.
-
Stumped by this then. I don't know if there is a tutorial about that yet, but I'll keep looking till a smarter person comes along.
-
haha, thanks for the help. ^.^
-
There are a couple of ways to do this.
Usually, I enable semi-transparency, and then make several different images of 1 image, with less opacity every time, usually in increments of 5 or 10. For example, if I want the body to fade in and out of transparency, I'll make 11 images;
preset_#body100.png
preset_#body90.png
preset_#body80.png
and so on, with the numbers representing the opacity I've set that specific image to.
Then in the code, I would make the textures animated, meaning switching between all eleven, at a rate in which I can set.
Example;
material preset_#_bodyMatL
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
anim_texture preset_#body100.png preset_#body90.png preset_#body80.png preset_#body70.png preset_#body60.png preset_#body50.png preset_#body40.png preset_#body30.png preset_#body20.png preset_#body10.png preset_#body0.png 0.5
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
anim_texture preset_#body100.png preset_#body90.png preset_#body80.png preset_#body70.png preset_#body60.png preset_#body50.png preset_#body40.png preset_#body30.png preset_#body20.png preset_#body10.png preset_#body0.png 0.5
}
}
}
}
This code goes through all of my images on the preset's body, making it appear to fade, at a rate of 0.5 seconds per image.
Of course, you can edit this and change it to your needs, maybe only a certain layer of your preset needs this, or whatnot.
But this is just a little something to help you use it.
If you were looking for a different way of doing it, let me know? c:
-
There are a couple of ways to do this.
Usually, I enable semi-transparency, and then make several different images of 1 image, with less opacity every time, usually in increments of 5 or 10. For example, if I want the body to fade in and out of transparency, I'll make 11 images;
preset_#body100.png
preset_#body90.png
preset_#body80.png
and so on, with the numbers representing the opacity I've set that specific image to.
Then in the code, I would make the textures animated, meaning switching between all eleven, at a rate in which I can set.
Example;
material preset_#_bodyMatL
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
anim_texture preset_#body100.png preset_#body90.png preset_#body80.png preset_#body70.png preset_#body60.png preset_#body50.png preset_#body40.png preset_#body30.png preset_#body20.png preset_#body10.png preset_#body0.png 0.5
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
anim_texture preset_#body100.png preset_#body90.png preset_#body80.png preset_#body70.png preset_#body60.png preset_#body50.png preset_#body40.png preset_#body30.png preset_#body20.png preset_#body10.png preset_#body0.png 0.5
}
}
}
}
This code goes through all of my images on the preset's body, making it appear to fade, at a rate of 0.5 seconds per image.
Of course, you can edit this and change it to your needs, maybe only a certain layer of your preset needs this, or whatnot.
But this is just a little something to help you use it.
If you were looking for a different way of doing it, let me know? c:
Sorry - i'm interested in making one as well, so I hope you don't mind me asking: Where would I put the code for the material file?
-
I'm not certain I understand your question entirely, so forgive me if I repeat what you already know:
This code would replace the two body sections in whatever preset's .material you would want to use.
You can copy/paste it into there, then press Ctrl & H in notepad to bring up the Replace menu. Type in _# and have it replace it with an underscore _ and then whatever number that preset is. (Ex. _2)
Or, you can use this same format, and your own image names. Most of this code is simplified to only what is essential to the desired effect, but the image names can be changed.
-
But ruby, on my preset, I want a picture of a sun to fade away then come back, but on the base body. How do I do that, because on your code, it has nowhere to place a base.
-
As I said, that code was just a basic idea of how the effect works, and it will take some editing to get it to work properly.
If you want a base image, just layer that in above the rest of it.
material preset_#_bodyMatL
{
technique
{
pass
{
texture_unit
{
texture baselayeryay.png
}
}
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
anim_texture preset_#body100.png preset_#body90.png preset_#body80.png preset_#body70.png preset_#body60.png preset_#body50.png preset_#body40.png preset_#body30.png preset_#body20.png preset_#body10.png preset_#body0.png 0.5
}
}
}
}
-
Oh, sorry, I wasn't being detailed: I meant what notepad would you place the code in?
-
Thanks ruby! I preset now has a fading sun!
-
No problem, glad it works for you. c:
Oreo, I'm still not sure I'm understanding you, I'm just this slow, but you just open your preset's material in notepad and paste the code in there, replacing the old bodyMat sections. owo
-
No worries, I think i understand now. Thanks for all your help, Ruby ^^ I just pasted the code in the material notepad and found out take my present is now transparent. Thanks again ;3
-
Ah, yes, good to hear then. Please, feel free to let me know if it's not working for ya. c: