Jump to content

Home

Client Server stuff in bg files:


plugboyuk

Recommended Posts

Okay, I've been using Quake III editing sites for most of my reference, and it appears that a few core things that QIII coders rely on are missing, and I was wondering if anyone had any ideas on how to get around them...

 

I'm trying to change the speed of a character based on what class he is. I want to multiply a scout's speed by 1.5, making him 50% faster... But first I need to know what class tha client is.

 

The place where you can alter his speed is located in a bg file, and is used so the client can predict his location without talking to the server. This means the only thing I have to work with is a playerstate_t, as it is the only thing shared between both the client and the server.

 

So my first thought was to add a new variable to the playerstate_t class, but that screws everything up, and my map appears with no entities at all on it.

 

Then I notice a comment above the playerstate struct, which says to change the contents of the playerstate I need to make changes to msg.c.

 

Unfortunately, there is no msg.c :-(

 

I also can't seem to get CVars to work in the bg file, so I'm pretty lost with what I can do next.

 

Any help would be most appreciated.

 

Chris

Link to comment
Share on other sites

Don't change anything to q_shared.h or q_shared.c

 

(I agree with you now Ask :) )

 

if you change the playerstate struct the game will be screwed...

create an extern struct containing an array [MAX_ENTITY]

and add your changes to it ...

that's how i do it ...

(not very clean but it works )

Link to comment
Share on other sites

Team Fortress yes, but not in relation with JK2 :)

 

anyway, this has nothing todo with your above statement if i get it right, u want something like this:

 

switch( ent->client->pers.yourplayerclass )

{

case SCOUT:

client->ps.speed *= 1.2;

break;

case IMPERIAL:

client->ps.speed *= 1.0;

break;

case SITH:

client->ps.speed *= 1.1;

break;

}

Link to comment
Share on other sites

I need to do it in the bg file surely, otherwise if I do it in game, the client will predict the player's position incorrectly, as it will not be aware he's moving at 1.5x the normal speed.

 

Therefore I need to do it in BG_Move, which is called by both the client and the server, so I know they are both coming up with the same result.

 

As I said before, the only thing I have access to from here, (to my knowledge) is the playerstate_t.... I have the clientNum, but that's it, I don't even have access to the global entity or client lists.

 

Chris

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...