View previous topic :: View next topic |
Author |
Message |
Scrama

Joined: 28 Aug 2009 Posts: 20 Location: Siberia, Omsk
|
Posted: Thu Mar 11, 2010 3:25 am Post subject: |
|
|
Just a part of RTNC code
Code: |
/*QUAKED misc_model (0 1 0) (-8 -8 -8) (8 8 8)
Just sprite or model.
*/
void() misc_static_model =
{
if (!self.model)
{
remove (self);
return;
}
precache_model (self.model);
setmodel (self, self.model);
makestatic(self);
}
void() model_think =
{
if (self.frame == self.cnt) self.frame = self.health;
else self.frame = self.frame + 1;
self.nextthink = time + 0.1;
};
/*QUAKED misc_animated_model (0 1 0) (-8 -8 -8) (8 8 8)
Animated sprite or model.
*/
void() misc_animated_model =
{
if (!self.model)
{
remove (self);
return;
}
precache_model (self.model);
setmodel (self, self.model);
self.movetype = MOVETYPE_NOCLIP;
self.solid = SOLID_NOT;
self.health = self.frame;
self.think = model_think;
self.nextthink = time + 0.1;
};
|
I using clip for collision, it can be better fited to model size/shape _________________ http://scrama_levelart.livejournal.com |
|
Back to top |
|
 |
Chip

Joined: 21 Jan 2009 Posts: 314 Location: Romania
|
Posted: Mon Mar 15, 2010 12:13 am Post subject: |
|
|
I finally did it. I added the SOLID declarations to the touch function. Easy as pie. The md3 model is now rock solid, I can stand on it and it blocks movement. Thanks for your help guys. Here is the function I'm using:
Code: | void() object_touch =
{
te_ElectricSparks(self.origin); // test
self.solid = SOLID_BBOX;
sprint(other, "This should be a model!\n");
};
void() misc_object =
{
self.touch = object_touch;
precache_model ("progs/barrel.md3");
setmodel (self, "progs/barrel.md3");
setsize (self, self.mins , self.maxs);
setorigin (self, self.origin);
StartItem ();
}; |
So far, the mod goes according to plan. This model was a big issue and it got me nailed down for a while. I also managed to implement a particle effect whenever I touch the object. That's why that sparks function is there.
Thus, it can be used to power up an electrical fence, and, upon touching, electrical sparks fly everywhere. Together with a hurt function, I might get something pretty solid.
I was also able to assign an explosion upon touching, and that's my first anti-personnel mine ever created.  _________________ My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake |
|
Back to top |
|
 |
ceriux

Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA
|
Posted: Mon Mar 15, 2010 1:36 am Post subject: |
|
|
i suggest taking a look at the light entities with a model, after that make sure its not static and go from there. _________________ QuakeDB - Quake ModDB Group |
|
Back to top |
|
 |
Scrama

Joined: 28 Aug 2009 Posts: 20 Location: Siberia, Omsk
|
|
Back to top |
|
 |
Chip

Joined: 21 Jan 2009 Posts: 314 Location: Romania
|
Posted: Mon Mar 15, 2010 8:35 pm Post subject: |
|
|
Thanks again, guys. The problem has been solved, and it works just fine. I have a movie for you, it's in production as we speak. And it will have a separate thread. It's something BIG!
EDIT: Until the new project has some "meat" on, I give you my md3 misc_model stuff. Working as planned.
http://vimeo.com/10201965 _________________ My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake |
|
Back to top |
|
 |
Swift
Joined: 26 Jan 2010 Posts: 44
|
Posted: Sat Apr 17, 2010 8:42 am Post subject: |
|
|
Why is
self.solid = SOLID_BBOX;
in the touch function and not in the spawn function? |
|
Back to top |
|
 |
Chip

Joined: 21 Jan 2009 Posts: 314 Location: Romania
|
Posted: Sat Apr 17, 2010 9:28 am Post subject: |
|
|
Swift wrote: | Why is
self.solid = SOLID_BBOX;
in the touch function and not in the spawn function? |
Because it works in the touch function, and not in the spawn function. Don't know why. Could by DarkPlaces. Could be the version of Kleshik I'm using. _________________ My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Sat Apr 17, 2010 10:25 am Post subject: |
|
|
self.solid = FOO; should be followed by a setorigin or setmodel, otherwise your entity may still be non-solid as it'll not be in the clipping list.
But don't do setsorigin or setmodel inside a touch function! (unless you know they're using DP or FTE or sommit that has the crash bug fixed). _________________ What's a signature? |
|
Back to top |
|
 |
Chip

Joined: 21 Jan 2009 Posts: 314 Location: Romania
|
Posted: Mon Apr 19, 2010 7:47 pm Post subject: |
|
|
Spike wrote: | self.solid = FOO; should be followed by a setorigin or setmodel, otherwise your entity may still be non-solid as it'll not be in the clipping list.
But don't do setsorigin or setmodel inside a touch function! (unless you know they're using DP or FTE or sommit that has the crash bug fixed). |
Thanks Spike! It's on my TODO list now! _________________ My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake |
|
Back to top |
|
 |
|