removing body parts when shot
Moderator: InsideQC Admins
55 posts
• Page 2 of 4 • 1, 2, 3, 4
Re: removing body parts when shot
can anyone teach me how to do this?
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
Make models with missing limbs, mostly this would be a death sequence.
Call the animation frames when player dies, u can be all actual about it and traceline or just
random which animation to call.
Explosive imagination of youth gets crushed by the conundrum of work...
Call the animation frames when player dies, u can be all actual about it and traceline or just
random which animation to call.
Explosive imagination of youth gets crushed by the conundrum of work...
- r00k
- Posts: 1110
- Joined: Sat Nov 13, 2004 10:39 pm
Re: removing body parts when shot
no i meant as in can someone teach me how to use the traceline?
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
well, the code should be fairly self explanitory, but to me converting it to work with custom models would be hard.
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
Re: removing body parts when shot
the model i am using is just(well im using the base of a demon) but if i sent it to you could you show me how to calculate it or even over slkype
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
ceriux wrote:well, the code should be fairly self explanitory, but to me converting it to work with custom models would be hard.
yeah ive got the code i just don't know how to find the trajectory
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
you could always find out how many uints each peace is by it's self. the quake guy is i think 32x 32y 64z (in 3dsmax) so you could take the base, find out the mesurments it's using then draw boxes around your models body parts then get the sizes of those boxes and plug them into the code?
(might work haven't tried it.)
(might work haven't tried it.)
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
Re: removing body parts when shot
can someone show me how to do it XD
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
I would like to.
But same time i want you to actualy learn something. You have been basicaly allready told what to do here. Just try your self. You will learn through errors.
And to get you start. Look at the firebullets function. There sill be a Trace_Line function. Also go read qc documentation. There will be told how quakes builtins works. Then try by drawing a image of what you try to do (i do thos with complecs things with math functions). You should have bot math knowledge from school so use it (in example getting height of the bulmets impact would be something like bullethit - monster.origin)
(btw not saying you should not ask. But we are more likely going to answer if you have allready tryed to code it and have like "what is wrong in this code? *pastecode*" than "can ylu guys plezzz show me how to do it"
But same time i want you to actualy learn something. You have been basicaly allready told what to do here. Just try your self. You will learn through errors.
And to get you start. Look at the firebullets function. There sill be a Trace_Line function. Also go read qc documentation. There will be told how quakes builtins works. Then try by drawing a image of what you try to do (i do thos with complecs things with math functions). You should have bot math knowledge from school so use it (in example getting height of the bulmets impact would be something like bullethit - monster.origin)
(btw not saying you should not ask. But we are more likely going to answer if you have allready tryed to code it and have like "what is wrong in this code? *pastecode*" than "can ylu guys plezzz show me how to do it"
- Jukki
- Posts: 214
- Joined: Wed Apr 07, 2010 4:59 am
Re: removing body parts when shot
thommoboy, I practically wrote one of them for you. The one I wrote will give you headshots, TrackAttack already sends out a traceline, all you need to do is detect where the traceline hit. "trace_endpos" is, well, the end position of the traceline where ever that may be. trace_ent is the entity that has crossed your traceline.
so lets break it down
So when it all comes together it looks like this:
so lets break it down
- Code: Select all
if (trace_endpos_z... //The spot where your traceline ends, specificly the Z axis hence the _z
- Code: Select all
> (trace_ent.origin_z + 18)) //Is greater than the traced entity's origin PLUS 18. Origin being the very center of the entity, 18 being about where the head is
{ //Note that 18 may NOT be accurate for your model, increase or decrease it accordingly
- Code: Select all
damage = damage * 2; //TraceAttack sets the damage automatically, but we're going to multiply it by 2 for a headshot
trace_ent.headshot = TRUE; //TRUE or FALSE (1 or 0) this is the traced entity's field, this will tell the traced entity they just got hit in the head
// setmodel(trace_ent, "progs/headless.mdl"); // If you want, you can set the traced entity's model right here
}
So when it all comes together it looks like this:
- Code: Select all
if (trace_endpos_z > (trace_ent.origin_z + 18))
{
damage = damage * 2;
trace_ent.headshot = TRUE;
// setmodel(trace_ent, "progs/headless.mdl");
}
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: removing body parts when shot
i tried your code ghost_fang but when i shot the enemy(i tried literally everywhere) nothing changed
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
thats just the first half, you need to tell your monster what to do when you perform a headshot, when his self.headshot = TRUE;
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: removing body parts when shot
He probably just straight up copied and pasted with the setmodel line still commented out. I wouldn't be surprised whatsoever.

-

DukeInstinct - Posts: 20
- Joined: Sat Jul 10, 2010 11:20 pm
- Location: DukeLand
Re: removing body parts when shot
hahahahahaha not funny im learning you can't say you were born with a computer in your hands coding quake c can you?
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: removing body parts when shot
Ghost_Fang wrote:thats just the first half, you need to tell your monster what to do when you perform a headshot, when his self.headshot = TRUE;
ive used the change model command not the self.headshot command
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
55 posts
• Page 2 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 1 guest