Spawn Models?
Moderator: InsideQC Admins
9 posts
• Page 1 of 1
Spawn Models?
Hi
Where can I find a code to spawn models???
I want to spawn a head to kick it
Where can I find a code to spawn models???
I want to spawn a head to kick it
- Stealth Kill
- Posts: 83
- Joined: Fri Dec 29, 2006 12:34 pm
blah.movetype = MOVETYPE_BOUNCE;
blah.solid = SOLID_TRIGGER;
blah.touch = HeadKick;
community effort keep it going guys! eventually he will have all the code he needs! mwhaha
blah.solid = SOLID_TRIGGER;
blah.touch = HeadKick;
community effort keep it going guys! eventually he will have all the code he needs! mwhaha
Benjamin Darling
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
- Electro
- Posts: 312
- Joined: Wed Dec 29, 2004 11:25 pm
- Location: Brisbane, Australia
I haven't touched QC in a long time, but here goes!
- Code: Select all
float() crandom; // i think this was defined in weapons.qc, so probably need a prototype...
void() HeadKick =
{
local vector dir;
local vector xyvel;
if (other.classname != "player")
return;
if (!(self.flags & FL_ONGROUND))
return;
xyvel = other.velocity;
xyvel_z = 0;
if (vlen(xyvel) < 30) // don't kick if moving slowly
return;
dir = normalize(xyvel);
self.velocity = dir * 500 + '0 0 300';
self.avelocity_x = crandom() * 200.0;
self.avelocity_y = crandom() * 200.0;
self.avelocity_z = crandom() * 200.0;
self.flags = self.flags - (self.flags & FL_ONGROUND);
sound(self, CHAN_BODY, "headkick.wav", 1, ATTN_NORM);
};
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
Heheh, yeah, that ought to pretty much do it, if you get all the weird parts and are able to fix them, such as the origin it spawns at. If you want to simply make the gibbed monster/player heads kickable, go into each characters gib function, and find the head, and give that gib a .touch function the way Electro showed, and add the function Sajt made, and you've got yourself some kickable head gibs!
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
how can the Zeusbot kick gibs?
i tried this
if(other.classname != "player" || other.classname == "bot" || other.classname == "monster")
i tried this
if(other.classname != "player" || other.classname == "bot" || other.classname == "monster")
- Stealth Kill
- Posts: 83
- Joined: Fri Dec 29, 2006 12:34 pm
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest