misc_model
Moderator: InsideQC Admins
24 posts
• Page 2 of 2 • 1, 2
Just a part of RTNC code
I using clip for collision, it can be better fited to model size/shape
- Code: Select all
/*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
-

Scrama - Posts: 20
- Joined: Fri Aug 28, 2009 6:16 am
- Location: Siberia, Omsk
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:
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.
- Code: Select all
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.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
-

Chip - Posts: 575
- Joined: Wed Jan 21, 2009 9:12 am
- Location: Dublin, Ireland
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
EDIT: Until the new project has some "meat" on, I give you my md3 misc_model stuff. Working as planned.
http://vimeo.com/10201965
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
-

Chip - Posts: 575
- Joined: Wed Jan 21, 2009 9:12 am
- Location: Dublin, Ireland
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.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
-

Chip - Posts: 575
- Joined: Wed Jan 21, 2009 9:12 am
- Location: Dublin, Ireland
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).
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).
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
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!
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
-

Chip - Posts: 575
- Joined: Wed Jan 21, 2009 9:12 am
- Location: Dublin, Ireland
24 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest
