Feral Heart

Help & Guidance => Game Help => Topic started by: hellbent on February 27, 2015, 09:27:00 am

Title: Oh boy.. {Preset Coding}
Post by: hellbent on February 27, 2015, 09:27:00 am
So, I've recently began to make a preset for a new character of mine.
It's made to be a GIF type of preset {AKA Animated}, where the images flash by. I already have the head of the preset done, but I can't seem to get the coding correct because every time I try to use the preset, the whole body comes out with the bumblebee colors. This is what I have for the coding:
Code: [Select]
material preset_5_headMatR
{
    receive_shadows on
    technique
    {
        pass
        {
            ambient 1.000000 1.000000 1.000000 1.000000
            diffuse 1.000000 1.000000 1.000000 1.000000
            specular 0.010000 0.010000 0.010000 1.000000
            emissive 0.000000 0.000000 0.000000 1.000000
            texture_unit
            {
                anim_texture body1.png body2.png body3.png body4.png body5.png body6.png body7.png 1
                tex_address_mode wrap
                filtering trilinear
                rotate_anim 0.02
            }
        }
    }
}
        pass
        {
            ambient 1.000000 1.000000 1.000000 1.000000
            diffuse 1.000000 1.000000 1.000000 1.000000
            specular 0.010000 0.010000 0.010000 1.000000
            emissive 0.000000 0.000000 0.000000 1.000000
            scene_blend alpha_blend
            texture_unit
            {
                texture Texture.png
                tex_address_mode wrap
                filtering anisotropic
      max_anisotropy 16
            }
        }
    }
}
material preset_5_headMatR
{
    receive_shadows on
    technique
    {
        pass
        {
            ambient 1.000000 1.000000 1.000000 1.000000
            diffuse 1.000000 1.000000 1.000000 1.000000
            specular 0.010000 0.010000 0.010000 1.000000
            emissive 0.000000 0.000000 0.000000 1.000000
            texture_unit
            {
                anim_texture body1.png body2.png body3.png body4.png body5.png body6.png body7.png 1
                tex_address_mode wrap
                filtering trilinear
                rotate_anim 0.02
            }
        }
    }
}
        pass
        {
            ambient 1.000000 1.000000 1.000000 1.000000
            diffuse 1.000000 1.000000 1.000000 1.000000
            specular 0.010000 0.010000 0.010000 1.000000
            emissive 0.000000 0.000000 0.000000 1.000000
            scene_blend alpha_blend
            texture_unit
            {
                texture Texture.png
                tex_address_mode wrap
                filtering anisotropic
      max_anisotropy 16
            }
        }
    }
}

All the files are saved as .png as well.
Title: Re: Oh boy.. {Preset Coding}
Post by: Spottedbears on February 27, 2015, 12:00:50 pm
I don't think you need this part of your code:

  tex_address_mode wrap
                filtering trilinear
                rotate_anim 0.02

it's not in any of my animated presets and it could be the reason FH can't read your texture files.

here's an example of one of my body codes:
Code: [Select]
material preset_12_bodyMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
anim_texture preset_12body.png preset_12body1.png preset_12body2.png preset_12body3.png 0.5
}
}
}
}

note -- you can add things like ambient on top of it (and the cull_hardware/cull_software none are to make sure my preset isn't see-through from the inside because there are transparent parts and you can actually see the other side of the body) and it will work just fine, I'm pretty sure it's just that one section of your code that's messing it up.

if you need any other help with the animated preset, let me know! I've done tons of robo/eyes blinking, etc. kinds of presets c;
Title: Re: Oh boy.. {Preset Coding}
Post by: AmarisMingan on February 27, 2015, 04:31:46 pm
Best to refer to how Spottedbears mentioned the transparency in alpha_rejection greater_equal 128. However, I seem to notice double coding in there. Is it supposed to be headMatR twice? If not, look closely and make one headMatL, this could also be the case it shows up like a bumblebee as you say it. Or change rotate_anim to scroll_anim. Try whatever you like, many other tricks should work!
Title: Re: Oh boy.. {Preset Coding}
Post by: hellbent on February 27, 2015, 07:21:32 pm
Okay, so I started with a completely fresh coding layer. I pasted the coding you gave and changed it all to match the preset, and it still came out as the same old, black and yellow colored preset as if the files didn't exist.

Code: [Select]
material preset_5_bodyMatL
{
technique
{
pass
{
texture_unit
{
texture preset_5body.jpg
}
}
}
}
material preset_5_bodyMatR
{
technique
{
pass
{
texture_unit
{
texture preset_5body.jpg
}
}
}
}
material preset_5_headMatL
{
 technique
 {
  pass
  {
   cull_hardware none
   cull_software none
   alpha_rejection greater_equal 128
   texture_unit
   {
    anim_texture body1.png body2.png body3.png body4.png body5.png body6.png body7.png 0.5
   }
  }
 }
}
material preset_5_headMatR
{
 technique
 {
  pass
  {
   cull_hardware none
   cull_software none
   alpha_rejection greater_equal 128
   texture_unit
   {
    anim_texture body1.png body2.png body3.png body4.png body5.png body6.png body7.png 0.5
   }
  }
 }
}
material preset_5_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_5eye.jpg
}
}
}
}
material preset_5_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_5eye.jpg
}
}
}
}
material preset_5_tailMat
{
technique
{
pass
{
texture_unit
{
texture preset_5tail.jpg
}
}
}
}
material preset_5_maneMat
{
technique
{
pass
{
lighting off
cull_hardware none
cull_software none
scene_blend alpha_blend
depth_write off
texture_unit
{
texture preset_5mane.png
}
}
}
}
Title: Re: Oh boy.. {Preset Coding}
Post by: Spottedbears on February 27, 2015, 08:57:19 pm
hm, this could be a simple mistake of file names.

are you sure all your file names match the names mentioned in the code, as well as their extension?
Title: Re: Oh boy.. {Preset Coding}
Post by: hellbent on February 27, 2015, 09:09:06 pm
Positive. I double checked, all the files are saved as .png, do you think it could be an issue with the preset 5 folder itself?
Title: Re: Oh boy.. {Preset Coding}
Post by: Thierry on February 28, 2015, 10:17:09 pm
I checked the coding and is all correct, no problems with preset_5 before.

This may sound silly but actually worked for a friend.
On the login screen, untick the checkbox for remember your username, then close your game and open it again, then type your usename as you usually do taking care of your caps, and go to export your preset again.

For the moment i don't have any other ideas of what it could be.
Title: Re: Oh boy.. {Preset Coding}
Post by: hellbent on March 01, 2015, 10:49:06 pm
I tested this out, still didn't work.
Is it possible to send the files to someone and have them code it/test it out?
It won't show up in the Preset maker, actually. xD
Title: Re: Oh boy.. {Preset Coding}
Post by: Thierry on March 02, 2015, 08:37:32 pm
I could test them if you want.
Title: Re: Oh boy.. {Preset Coding}
Post by: hellbent on March 07, 2015, 03:19:12 am
That's fine. I can send over the files in a moment.
Title: Re: Oh boy.. {Preset Coding}
Post by: Thierry on March 09, 2015, 06:53:30 am
For some reason, Forum is not allowing me to send a PM right now.
I don't know why the animation code you did its failing, looks correct.
Mediafire is offline right now so I will tell you how i got it working

I renamed the files to:
body_0.png
body_1.png
body_2.png
body_3.png
body_4.png
body_5.png
body_6.png

And used the old style of texture animation like this:
Code: [Select]
material preset_5_headMatL
{
 technique
 {
  pass
  {
   cull_hardware none
   cull_software none
   alpha_rejection greater_equal 128
   texture_unit
   {
    anim_texture body.png 7 0.5
   }
  }
 }
}
material preset_5_headMatR
{
 technique
 {
  pass
  {
   cull_hardware none
   cull_software none
   alpha_rejection greater_equal 128
   texture_unit
   {
    anim_texture body.png 7 0.5
   }
  }
 }
}

Worked nice and i could see the little triangle under the eye changing colors.

I hope you can get it working too