removing body parts when shot
Moderator: InsideQC Admins
55 posts
• Page 1 of 4 • 1, 2, 3, 4
removing body parts when shot
this could quite possibly be the hardest thing i have wanted to do and i know nzp and l4q have done it but how is it done? for psp i might add so no darkplaces addons
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
you need to make hte bodie parts as separated entities and then code it to follow the body
- Jukki
- Posts: 214
- Joined: Wed Apr 07, 2010 4:59 am
Re: removing body parts when shot
Just create alternate models with body parts missing and swap them out when shot.
-

gnounc - Posts: 424
- Joined: Mon Apr 06, 2009 6:26 am
Re: removing body parts when shot
yeah but how would you change models?
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
when you want to change the model, just call setmodel(entity, "progs/model.mdl");
And L4Q has no dismemberment or model switching, if you get a headshot it plays a separate dying animation, one in which the head is shrunk to near nothing and tucked inside the shoulders/neck. Aren't we sneaky?
And L4Q has no dismemberment or model switching, if you get a headshot it plays a separate dying animation, one in which the head is shrunk to near nothing and tucked inside the shoulders/neck. Aren't we sneaky?
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: removing body parts when shot
thommoboy wrote:yeah but how would you change models?
In vanilla QuakeC there's a trick to swap the player model by the eyes: both models are precached and their indexes are stored in variables. Look for modelindex_eyes in the source and you'll see how it's done and you can do the same.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
Re: removing body parts when shot
yeah but how do i change it to the arm when the player shoots the arm or the leg when he shoots the leg?
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
The old "Severed" QC patch does it by making new frames for player.mdl that just is a pain frame sequence with a limb missing. It'll quickly use up all the 256 frames though, unless you had a frame limit raised in the protocol you can do more dismemberment variancy.
i should not be here
- leileilol
- Posts: 2783
- Joined: Fri Oct 15, 2004 3:23 am
Re: removing body parts when shot
yeah i got it working but its
setmodel(self, "progs/Necromorph.mdl");
setmodel(self, "progs/Necromorph.mdl");
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
leileilol wrote:The old "Severed" QC patch does it by making new frames for player.mdl that just is a pain frame sequence with a limb missing. It'll quickly use up all the 256 frames though, unless you had a frame limit raised in the protocol you can do more dismemberment variancy.
i have varying models with various limbs missing
i just want to know how to call a certain model when a certain spot is shot
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
Your going to have to work out that math sadly. Work out the offsets from their origin.
-

Arkage - Posts: 66
- Joined: Thu Nov 19, 2009 4:17 pm
Re: removing body parts when shot
when you fire your weapon, it calls Firebullets(); in firebullets it calls upon TraceAttack, traceattack is where you want to look.
You will see if (trace_ent.takedamage), you're going to want to do your math in there. For example, and to get you started, say you want a headshot, you'll do a check to see where the traceline hit the trace_ent.
It looks something like this:
If you are using my headshot method with a boolean, you will need to find your enemy's dying function(s) and find where it calls the dying animation, and make it check self.headshot (or self.left_arm_gone or whatever) and do animations according to each of them. I would also advise putting self.headshot = 0; in the pain frames to make sure if the headshot doesnt kill him he wont loss his head if you kill him by shooting him in the feet.
You will see if (trace_ent.takedamage), you're going to want to do your math in there. For example, and to get you started, say you want a headshot, you'll do a check to see where the traceline hit the trace_ent.
It looks something like this:
- Code: Select all
if (trace_endpos_z > (trace_ent.origin_z + 18)) //the 18 can be changed to find that sweet spot where you want your headshots to be
{
damage = damage * 2; //Headshots hurt way more, from what I heard, never experienced one myself though
trace_ent.headshot = TRUE; //I personally use a boolean and then the entity checks this and chooses death animations accordingly
// setmodel(trace_ent, "progs/headless.mdl"); // and/or you can set your hit target's model here such as a headless model if necessary
}
If you are using my headshot method with a boolean, you will need to find your enemy's dying function(s) and find where it calls the dying animation, and make it check self.headshot (or self.left_arm_gone or whatever) and do animations according to each of them. I would also advise putting self.headshot = 0; in the pain frames to make sure if the headshot doesnt kill him he wont loss his head if you kill him by shooting him in the feet.
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: removing body parts when shot
how would i do the trace line thingy XD like find its arm?
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
if i give you the mdl can you code according to it just so i can know what to do for others?
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
it would be cool to see a mod which helps you find cordinants sorta like the one for the vwep mod.
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
55 posts
• Page 1 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 1 guest