removing body parts when shot
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
Re: removing body parts when shot
you need to make hte bodie parts as separated entities and then code it to follow the body
Re: removing body parts when shot
Just create alternate models with body parts missing and swap them out when shot.
Re: removing body parts when shot
yeah but how would you change models?
-
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 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?
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: removing body parts when shot
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.thommoboy wrote:yeah but how would you change models?
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC (LordHavoc)
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?
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
Re: removing body parts when shot
yeah i got it working but its
setmodel(self, "progs/Necromorph.mdl");
setmodel(self, "progs/Necromorph.mdl");
Re: removing body parts when shot
i have varying models with various limbs missingleileilol 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 just want to know how to call a certain model when a certain spot is shot
Re: removing body parts when shot
Your going to have to work out that math sadly. Work out the offsets from their origin.
-
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
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
}
Re: removing body parts when shot
how would i do the trace line thingy XD like find its arm?
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?
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.