Raised This Month: $ Target: $400
 0% 

How to get HEAD hitbox origin?


Post New Thread Reply   
 
Thread Tools Display Modes
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 07-14-2015 , 12:03   Re: How to get HEAD hitbox origin?
Reply With Quote #11

Do a test, maybe with server_print, to see what hit boxes are hit when you shoot them.
Code:
public fwd_HamTakeDamage( iMonster, iInflictor, iAttacker, Float:fDamage, m_Damagebits )     server_print( "%i", get_pdata_int(iMonster, m_iLastHitGroup, XoPlayer) )
Place this in takedamage_post, then post the integer value that prints out when you shoot them in different places. Also, you might want to check the pdata offset database we have to make sure this is the correct pdata for monsters.

Last edited by vitorrossi; 07-14-2015 at 13:44.
vitorrossi is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 07-14-2015 , 12:31   Re: How to get HEAD hitbox origin?
Reply With Quote #12

again, in the right, you still have the drowned model with altered mesh..
use a cs 1.6 default model, or model with the default cs 1.6 animations/skeleton
models with custom skeleton and animations usualy dont have good hitboxes...

belive me, been there, done that.. i think i tried/tested all the zombie models out there...

Last edited by Depresie; 07-14-2015 at 12:32.
Depresie is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 07-14-2015 , 13:26   Re: How to get HEAD hitbox origin?
Reply With Quote #13

Okay, so.

Is there any way to get origin of head hitbox?

Maybe getting the origin of ent ( it will return the middle ) ; calculate the "fake head" origin
( mins/max ) and check if the origin of shot is between this "fake head" origin ?

But now.. the center bone is elsewhere... ;c

and.. can someone tells, why this fix is doing special ? Because i never feel that bug <lol?>
https://forums.alliedmods.net/showthread.php?t=229557

Last edited by grs4; 07-14-2015 at 13:49.
grs4 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-14-2015 , 16:44   Re: How to get HEAD hitbox origin?
Reply With Quote #14

Take a look at my aimbot detection plugin, it detects which body part was hit.
__________________
Bugsy is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 07-14-2015 , 17:10   Re: How to get HEAD hitbox origin?
Reply With Quote #15

so.. i created this one:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <td>

#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "MarWit"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
RegisterHam(Ham_TraceAttack"info_target""TraceAttack");
}

public 
TraceAttack(iEntidattackerFloat:damageFloat:direction[3], tracehandledamagebits)
{
    new 
hitbox get_tr2(tracehandleTR_iHitgroup);

    if(!
td_is_monster(iEnt))
        return 
HAM_IGNORED;
    
    if(
hitbox == HIT_HEAD){
        
SetHamParamFloat(3damage*3.0);
        return 
HAM_HANDLED;
    }
    
    return 
HAM_IGNORED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by Bugsy; 07-14-2015 at 18:03.
grs4 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-14-2015 , 17:27   Re: How to get HEAD hitbox origin?
Reply With Quote #16

I believe the problem is that your entity is an info_target entity, which is linked to CPointEntity class. That class doesn't contain m_iLastHitGroup member. Within the class hierarchy, CBaseMonster is the first one to contain m_iLastHitGroup, and CBasePlayer is the one inheriting that member from the monster class, but I don't know what would happen if you created another "player" entity.
HERE you can find a list of classes that inherit from CBaseMonster. All of them should detect the right hitgroup when being hit.
klippy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 07-14-2015 , 19:00   Re: How to get HEAD hitbox origin?
Reply With Quote #17

ahm, im no expert, but in this case, wouldn't ham trace attack work? and then use the result in ham take damage?

later edit:

nvm, only now i see the post above,
btw i dont think you can set damage from trace attack, you have to link trace attack take damage with a global variable from what i remember, i did it before, but i dont remember exactly how

Also, did you try to change that custom model with a cs 1.6 default model? ... just for testing

Last edited by Depresie; 07-14-2015 at 19:08.
Depresie is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 07-14-2015 , 20:30   Re: How to get HEAD hitbox origin?
Reply With Quote #18

Quote:
Originally Posted by grs4 View Post
This screenshot is old.

For every model which i am using has head hitbox

http://i.imgur.com/Hw2kNyG.png

So getting the mind from your posts i think that this is not the pointer of "model has head hitbox" ?

i just shot the every model on head. and on all, damage was not be doubler.

sorry for english.
Off-topic: Can you share me your model ? (the left one)

Last edited by Kz1.0; 07-14-2015 at 20:31.
Kz1.0 is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 07-15-2015 , 04:59   Re: How to get HEAD hitbox origin?
Reply With Quote #19

So... first thanks bugsy for editing my post ( i mean [sma] code : P ) ( I am a firefighter, and... unhappy moment )

I have not time to write that this code which i just uploaded work correctly.

look at this:
Code:
 if(hitbox == HIT_HEAD){


if I change to != then all shot has damage x3.

So if it works correctly, then when i shot in head, i should have 3x damage.

I spend 5 minutes of shooting (and finding the head) and ... i found it. So.. we have to
exacly shot in one place ( HEAD hitbox of body ) on head, that in real is not head.. I think that
this is the head on normal cs model, but included on this model.. lol ?

I checked for a test on not "info_target" but "player" in trace attack. and it works correctly. head = head, etc..

now.. can't we resize this hitbox of head without editing any model ? I mean chaning mins and max (whatever it is) .

this is code responsible for creating this entity. look at size

Code:
//dllfunc(DLLFunc_Spawn, iEnt)
        entity_set_model(iEnt, szModel);    
        entity_set_float(iEnt, EV_FL_health, float(health));
        entity_set_float(iEnt, EV_FL_takedamage, DAMAGE_YES);
        entity_set_size(iEnt, Float:{-16.0, -16.0, -30.0}, Float:{16.0, 16.0, 56.0}); // org -20(-20..)            
        entity_set_vector(iEnt, EV_VEC_origin, gfStartOrigin);
        
        entity_set_vector(iEnt, EV_VEC_angles, Float:{0.0, 0.0, 0.0});
        entity_set_int(iEnt, EV_INT_solid, SOLID_BBOX);
        entity_set_int(iEnt, EV_INT_movetype, MOVETYPE_FLY)
I had never change this, because I just copied this from.. i dont know now.

@Kz1.0 This model: http://www.mediafire.com/download/62...twnfi/boss.mdl


Sorry for my hurting english, you should understand me ; p


Some screenshot:

HEAD


NOT HEAD




ZOMBIE HEAD (100% head on model)


If you want, you can join to this server and check it.

Last edited by grs4; 07-15-2015 at 05:11.
grs4 is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 07-15-2015 , 10:38   Re: How to get HEAD hitbox origin?
Reply With Quote #20

yes, you are right, that is the head of the default cs model

you have two options now...

first, would be the easiet, but i dont know if it would work
Code:
entity_set_size(iEnt, Float:{-16.0, -16.0, -30.0}, Float:{16.0, 16.0, 56.0}); // org -20(-20..)



increase the size of the entity, -x, -y, -z, x, y, z (make sure -x = x , -y = y etc ) like -x = 16.0 x = 16.0

Second... this is gonna be hard...
You will have to make a code to use the hitboxes of the model ( download zp 5.0 and look inside those scripts for that feature )
And, you will need a 3d artist to fix the model's hitboxes for you... in this case i recommand you this guy FromConcept2Art -> https://forums.alliedmods.net/member.php?u=235628

Last edited by Depresie; 07-15-2015 at 10:39.
Depresie is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode