1
Game Help / Need some coding help
« on: July 26, 2012, 06:54:03 pm »
Ok so i have a plan for map that needs blocks that are visible for few seconds, then disappear for few seconds, appear for few seconds etc, but i can't figure out what code to use to make it happen.
I have tried using these codes
material palikkaMat
{
technique
{
pass
{
lighting off
scene_blend colour_blend
depth_write off
cull_hardware none
cull_software none
texture_unit
{
texture p2.png
tex_address_mode wrap
filtering trilinear
}
texture_unit
{
texture p1.png
scroll_anim 0.01 0.02
tex_address_mode wrap
rotate_anim -0.01
wave_xform scale_x sine 3 0.1 0 3
wave_xform scale_y sine 3 0.1 0 3
colour_op alpha_blend
}
texture_unit
{
texture p2.png
colour_op_ex blend_current_alpha src_texture src_current
}
}
}
}
and
material palikkaMat
{
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 p1.png p1.png 4.0
tex_address_mode wrap
filtering trilinear
rotate_anim 0.00
}
}
}
}
As you can see, i have 2 textures p1 and p2(p2 is transparent)
With first code the box just stood there being slightly transparent, with second one it did chance texture but the one that was transparent(and png) showed up as black.
I have tried using these codes
material palikkaMat
{
technique
{
pass
{
lighting off
scene_blend colour_blend
depth_write off
cull_hardware none
cull_software none
texture_unit
{
texture p2.png
tex_address_mode wrap
filtering trilinear
}
texture_unit
{
texture p1.png
scroll_anim 0.01 0.02
tex_address_mode wrap
rotate_anim -0.01
wave_xform scale_x sine 3 0.1 0 3
wave_xform scale_y sine 3 0.1 0 3
colour_op alpha_blend
}
texture_unit
{
texture p2.png
colour_op_ex blend_current_alpha src_texture src_current
}
}
}
}
and
material palikkaMat
{
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 p1.png p1.png 4.0
tex_address_mode wrap
filtering trilinear
rotate_anim 0.00
}
}
}
}
As you can see, i have 2 textures p1 and p2(p2 is transparent)
With first code the box just stood there being slightly transparent, with second one it did chance texture but the one that was transparent(and png) showed up as black.