Quake3World.com Forums
     Programming Discussion
        Accessing server cvars in bg_*


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: Accessing server cvars in bg_*

Grunt
Grunt
Joined: 17 Jun 2008
Posts: 59
PostPosted: 07-05-2008 07:50 AM           Profile Send private message  E-mail  Edit post Reply with quote


Hello again,

Can anyone tell me how to access cvars which I declared in g_local.h and g_main.c in the
the files starting with bg_*. I want to check a cvar in bg_misc.c which I declared g_local.h in but it's not available/visible.

This is probably not a Quake question but more basic C stuff and it really underlines my lack of skills in C. :(

Can anyone throw me a bone on this?

Cheers




Top
                 

Insane Quaker
Insane Quaker
Joined: 06 Sep 2002
Posts: 399
PostPosted: 07-05-2008 06:08 PM           Profile Send private message  E-mail  Edit post Reply with quote


since bg_* files are used by both game and cgame, you cant access the cvars directly.
you need to work with the CVAR_SERVERINFO flag and access them via trap_GetServerinfo & Info_ValueForKey
depending on how often you need them, you might wanna save them temporarily in a variable instead of parsing the serverinfo each frame.




Top
                 

Grunt
Grunt
Joined: 17 Jun 2008
Posts: 59
PostPosted: 07-06-2008 03:49 AM           Profile Send private message  E-mail  Edit post Reply with quote


Thanks a lot for your reply Bandit.




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.