Jump to content

Home

The *I Want to Change The playerState_t struct* thread !


Tchouky

Recommended Posts

Well most of yu should know that you shouldn't change the q_shared.h or q_shared.c files.

 

I really need to add something to tgis fu**ing structure, i really tried !

 

I modified it and changed the

BG_PlayerStateToEntityStateExtraPolate

BG_PlayerStateToEntityState

CG_EntityStateToPlayerState

 

and it s still crashing...

I know we must *somehow* be able to modify it.

If someone has a clue, another function to modify please say it!

Link to comment
Share on other sites

Okay here goes:

 

the shared files are basicly internal files used for the engine, so if you would edit them in anyway there is a very very big chance that the engine won't know them. However you can alter them aslong as the size total remains the same, but you're better off just leaving that alone. Some ingenius coder at IDsoftware has calculated it so that he knows exactly how many bits are in each position.

 

However here's a mapping of Q3's entityState beginning at eFlags made by Manuel Greed, as you can see it includes compiler directives for the qvms, i never used the code for anything so i don't know if it works, but it might be some help:

 

//Manuel - Greed - entityState mappings

// s# = short unsigned int

// l# = long int

// c# = unsigned char

 

typedef struct es_default_s{

 

#ifdef Q3_VM

//eFlags

unsigned :13; //Do not use

signed signed_19bit:19; //Signed -262143 to 262143

 

//pos.trType

unsigned :24; //Do not use

unsigned c1:8; //Unsigned char 0 to 255

#else

//eFlags

signed signed_19bit:19; //Signed -262143 to 262143

unsigned :13; //Do not use

 

//pos.trType

unsigned c1:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

#endif

 

//pos.trTime

int l1; //Signed long int

 

//pos.trDuration

int l2; //Signed long int

 

//pos.trBase

int float1[3]; //Floats index [0 - 2]

 

//pos.trDelta

int float2[3]; //Floats index [0 - 2]

 

#ifdef Q3_VM

//apos.trType

unsigned :24; //Do not use

unsigned c2:8; //Unsigned char 0 to 255

#else

//apos.trType

unsigned c2:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

#endif

 

//apos.trTime

int l3; //Signed long int

 

//apos.trDuration

int l4; //Signed long int

 

//apos.trBase

int float3[3]; //Floats index [0 - 2]

 

//apos.trDelta

int float4[3]; //Floats index [0 - 2]

 

//time

int l5; //Signed long int

 

//time2

int l6; //Signed long int

 

//origin, origin2, angles, angles2

int float5[12]; //Floats index [0 - 11]

 

#ifdef Q3_VM

//otherEntityNum

unsigned :22; //Do not use

signed signed_10bit1:10; //-511 to 511

 

//otherEntityNum2

unsigned :22; //Do not use

signed signed_10bit2:10; //-511 to 511

 

//groundEntityNum

unsigned :22; //Do not use

signed signed_10bit3:10; //-511 to 511

#else

//otherEntityNum

signed signed_10bit1:10; //-511 to 511

unsigned :22; //Do not use

 

//otherEntityNum2

signed signed_10bit2:10; //-511 to 511

unsigned :22; //Do not use

 

//groundEntityNum

signed signed_10bit3:10; //-511 to 511

unsigned :22; //Do not use

#endif

 

//constantLight

int l7; //Signed long int

 

#ifdef Q3_VM

//loopedSound

unsigned :24; //Do not use

unsigned c3:8; //Unsigned char 0 to 255

 

//modelIndex

unsigned :24; //Do not use

unsigned c3:8; //Unsigned char 0 to 255

 

//modelIndex2

unsigned :24; //Do not use

unsigned c5:8; //Unsigned char 0 to 255

 

//clientNum

unsigned :24; //Do not use

unsigned c6:8; //Unsigned char 0 to 255

 

//frame

unsigned :16; //Do not use

signed s1:16; //Signed -32767 to 32767

 

//solid

unsigned :8; //Do not use

signed signed_24bit:24; //-8388607 to 8388607

 

//event

unsigned :22; //Do not use

signed signed_10bit4:10; //-511 to 511

 

//eventParm

unsigned :24; //Do not use

unsigned c7:8; //Unsigned char 0 to 255

 

//powerups

unsigned :16; //Do not use

signed s2:16; //Signed -32767 to 32767

 

//weapon

unsigned :24; //Do not use

unsigned c8:8; //Unsigned char 0 to 255

 

//legsAnim

unsigned :24; //Do not use

unsigned c9:8; //Unsigned char 0 to 255

 

//torsoAnim

unsigned :24; //Do not use

unsigned c10:8; //Unsigned char 0 to 255

 

//generic1

unsigned :24; //Do not use

unsigned c11:8; //Unsigned char 0 to 255

#else

//loopedSound

unsigned c3:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

 

//modelIndex

unsigned c4:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

 

//modelIndex2

unsigned c5:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

 

//clientNum

unsigned c6:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

 

//frame

signed s1:16; //Signed -32767 to 32767

unsigned :16; //Do not use

 

//solid

signed signed_24bit:24; //-8388607 to 8388607

unsigned :8; //Do not use

 

//event

signed signed_10bit4:10; //-511 to 511

unsigned :22; //Do not use

 

//eventParm

unsigned c7:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

 

//powerups

signed s2:16; //Signed -32767 to 32767

unsigned :16; //Do not use

 

//weapon

unsigned c8:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

 

//legsAnim

unsigned c9:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

 

//torsoAnim

unsigned c10:8; //Unsigned char 0 to 255

unsigned :24; //Do not use

 

//generic1

unsigned c11:8; //Unsigned char 0 to 255

#endif

 

} es_default_t;

 

 

I think in general you might be better off just figuring out howto get it working with eg. STAT_ vars etc.

Link to comment
Share on other sites

Sorry wasn't clear writen I mean that If I only compile game with new var. and cgame without new var. it works. And if I compile game and cgame with new var. it doesn't work. But this you can only make if you didn't need the new var. in cgame/...

 

Again sorry for my bad english

Link to comment
Share on other sites

well obviously....the errors that happen are "prediction errors"

if you do not compile cgame with the new var it won't affect you, because the prediction routines are not hurt. (they are in cgame)

but playerstate_t struct is used to transmit data between server and client, so there's not much use in compiling only the jk2mpgame.qvm and not cgame.qvm

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...