Does this have to be done in Photoshop?
I have a sprite that a tank lays down as it travels, making a track and I want this sprite to be transparent. It has an alpha channel and thus the black areas aren't visible, but the sprite does not appear to be transparent. And I don't think it is a matter of the sprites being stacked on top of each other during creation either, I set the creation frequency to once per second while the tank is moving, so they're very seperated from each other (for testing purposes).
Here is the script:
action track()
{
set(my,PASSABLE,TRANSLUCENT);
my.alpha = 10;
my.tilt = 90;
my.roll = 90;
my.scale_x *= 0.5;
while(my.alpha > 0)
{
my.alpha -= 0.1 * time_step;
wait(1);
}
ent_remove(me);
}
action pTank()
{
VECTOR smkSpot;
//... sets some properties and starts functions that are not related to the problem
while(my.health > 0) //while the tank is alive
{
//...movement code
//below is the part that sets the tracks in place:
var dist_covered = c_move(my,speed,vector(0,0,my.g),IGNORE_FLAG2 | IGNORE_PASSABLE | GLIDE); //move, ignoring FLAG2, PASSABLE. glide when hitting blocks
if(dist_covered > 0)
{
if(counter <= 0)
{
you = ent_create("tracks.tga",my.x,track);
you.pan = my.pan + 90;
counter = 1.5;
}
else
{
counter -= 0.0625 * time_step;
}
}
else
{
counter = 0;
}
//. . . the rest of the while loop (camera, smoke)
}
snd_stop(engSnd);
ent_playsound(my,crash,1000);
}
I know the alpha is being calculated because the sprite disappears after a few seconds. But graphically, it still looks opaque.
Other than the transparency not showing up, the effect looks great, when I set the counter to 0.5 or lower.