AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [:3] TF2_PlayerClassData (https://forums.alliedmods.net/showthread.php?t=132082)

Wazz 07-11-2010 17:17

[:3] TF2_PlayerClassData
 
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.

xomp 07-11-2010 17:18

Re: [:3] TF2_PlayerClassData
 
LAZY FLAME!!!!

KawMAN 07-12-2010 06:57

Re: [:3] TF2_PlayerClassData
 
PHP Code:

m_bDontDoNewJump 

unlimited scout air jumps ?

psychonic 07-12-2010 07:37

Re: [:3] TF2_PlayerClassData
 
Quote:

Originally Posted by KawMAN (Post 1236470)
PHP Code:

m_bDontDoNewJump 

unlimited scout air jumps ?

My guess is that it sets whether or not a class can double jump.

Wazz 07-12-2010 08:26

Re: [:3] TF2_PlayerClassData
 
And your guess is as good as mine!

Swixel 09-04-2010 04:02

Re: [:3] TF2_PlayerClassData
 
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.


Wazz 09-04-2010 09:03

Re: [:3] TF2_PlayerClassData
 
Yea 4 seems to represent nothing. 3 would be a sapper, and I presume the others correlate with m_iObjectType

DJ Tsunami 09-04-2010 09:44

Re: [:3] TF2_PlayerClassData
 
3 is the object type of the sapper :3

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
};


Swixel 09-05-2010 07:02

Re: [:3] TF2_PlayerClassData
 
Quote:

Originally Posted by Wazz (Post 1290799)
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.

Wazz 09-05-2010 07:25

Re: [:3] TF2_PlayerClassData
 
There's probably six simply due to bad planning by Valve, I wouldn't dwell on it too much.

psychonic 09-05-2010 11:22

Re: [:3] TF2_PlayerClassData
 
Quote:

Originally Posted by Swixel (Post 1291742)
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.

I haven't actually checked, but it's likely done with m_bMiniBuilding and/or m_iObjectMode.

Unrelated, does anyone happen to know what object flags are for? m_fObjectFlags


All times are GMT -4. The time now is 18:58.

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