Animated static mesh
Posted: Tue Jul 05, 2011 1:47 pm
it is possible to import an animated static mesh inside darkplaces ?

Spike wrote:'func_model' entity
Code: Select all
void() func_model =
{
precache_model (self.model);
setmodel (self, self.model);
};Code: Select all
/*QUAKED func_model (0 1 0) (-8 -8 -8) (8 8 8)
Animated sprite or model.
*/
void() model_think =
{
self.nextthink = time + 0.1;
self.frame = self.frame + 1;
if (self.frame >= 10)
self.frame = 0;
};
void() func_model =
{
self.solid = SOLID_BSP;
self.think = model_think;
self.nextthink = time + 0.1;
precache_model (self.model);
setmodel (self, self.model);
};
Code: Select all
/*QUAKED misc_static_model (0 1 0) (-8 -8 -8) (8 8 8)
Animated sprite or model.
*/
void() misc_static_model =
{
if (!self.model)
{
remove (self);
return;
}
precache_model (self.model);
setmodel (self, self.model);
self.movetype = MOVETYPE_NOCLIP;
self.solid = SOLID_BSP;
};
/*QUAKED misc_animated_model (0 1 0) (-8 -8 -8) (8 8 8)
model.
*/
void() model_think =
{
self.nextthink = time + 0.1;
self.frame = self.frame + 1;
if (self.frame >= 10)
self.frame = 0;
};
void() misc_animated_model =
{
self.solid = SOLID_BSP;
self.think = model_think;
self.nextthink = time + 0.1;
precache_model (self.model);
setmodel (self, self.model);
};

Code: Select all
$frame 1 2 3 4 5 6 7 8 9 10 11 12 13 14
void() plug_stand1 =[ $1, plug_stand2 ]{};
void() plug_stand2 =[ $2, plug_stand3 ]{};
void() plug_stand3 =[ $3, plug_stand4 ]{};
void() plug_stand4 =[ $4, plug_stand5 ]{};
void() plug_stand5 =[ $5, plug_stand6 ]{};
void() plug_stand6 =[ $6, plug_stand7 ]{};
void() plug_stand7 =[ $7, plug_stand8 ]{};
void() plug_stand8 =[ $8, plug_stand9 ]{};
void() plug_stand9 =[ $9, plug_stand10 ]{};
void() plug_stand10 =[ $10, plug_stand11 ]{};
void() plug_stand11 =[ $11, plug_stand12 ]{};
void() plug_stand12 =[ $12, plug_stand13 ]{};
void() plug_stand13 =[ $13, plug_stand14 ]{};
void() plug_stand14 =[ $14, plug_stand1 ]{};
void() info_plug =
{
precache_model ("progs/plug.mdl");
self.solid = SOLID_BBOX;
self.movetype = MOVETYPE_NONE;
setmodel (self, "progs/plug.mdl");
setsize (self, '16 16 16', '24 24 24');
self.think = plug_stand1;
self.nextthink = time + 0.1;
};
Madfox wrote:I would like to make it a makestatic() entity, but where should I count this in?
For now I used a simple "model.mdl" methode.
That gives an impression like this:Code: Select all
$frame 1 2 3 4 5 6 7 8 9 10 11 12 13 14 void() plug_stand1 =[ $1, plug_stand2 ]{}; void() plug_stand2 =[ $2, plug_stand3 ]{}; void() plug_stand3 =[ $3, plug_stand4 ]{}; void() plug_stand4 =[ $4, plug_stand5 ]{}; void() plug_stand5 =[ $5, plug_stand6 ]{}; void() plug_stand6 =[ $6, plug_stand7 ]{}; void() plug_stand7 =[ $7, plug_stand8 ]{}; void() plug_stand8 =[ $8, plug_stand9 ]{}; void() plug_stand9 =[ $9, plug_stand10 ]{}; void() plug_stand10 =[ $10, plug_stand11 ]{}; void() plug_stand11 =[ $11, plug_stand12 ]{}; void() plug_stand12 =[ $12, plug_stand13 ]{}; void() plug_stand13 =[ $13, plug_stand14 ]{}; void() plug_stand14 =[ $14, plug_stand1 ]{}; void() info_plug = { precache_model ("progs/plug.mdl"); self.solid = SOLID_BBOX; self.movetype = MOVETYPE_NONE; setmodel (self, "progs/plug.mdl"); setsize (self, '16 16 16', '24 24 24'); self.think = plug_stand1; self.nextthink = time + 0.1; };
http://members.home.nl/gimli/plug.wmv
but I have no idea what it uses on edict count and packet size.
Just glad I got it working although it is a bit large for a 480x480 skin size,
what is all I can get out of QMLE. It's still the only editor I can work with.
Plus, not all engines that interpolate framegroups does it based on the time interval of the frames, and always interpolates everything at 0.1 seconds instead.Spike wrote:you can't change the .frame if its a static entity. you'd need to make a framegroup to get such an ent to animate (and not all engines that support interpolation interpolate between framegroup frames).