Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, ozgur), 1,421 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Creating transparencies for a targa . . . #237206
11/18/08 22:10
11/18/08 22:10
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline OP
Member
heinekenbottle  Offline OP
Member

Joined: Oct 2008
Posts: 218
Nashua NH
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:
Code:
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.


I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: Creating transparencies for a targa . . . [Re: heinekenbottle] #237295
11/19/08 14:49
11/19/08 14:49
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline OP
Member
heinekenbottle  Offline OP
Member

Joined: Oct 2008
Posts: 218
Nashua NH
I'm an idiot.

I had a comma in set(my,PASSABLE | TRANSLUCENT) where I should have had that verticle line symbol blush

Last edited by heinekenbottle; 11/19/08 14:51.

I was once Anonymous_Alcoholic.

Code Breakpoint;

Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1