Jump to content

Home

bg_pmove.c trouble


SecretChord

Recommended Posts

I'm trying to use a server set cvar or bit of level data or just something to control something in bg_pmove.c

 

I can easily create the command to change what I need to change, or use an if statement on whatever I end up using to do what I want.. but the bit in between is a little dodgy. When I tried using a server cvar in bg_pmove.c (like g_mycvar.integer) I got an undeclared identifier error. When I tried using level.mydata I got an error aswell. g_gametype is used in bg_pmove.c so I thought there might be a way to do it.. if anyone has a suggestion as to how I should achieve this, your help would be greatly appreciated.

Link to comment
Share on other sites

It's because bg_ is exactly like it menas "Both Games" IE: Client/Server. Either, have it for server-only or predict it on the client somehow.

 

ie:

 

#ifdef QAGAME (might not be this preprocessor define though not sure)
#define MYCVAR g_mycvar.integer
#elif CGAME
#define MYCVAR cgs.mycvar
#end

 

or

 

#ifdef QAGAME (might not be this preprocessor define though not sure)
#define MYCVAR g_mycvar.integer
#elif CGAME
#define MYCVAR 0
#end

 

then use MYCVAR where you are checking for cvar stuff.

Link to comment
Share on other sites

Oh yeah, there was another way I tried to do it in bg_pmove. I made a conditional like this:

 

#ifdef QAGAME

Blah blah server side cvar

#elif CGAME

Get the value of this cvar from the server

#endif

 

When I get back home i'll give you the exact instruction of getting the cvar from the server, I forget it now.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...