Raised This Month: $51 Target: $400
 12% 

What are the constants returned by Ham_Classify?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-28-2016 , 14:58   What are the constants returned by Ham_Classify?
Reply With Quote #1

Hi friends, I am wondering if there are constants (or at least an explanation) for the values returned by Ham_Classify. I haven't been able to find it. As far as I can tell, 0 is some non-player entity, 2 is a player entity. That's as far as I know. More knowledge would be helpful.
__________________
Bad_Bud is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-28-2016 , 16:14   Re: What are the constants returned by Ham_Classify?
Reply With Quote #2

I believe Classify's implementation is very game-dependent, different games may have completely different entity classifications.

What game are you interested in? And also, what are you trying to achieve with it?
klippy is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 08-28-2016 , 17:05   Re: What are the constants returned by Ham_Classify?
Reply With Quote #3

These are for CS (minus CLASS_VEHICLE for Half-Life)

Code:
#define CLASS_NONE 0
#define CLASS_MACHINE 1
#define CLASS_PLAYER 2
#define CLASS_HUMAN_PASSIVE 3
#define CLASS_HUMAN_MILITARY 4
#define CLASS_ALIEN_MILITARY 5
#define CLASS_ALIEN_PASSIVE 6
#define CLASS_ALIEN_MONSTER 7
#define CLASS_ALIEN_PREY 8
#define CLASS_ALIEN_PREDATOR 9
#define CLASS_INSECT 10
#define CLASS_PLAYER_ALLY 11
#define CLASS_PLAYER_BIOWEAPON 12
#define CLASS_ALIEN_BIOWEAPON 13
#define CLASS_VEHICLE 14
#define CLASS_BARNACLE 99
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-28-2016 , 17:05   Re: What are the constants returned by Ham_Classify?
Reply With Quote #4

This is for The Specialists in particular.

I check a lot of entities from time to time and I was wondering if there was a useful application of Ham_Classify rather than checking classnames. I was also wondering if I could use it in a HamTakedamage to see if the damage source was non-player (it would be more readable to an inexperienced third party for something like AttackerClassify != Player rather than attacker != 0 && attacker <= maxplayers).

So far it seems like it's probably something along the lines of... Classify 0 is world and brush entities, 1 is maybe a point entity, and 2 is players.
__________________

Last edited by Bad_Bud; 08-28-2016 at 17:06.
Bad_Bud is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-28-2016 , 17:07   Re: What are the constants returned by Ham_Classify?
Reply With Quote #5

Quote:
Originally Posted by NiHiLaNTh View Post
These are for CS (minus CLASS_VEHICLE for Half-Life)

Code:
#define CLASS_NONE 0
#define CLASS_MACHINE 1
#define CLASS_PLAYER 2
#define CLASS_HUMAN_PASSIVE 3
#define CLASS_HUMAN_MILITARY 4
#define CLASS_ALIEN_MILITARY 5
#define CLASS_ALIEN_PASSIVE 6
#define CLASS_ALIEN_MONSTER 7
#define CLASS_ALIEN_PREY 8
#define CLASS_ALIEN_PREDATOR 9
#define CLASS_INSECT 10
#define CLASS_PLAYER_ALLY 11
#define CLASS_PLAYER_BIOWEAPON 12
#define CLASS_ALIEN_BIOWEAPON 13
#define CLASS_VEHICLE 14
#define CLASS_BARNACLE 99
Where did you get this from, or did you have to guess?
__________________
Bad_Bud is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 08-28-2016 , 17:10   Re: What are the constants returned by Ham_Classify?
Reply With Quote #6

Those constants are located inside cbase.h.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-28-2016 , 17:13   Re: What are the constants returned by Ham_Classify?
Reply With Quote #7

Would they potentially be different on a mod to mod basis as KliPPy suggests? I don't think I would be able to view this for TS.
__________________

Last edited by Bad_Bud; 08-28-2016 at 17:14.
Bad_Bud is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 08-28-2016 , 18:08   Re: What are the constants returned by Ham_Classify?
Reply With Quote #8

Yes it might be. All you can do is to try to debug ::Classify value for certain entities (player, ..., etc.). Although I am pretty sure that the first 3 constants are the same even for TS.

Also, it is worth mentioning that if you want to check whether a certain entity is a player, you can try using Ham_IsPlayer. But once again I am not sure if this method is present in TS.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 09-02-2016 , 05:42   Re: What are the constants returned by Ham_Classify?
Reply With Quote #9

I guess I should mention I found it useful to RegisterHam a Ham_Classify for all the entity classnames I care about, and always call the ExecuteHamB version.
__________________
Bad_Bud is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 09-02-2016 , 08:09   Re: What are the constants returned by Ham_Classify?
Reply With Quote #10

Classify is used mostly for NPCs (monster_ entities)

What do you want to do?
__________________

Last edited by gabuch2; 09-02-2016 at 08:09.
gabuch2 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 01:22.


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