Jump to content

Home

Is there a way to set CG commands to affect BG/G code?


Scarlett

Recommended Posts

I think it may not be possible, but i need to set a flag in cgame and then check for the flag in bgame (specificly bg_pmove.c).

Is there any known way to do this? What i'm trying to do is make it so if the client is in first person, then they won't be able to perform rolls, flips, etc... as it is in single player.

Link to comment
Share on other sites

ok, you gotta have that cvar transfer its data to the server (note that this is slower than a "normal" because it's cvar data AND takes more bandwidth) by setting the client cvar with the CVAR_USERINFO flag. Then you retrieve the cvar data from that client and input it into the pmove_t data struct (you can add varibles to this struct freely).

 

See http://www.planetquake.com/code3arena/articles/article9.shtml for more information on cvar communication.

Link to comment
Share on other sites

Then you retrieve the cvar data from that client and input it into the pmove_t data struct

 

But how? In bg_public.h right? I've never done anything like this before. Everything i've done thus far i've accomplished just by looking at existing examples... if there arn't any, i'm lost.

Link to comment
Share on other sites

Yeah.... umm, well i've set the CVAR_USERINFO flag for the cg_thirdPerson cvar and g_active.c still isn't recognizing it...

 

i basicly need it to look something like this, in g_active.c i guess then (before the "Pmove (&pm)" call... i don't think there's any reason to set this before the other one in there):

if (cg_thirdPerson.integer && !cg.snap->ps.zoomMode)
{
   pm->ps->pm_flags &= ~PMF_FIRSTPERSON;
}
else
{
   pm->ps->pm_flags |= PMF_FIRSTPERSON;
}

 

Of course though.. none of that works in there as i have no idea how to set it up specificly for the file...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...