Raised This Month: $ Target: $400
 0% 

[:3] TF2_PlayerClassData


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 07-11-2010 , 17:17   [:3] TF2_PlayerClassData
Reply With Quote #1

Psychonic mentioned the existence of the a struct in the TF2 server binary called TFPlayerClassData_t, I went ahead and reversed it and found some thing that may be of interest to others.

I threw everything into a quick extension which provides SM plugins with a bunch of natives for editting class data as an example of what can be done with the data contained in the struct.

The code can be found here, along with some SM files and compiled binaries
http://hg.paulclothier.com/TF2_PlayerClassData/

Here is the struct, to save you from having to look through the files above
PHP Code:
struct TFPlayerClassData_t                            // 1256
{
    
char m_szName[128];                                // +0
    
char m_szModel[128];                            // +128    
    
char m_szModelHWM[128];                            // +256
    
char m_szModelHands[128];                        // +384
    
char m_szLocalizedName[128];                    // +512
    
float m_flMaxSpeed;                                // +640
    
uint32 m_iMaxHealth;                            // +644
    
uint32 m_iMaxArmor;                                // +648
    
uint32 m_iWeaponID[5];                            // +652
    
uint32 m_iGrenadeID[2];                            // +672
    
char m_padding0[4];                                // +680
    
uint32 m_iMaxAmmo[5];                            // +684
    
uint32 m_iBuildableID[6];                        // +704
    
bool m_bDontDoAirWalk;                            // +728
    
bool m_bDontDoNewJump;                            // +729
    
bool m_bInitialized;                            // +730
    
float m_flCameraOffsetForward;                    // +732
    
float m_flCameraOffsetRight;                    // +736
    
float m_flCameraOffsetUp;                        // +740
    
char m_szDeathSound[128];                        // +744
    
char m_szCritDeathSound[128];                    // +872
    
char m_szMeleeDeathSound[128];                    // +1000
    
char m_szExplosionDeathSound[128];                // +1128
}; 
Why am I posting this here? The extension has not been fully tested and I have little desire to support it, anyone it welcome to take it and post it in the extension forum if they are willing to support it themselves.
Wazz is offline
xomp
BANNED
Join Date: Jul 2008
Old 07-11-2010 , 17:18   Re: [:3] TF2_PlayerClassData
Reply With Quote #2

LAZY FLAME!!!!
xomp is offline
Send a message via Skype™ to xomp
KawMAN
SourceMod Donor
Join Date: Sep 2007
Location: Cracov
Old 07-12-2010 , 06:57   Re: [:3] TF2_PlayerClassData
Reply With Quote #3

PHP Code:
m_bDontDoNewJump 
unlimited scout air jumps ?
__________________
KawMAN is offline
Send a message via ICQ to KawMAN Send a message via Skype™ to KawMAN
psychonic

BAFFLED
Join Date: May 2008
Old 07-12-2010 , 07:37   Re: [:3] TF2_PlayerClassData
Reply With Quote #4

Quote:
Originally Posted by KawMAN View Post
PHP Code:
m_bDontDoNewJump 
unlimited scout air jumps ?
My guess is that it sets whether or not a class can double jump.
psychonic is offline
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 07-12-2010 , 08:26   Re: [:3] TF2_PlayerClassData
Reply With Quote #5

And your guess is as good as mine!
Wazz is offline
Swixel
Senior Member
Join Date: Jul 2010
Location: Sydney, Australia
Old 09-04-2010 , 04:02   Re: [:3] TF2_PlayerClassData
Reply With Quote #6

Code:
uint32 m_iBuildableID[6];                        // +704


Scout (Class 1) [4,4,4,4,4,4]
Sniper (Class 2) [4,4,4,4,4,4]
Soldier (Class 3)
[4,4,4,4,4,4]
Demo (Class 4)
[4,4,4,4,4,4]
Medic (Class 5)
[4,4,4,4,4,4]
Heavy (Class 6)
[4,4,4,4,4,4]
Pyro (Class 7)
[4,4,4,4,4,4]
Spy (Class 8 )[3,4,4,4,4]
Engineer (Class 9) [2,0,1,4,4,4]


All straight from the natives Wazz provided. Wonder what the numbers do, and why there's 6.

Swixel is offline
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 09-04-2010 , 09:03   Re: [:3] TF2_PlayerClassData
Reply With Quote #7

Yea 4 seems to represent nothing. 3 would be a sapper, and I presume the others correlate with m_iObjectType
Wazz is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 09-04-2010 , 09:44   Re: [:3] TF2_PlayerClassData
Reply With Quote #8

3 is the object type of the sapper

Code:
enum TFObjectType
{
    TFObject_CartDispenser = 0,
    TFObject_Dispenser = 0,
    TFObject_Teleporter = 1,
    TFObject_Sentry = 2,
    TFObject_Sapper = 3
};

enum TFObjectMode
{
    TFObjectMode_None = 0,
    TFObjectMode_Entrance = 0,
    TFObjectMode_Exit = 1
};
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
Swixel
Senior Member
Join Date: Jul 2010
Location: Sydney, Australia
Old 09-05-2010 , 07:02   Re: [:3] TF2_PlayerClassData
Reply With Quote #9

Quote:
Originally Posted by Wazz View Post
Yea 4 seems to represent nothing. 3 would be a sapper, and I presume the others correlate with m_iObjectType
Aye, ta guys; I got that far, I just mean "why are there 6?" I guess.

Also, I assume the mini-sentry is just a sentry object type, or that it changes per instance based on the item attribute affecting the bearer's object/buildables array.
Swixel is offline
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 09-05-2010 , 07:25   Re: [:3] TF2_PlayerClassData
Reply With Quote #10

There's probably six simply due to bad planning by Valve, I wouldn't dwell on it too much.
Wazz 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 19:37.


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