SecretChord Posted January 25, 2007 Share Posted January 25, 2007 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 More sharing options...
ensiform Posted January 25, 2007 Share Posted January 25, 2007 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 More sharing options...
Tinny Posted January 25, 2007 Share Posted January 25, 2007 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 More sharing options...
ensiform Posted January 25, 2007 Share Posted January 25, 2007 That's what i just said. cgs.mycvar would be coming from serverinfo or however you wish to send the data to clients. Link to comment Share on other sites More sharing options...
Tinny Posted January 25, 2007 Share Posted January 25, 2007 I'm sorry, what you posted actually seems simpler. I remember doing something that looked more complicated than what is needed. Link to comment Share on other sites More sharing options...
SecretChord Posted January 29, 2007 Author Share Posted January 29, 2007 Thanks ensiform, what you posted (well similar) worked first time Link to comment Share on other sites More sharing options...
ensiform Posted January 29, 2007 Share Posted January 29, 2007 Well i use a configstring now so i can easily steal JA+ serverinfo and run my client on a JA+ without the need for using servercmds. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.