Inside3D!
     

Quake Sprites
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
lukas2288



Joined: 14 Jun 2009
Posts: 42

PostPosted: Sat Jun 20, 2009 9:15 pm    Post subject: Quake Sprites Reply with quote

Hi guys
i want to make plasma sprites.For example i will show this picture
http://img141.imageshack.us/img141/5823/missile.jpg
How can i make it in firerocket to use for example this jpg file?I tried fimg but it wrote me that save function does not work.Is there some way to create more frames for example on missile explode?

PS:Sorry for my english.
Back to top
View user's profile Send private message
lukas2288



Joined: 14 Jun 2009
Posts: 42

PostPosted: Mon Jun 22, 2009 6:58 pm    Post subject: Re: Quake Sprites Reply with quote

lukas2288 wrote:
Hi guys
i want to make plasma sprites.For example i will show this picture
http://img141.imageshack.us/img141/5823/missile.jpg
How can i make it in firerocket to use for example this jpg file?I tried fimg but it wrote me that save function does not work.Is there some way to create more frames for example on missile explode?

PS:Sorry for my english.


Or how can imake visible only the picture without the black square in game.
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Mon Jun 22, 2009 9:59 pm    Post subject: Reply with quote

You need to use the alpha channel of the TGA to represent transparency.
_________________
Apathy Now!
Back to top
View user's profile Send private message
lukas2288



Joined: 14 Jun 2009
Posts: 42

PostPosted: Tue Jun 23, 2009 4:03 pm    Post subject: Reply with quote

MauveBib wrote:
You need to use the alpha channel of the TGA to represent transparency.


PLease can you send me some freeware program which will do this?I think that Photoshop can do that but it is shareware.
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Tue Jun 23, 2009 4:23 pm    Post subject: Reply with quote

I think http://www.gimp.org/ is probably the best freeware image manipulation software., but I'm not sure since I use a commercial package.
_________________
Apathy Now!
Back to top
View user's profile Send private message
lukas2288



Joined: 14 Jun 2009
Posts: 42

PostPosted: Sun Jul 05, 2009 7:49 am    Post subject: Reply with quote

Last question about sprites.I madeing plasma weapons and spr files containes 4 frames.But when i fired it plays only frame 1.How can i increase it into 4 frames?
Back to top
View user's profile Send private message
Error
Inside3D Staff


Joined: 05 Nov 2004
Posts: 558
Location: VA, USA

PostPosted: Sun Jul 05, 2009 10:04 am    Post subject: Reply with quote

you have to manually loop it.

go through each frame. it won't play on it's own.
_________________
Inside3D : Knowledge Is Power
Darkplaces Documentation Wiki
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
lukas2288



Joined: 14 Jun 2009
Posts: 42

PostPosted: Sun Jul 05, 2009 5:01 pm    Post subject: Reply with quote

Error wrote:
you have to manually loop it.

go through each frame. it won't play on it's own.


Do you mean on qc or in fimg?
Back to top
View user's profile Send private message
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Sun Jul 05, 2009 7:54 pm    Post subject: Reply with quote

lukas2288 wrote:
Error wrote:
you have to manually loop it.

go through each frame. it won't play on it's own.


Do you mean on qc or in fimg?


He means in qc.
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Mon Jul 06, 2009 7:07 am    Post subject: Reply with quote

there is client-side looping on sprites (framegroups) just like in models. Not sure what sprite tools support it though.
Back to top
View user's profile Send private message
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Mon Jul 06, 2009 7:07 am    Post subject: Reply with quote

....or engines.
Back to top
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Mon Jul 06, 2009 9:35 am    Post subject: Reply with quote

metlslime wrote:
....or engines.


I know Qtest supported that feature
_________________
Back to top
View user's profile Send private message
lukas2288



Joined: 14 Jun 2009
Posts: 42

PostPosted: Mon Jul 06, 2009 6:18 pm    Post subject: Reply with quote

i know that here is some example code in weapons qc:
void() s_explode1 = [0, s_explode2] {};
void() s_explode2 = [1, s_explode3] {};
void() s_explode3 = [2, s_explode4] {};
void() s_explode4 = [3, s_explode5] {};
void() s_explode5 = [4, s_explode6] {};
void() s_explode6 = [5, SUB_Remove] {};

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;
s_explode1 ();
};


so here is the new effect spr:

void() n_effect1 = [0, n_effect] {};
void() n_effect2 = [1, n_effect] {};
void() n_effect3 = [2, n_effect] {};
void() n_effect4 = [3, n_effect1] {};

void() NewEffect =
{
self.movetype = MOVETYPE_NONE;
self.velocity = '0 0 0';
self.touch = SUB_Null;
setmodel (self, "progs/neweffect.spr");
self.solid = SOLID_NOT;
n_effect1 ();
};


But how can i put it for example in FireRocket function to replace missile.mdl with animated NewEffect?
Back to top
View user's profile Send private message
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Mon Jul 06, 2009 6:59 pm    Post subject: Reply with quote

lukas2288 wrote:
But how can i put it for example in FireRocket function to replace missile.mdl with animated NewEffect?


If this is an impact explosion, then just look in T_MissileTouch and replace the BecomeExplosion(); with NewEffect();. (note that you have a bug in your animation code that will cause the animation to never dissappear and continue to animate.)

If this is for a projectile animation, then what you need to do is add something like this:

Code:

void() PlasmaThink =
{
  self.frame = self.frame + 1; // Advance frame by one every think.

  if(self.frame > 3)  // start from beginning of animation if it's time
   self.frame = 0;

  if(self.attack_finished <= time) // Remove if lifetime is exceeded
   remove(self);

  self.think = PlasmaThink;
  self.nextthink = time + 0.01; // this is the anim framerate speed
};


Then, in FireRocket or whatever change this:

Code:

missile.nextthink = time + 5;
missile.think = SUB_Remove;

setmodel(missile, "progs/missile.mdl");


To this:

Code:

missile.frame = 0; // set what frame it starts at
missile.nextthink = time + 0.01; // set nextthink time
missile.think = PlasmaThink; // set what it's supposed to think about
missile.attack_finished = time + 5; // dissappear in 5 secs if no impact

setmodel(missile, "progs/neweffect.spr"); // set model to new plasma sprite

_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Mon Jul 06, 2009 9:37 pm    Post subject: Reply with quote

leileilol wrote:
metlslime wrote:
....or engines.


I know Qtest supported that feature


Well, glquake broke a bunch of stuff with sprites (e.g. orientations) and models (i.e. only correctly supports 2- or 4- frame skingroups) so it could have broken sprite framegroups too. And since glquake is the daddy of a bunch of engines out there, if glquake broke it, it's likely broken in a bunch of engines.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group