Forum

fade out screen, sprites, models, .lmps

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

fade out screen, sprites, models, .lmps

Postby behind_you » Wed Feb 16, 2011 3:11 pm

ive been wondering about this for a while now. how can this be done?
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby ceriux » Wed Feb 16, 2011 5:14 pm

a sprite you would just need multiple frames, one that started solid, then as time goes it changes frames of it fading, till there's nothing visible then remove the sprite .
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Mexicouger » Wed Feb 16, 2011 11:40 pm

Or implement Scale, alpha, and glow for models in a tutorial, and just make the entity think about fading itself out of the game(eventually removeing itself)
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby behind_you » Sat Feb 19, 2011 7:16 am

i tried your idea ceriux, but when the sprite fades out, the pink transparent color mixes in the background mixes with the image color. the engine no longer recognises the color as pink and it doesn't look transparent anymore.

can you explain a little more mexicouger.


thanks to everyone!
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby ceriux » Sat Feb 19, 2011 7:46 am

if your's is a sprite, it's because the pink you're using is off, or the palette your using is one of the two.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby behind_you » Sat Feb 19, 2011 7:53 am

um nooooo. when my sprite is not fading, the pink shows as transparent. when it fades, the pink behind the picture of the fading model (i use photoshop) isn't recognised as pink and it appears.
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby ceriux » Sat Feb 19, 2011 7:59 am

i used the same method, seemed to work fine for me.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Sajt » Sat Feb 19, 2011 5:07 pm

1. What engine are you using?
2. Are you saving alpha channel properly?

The best solution by the way isn't to create new sprite frames, it's to use the .alpha QuakeC field, which works on both sprites and models, but doesn't exist in the vanilla Quake engines, only in modified engines like DarkPlaces.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby behind_you » Sun Feb 27, 2011 1:24 pm

can u give me an example or alpha being used?
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Nahuel » Sun Feb 27, 2011 2:37 pm

behind_you wrote:can u give me an example or alpha being used?


first you need to write in defs.qc
.float alpha;

and for example yo can put the value in

void() BecomeExplosion =
{
self.movetype = MOVETYPE_NONE;
self.velocity = '0 0 0';
self.touch = SUB_Null;
setmodel (self, "progs/s_explod.spr");
self.solid = SOLID_NOT;

self.alpha = 0.4;// 0 is invisible, 1 is totally visible
s_explode1 ();
};
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby behind_you » Sun Feb 27, 2011 2:44 pm

wow, nd that's all? Thanks!

Does that fade out in timing or make it transparent only?
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Nahuel » Sun Feb 27, 2011 3:05 pm

behind_you wrote:wow, nd that's all? Thanks!

Does that fade out in timing or make it transparent only?

alpha channel !!!!!!!!!!!!
hahahahahaha :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops:
sorry
I don´t read anything,
You can use the gimp 2 for that, and use external textures for the sprite.
Gimp 2 is the best program you just have to remove the layer and then it gives you the transparency.
transparency can put on your sprite.
Image

Then you must rename the image. (I use tga)
For example I use the bubble.
the original name s_bubble.spr
so that's Darkplaces'll recognize the name
s_bubble.spr_0.tga
Where 0 is the frame number.
let the new image where is the original sprite (in this case the folder progs)
and we have so
Image
Last edited by Nahuel on Sun Feb 27, 2011 3:16 pm, edited 1 time in total.
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby Nahuel » Sun Feb 27, 2011 3:13 pm

behind_you wrote:wow, nd that's all? Thanks!

Does that fade out in timing or make it transparent only?

sorry
i didn´t understand the question, my english is very very bad :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops:
I need learn.
Image
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby behind_you » Sun Feb 27, 2011 3:24 pm

ok nahuel. I mean making a model start not faded and then it slowly fades out until it becomes invisible. How can i do that?
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Nahuel » Sun Feb 27, 2011 3:49 pm

behind_you wrote:ok nahuel. I mean making a model start not faded and then it slowly fades out until it becomes invisible. How can i do that?

oh very well, I made something similar but with a sprite
let's suppose that you want to do that, (for example)the demon whenever it jumps becomes more and more transparent.

void() demon1_jump1 =[ $leap1, demon1_jump2 ] {ai_face();
self.alpha = 1;
};
void() demon1_jump2 =[ $leap2, demon1_jump3 ] {ai_face();
self.alpha = 0.95;

};
void() demon1_jump3 =[ $leap3, demon1_jump4 ] {ai_face();
self.alpha = 0.9;

};
void() demon1_jump4 =[ $leap4, demon1_jump5 ]
{
ai_face();

self.touch = Demon_JumpTouch;
makevectors (self.angles);
self.origin_z = self.origin_z + 1;
self.velocity = v_forward * 600 + '0 0 250';
if (self.flags & FL_ONGROUND)
self.flags = self.flags - FL_ONGROUND;
self.alpha = 0.8;

};
void() demon1_jump5 =[ $leap5, demon1_jump6 ] {
self.alpha = 0.7;

};
void() demon1_jump6 =[ $leap6, demon1_jump7 ] {
self.alpha = 0.6;

};
void() demon1_jump7 =[ $leap7, demon1_jump8 ] {
self.alpha = 0.5;

};
void() demon1_jump8 =[ $leap8, demon1_jump9 ] {
self.alpha = 0.4;

};
void() demon1_jump9 =[ $leap9, demon1_jump10 ] {
self.alpha = 0.3;

};
void() demon1_jump10 =[ $leap10, demon1_jump1 ] {
self.nextthink = time + 3;
// if three seconds pass, assume demon is stuck and jump again
self.alpha = 0.2;

};

void() demon1_jump11 =[ $leap11, demon1_jump12 ] {
self.alpha = 0.1;

};
void() demon1_jump12 =[ $leap12, demon1_run1 ] {
self.alpha = 0.05;

};


if you specified already alpha in the defs.qc you can do that one.
Notice that in every frame alpha approaches more 0.
But remember to put alpha =1 in every others of the actions because the demon goes away to do transparently in every action that it comes after the jump.
Greetings
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest